예제 #1
0
        private void editCustomer()
        {
            var selectedItem = (Customer)dgCustomerList.SelectedItem;

            if (selectedItem == null)
            {
                return;
            }



            var frmAddEditCustomer = new frmAddEditCustomer(selectedItem);

            if (frmAddEditCustomer.ShowDialog() == true)
            {
                var productManager = new CustomerManager();
                dgCustomerList.ItemsSource =
                    productManager.GetCustomersByActive((bool)chkShowActive.IsChecked);


                dgCustomerList.Columns[0].Header = "Customer ID";
                dgCustomerList.Columns[1].Header = "Business Name";
                dgCustomerList.Columns[2].Header = "First Name";
                dgCustomerList.Columns[3].Header = "Last Name";
                dgCustomerList.Columns[4].Header = "Email";
                dgCustomerList.Columns[5].Header = "Phone Number";
                dgCustomerList.Columns[6].Header = "Active";
            }
        }
예제 #2
0
        private void btnAddCustomer_Click(object sender, RoutedEventArgs e)
        {
            var frmcustomerAddEdit = new frmAddEditCustomer();

            if (frmcustomerAddEdit.ShowDialog() == true)
            {
                var customerManager = new CustomerManager();
                dgCustomerList.ItemsSource =
                    customerManager.GetCustomersByActive((bool)chkShowActive.IsChecked);

                dgCustomerList.Columns[0].Header = "Customer ID";
                dgCustomerList.Columns[1].Header = "Business Name";
                dgCustomerList.Columns[2].Header = "First Name";
                dgCustomerList.Columns[3].Header = "Last Name";
                dgCustomerList.Columns[4].Header = "Email";
                dgCustomerList.Columns[5].Header = "Phone Number";
                dgCustomerList.Columns[6].Header = "Active";
            }
        }