コード例 #1
0
        private void BackWard(object sender, RoutedEventArgs e)
        {
            CustomersWindow cw = new CustomersWindow();

            cw.Show();
            this.Close();
        }
コード例 #2
0
        private void Customers(object sender, RoutedEventArgs e)
        {
            CustomersWindow mw = new CustomersWindow();

            mw.Show();
            this.Close();
        }
コード例 #3
0
        private void Adding(object sender, RoutedEventArgs e)
        {
            if (NameCustomer.Text == "" || PhoneNumber.Text == "" || Adress.Text == "")
            {
                MessageBox.Show("Возникла ошибка! Возможно вы не заполнили поля");
                return;
            }
            else
            {
                Customers customers = new Customers();
                customers.NameCustomer = NameCustomer.Text;
                customers.PhoneNumber  = Convert.ToInt32(PhoneNumber.Text);
                customers.Adress       = Adress.Text;

                db.Customers.Add(customers);
                db.SaveChanges();
                MessageBox.Show("Добавлен заказчик");
                CustomersWindow cw = new CustomersWindow();
                cw.Show();
                this.Close();
            }
        }