Beispiel #1
0
 public UcEditCustomer(Customer customer)
 {
     InitializeComponent();
     this.customer  = customer;
     this.presenter = new EditCustomerPresenter(this);
     InitializeFields();
 }
Beispiel #2
0
        public void CanUpdateCustomer()
        {
            EditCustomerViewStub  view      = new EditCustomerViewStub();
            EditCustomerPresenter presenter = new EditCustomerPresenter(view);

            presenter.InitViewWith(TestGlobals.TestCustomer.ID);
            presenter.Update();
        }
Beispiel #3
0
        public void CanInitView()
        {
            EditCustomerViewStub  view      = new EditCustomerViewStub();
            EditCustomerPresenter presenter = new EditCustomerPresenter(view);

            view.AttachPresenter(presenter);
            presenter.InitViewWith(TestGlobals.TestCustomer.ID);

            Assert.AreEqual(TestGlobals.TestCustomer.ID, view.Customer.ID);
            Assert.AreEqual(TestGlobals.TestCustomer.CompanyName, view.Customer.CompanyName);
            Assert.AreEqual(TestGlobals.TestCustomer.ContactName, view.Customer.ContactName);
        }
    private void InitEditCustomerView()
    {
        presenter = new EditCustomerPresenter(this);
        ctrlEditCustomerView.AttachPresenter(presenter);

        // Listen for events coming from the view
        ctrlEditCustomerView.UpdateCompleted += HandleUpdateCompleted;
        ctrlEditCustomerView.UpdateCancelled += HandleUpdateCancelled;

        if (!IsPostBack)
        {
            presenter.InitViewWith(CustomerId);
        }
    }
 public void AttachPresenter(EditCustomerPresenter presenter)
 {
     this.presenter = presenter;
 }
Beispiel #6
0
 public void AttachPresenter(EditCustomerPresenter presenter)
 {
 }