using System.Collections.Generic; using EnterpriseSample.Core.Domain; using EnterpriseSample.Presenters; using EnterpriseSample.Presenters.ViewInterfaces; using EnterpriseSample.Web; /// <summary> /// In this page, as opposed to within EditCustomer.aspx, the view and the ASPX-view-initializer /// are one and the same. /// </summary> public partial class ListCustomers : BasePage, IListCustomersView { protected override void PageLoad() { if (!IsPostBack) { DisplayMessage(); InitView(); } } private void InitView() { ListCustomersPresenter presenter = new ListCustomersPresenter(this, DaoFactory.GetCustomerDao()); presenter.InitView(); } private void DisplayMessage() { if (Request.QueryString["action"] == "updated") { lblMessage.Text = "The customer was successfully updated."; } else if (Request.QueryString["action"] == "added") { lblMessage.Text = "The customer was successfully added."; } else { lblMessage.Text = "Click a customer's ID to edit the customer."; } } public IList<Customer> Customers { set { grdEmployees.DataSource = value; grdEmployees.DataBind(); } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)