diff options
| author | mo khan <mo@mokhan.ca> | 2007-08-26 20:10:42 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2007-08-26 20:10:42 -0600 |
| commit | 330be9feefb6394479553be0e078b4c4df3cbff1 (patch) | |
| tree | 55618c8af0d36583cde0ea5b4b193b98815a35aa /src/app/Cmpp298.Assignment3.Desktop.Presentation/DeleteInvoicePresenter.cs | |
import from svntrunk
Diffstat (limited to 'src/app/Cmpp298.Assignment3.Desktop.Presentation/DeleteInvoicePresenter.cs')
| -rw-r--r-- | src/app/Cmpp298.Assignment3.Desktop.Presentation/DeleteInvoicePresenter.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/app/Cmpp298.Assignment3.Desktop.Presentation/DeleteInvoicePresenter.cs b/src/app/Cmpp298.Assignment3.Desktop.Presentation/DeleteInvoicePresenter.cs new file mode 100644 index 0000000..4912e30 --- /dev/null +++ b/src/app/Cmpp298.Assignment3.Desktop.Presentation/DeleteInvoicePresenter.cs @@ -0,0 +1,36 @@ +using Cmpp298.Assignment3.Dto;
+using Cmpp298.Assignment3.Task;
+
+namespace Cmpp298.Assignment3.Presentation {
+ public class DeleteInvoicePresenter {
+ private readonly string _invoiceId;
+ private readonly IDeleteInvoiceView _view;
+ private readonly IInvoiceTask _invoiceTask;
+
+ public DeleteInvoicePresenter( string invoiceId, IDeleteInvoiceView view )
+ : this( invoiceId, view, new InvoiceTask( ) ) {}
+
+ public DeleteInvoicePresenter( string invoiceId, IDeleteInvoiceView view, IInvoiceTask invoiceTask ) {
+ _invoiceId = invoiceId;
+ _view = view;
+ _invoiceTask = invoiceTask;
+ }
+
+ public void Initialize( ) {
+ DisplayInvoiceDto dto = _invoiceTask.GetInvoiceBy( _invoiceId );
+ _view.VendorName = dto.VendorName;
+ _view.InvoiceNumber = dto.InvoiceNumber;
+ _view.InvoiceDate = dto.InvoiceDate;
+ _view.InvoiceTotal = dto.InvoiceTotal;
+ _view.PaymentTotal = dto.PaymentTotal;
+ _view.CreditTotal = dto.CreditTotal;
+ _view.DueDate = dto.DueDate;
+ _view.PaymentDate = dto.PaymentDate;
+ _view.Terms = dto.Terms;
+ }
+
+ public void DeleteInvoice( ) {
+ _invoiceTask.DeleteInvoice( _invoiceId );
+ }
+ }
+}
\ No newline at end of file |
