Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ICustomerService customerService = new CustomerServiceInMemory();
            var CustomerList = customerService.GetCustomers();

            gridCustomers.DataSource = CustomerList;
            gridCustomers.DataBind();
        }
Пример #2
0
        protected void cmdAddCustomer_Click(object sender, EventArgs e)
        {
            ICustomerService customerService = new CustomerServiceInMemory();

            CustomerEntity newCustomer = new CustomerEntity {
                FirstName = txtFirstName.Text,
                LastName  = txtLastName.Text,
                Company   = txtCompany.Text,
                Email     = txtEMailAddress.Text,
                WorkPhone = txtWorkPhone.Text,
                HomePhone = txtHomePhone.Text
            };

            customerService.Create(newCustomer);

            Response.Redirect("Customers");
        }
        protected void cmdAddCustomer_Click(object sender, EventArgs e)
        {
            ICustomerService customerService = new CustomerServiceInMemory();

            CustomerEntity newCustomer = new CustomerEntity {
                FirstName = txtFirstName.Text,
                LastName = txtLastName.Text,
                Company = txtCompany.Text,
                Email = txtEMailAddress.Text,
                WorkPhone = txtWorkPhone.Text,
                HomePhone = txtHomePhone.Text
            };

            customerService.Create(newCustomer);

            Response.Redirect("Customers");
        }