private void BackWard(object sender, RoutedEventArgs e) { CustomersWindow cw = new CustomersWindow(); cw.Show(); this.Close(); }
private void Customers(object sender, RoutedEventArgs e) { CustomersWindow mw = new CustomersWindow(); mw.Show(); this.Close(); }
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(); } }