main
1using System.Collections.Generic;
2using MoMoney.DTO;
3using MoMoney.Presentation.Core;
4using MoMoney.Presentation.Presenters;
5using momoney.presentation.views;
6using MoMoney.Service.Contracts.Application;
7
8namespace momoney.presentation.presenters
9{
10 public interface IAddBillPaymentPresenter : IContentPresenter
11 {
12 void submit_bill_payment(AddNewBillDTO dto);
13 }
14
15 public class AddBillPaymentPresenter : ContentPresenter<IAddBillPaymentView>, IAddBillPaymentPresenter
16 {
17 readonly ICommandPump pump;
18
19 public AddBillPaymentPresenter(IAddBillPaymentView view, ICommandPump pump) : base(view)
20 {
21 this.pump = pump;
22 }
23
24 public override void run()
25 {
26 view.attach_to(this);
27 pump
28 .run<IEnumerable<CompanyDTO>, IGetAllCompanysQuery>(view)
29 .run<IEnumerable<BillInformationDTO>, IGetAllBillsQuery>(view);
30 }
31
32 public void submit_bill_payment(AddNewBillDTO dto)
33 {
34 pump
35 .run<ISaveNewBillCommand, AddNewBillDTO>(dto)
36 .run<IEnumerable<BillInformationDTO>, IGetAllBillsQuery>(view);
37 }
38 }
39}