コード例 #1
0
        private void CustomerView_Click(object sender, RoutedEventArgs e)
        {
            ViewCustomer viewcus = new ViewCustomer(); //create your new form.

            viewcus.Show();                            //show the new form.
            this.Close();
        }
コード例 #2
0
        private void BtnDelete_Click(object sender, RoutedEventArgs e)
        {
            DialogResult result = System.Windows.Forms.MessageBox.Show("Are you sure delete this customer?", "Important Query",
                                                                       MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                object customer = dataGridView.SelectedItem;
                string id       = (dataGridView.SelectedCells[0].Column.GetCellContent(customer) as TextBlock).Text;
                cs.DeleteCustomerById(Int32.Parse(id));
                ViewCustomer viewCustomer = new ViewCustomer(); //create your new form.
                viewCustomer.Show();                            //show the new form.
                this.Close();
            }
        }
コード例 #3
0
        private void Update_Click(object sender, RoutedEventArgs e)
        {
            Customer customer = new Customer()
            {
                Id       = Int32.Parse(this.TxtCustomerId.Text),
                Name     = this.TxtName.Text,
                Address  = this.TxtAddress.Text,
                IsMember = IsMemberCheck.IsChecked.Value
            };

            cs.UpdateCustomer(customer);
            MessageBox.Show("Successfully Update Customer!");
            ViewCustomer viewCustomer = new ViewCustomer(); //create your new form.

            viewCustomer.Show();                            //show the new form.
            this.Close();
        }