private void Button_Click_1(object sender, RoutedEventArgs e) { ClientView cv = new ClientView(); cv.Show(); Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { try { Model1 db = new Model1(); Clients client = new Clients { username = login.Text, password = password.Text, first_name = name.Text, last_name = family.Text, phone = phone.Text, email = email.Text }; db.Clients.Add(client); db.SaveChanges(); MessageBox.Show("Клиент добавлен!"); ClientView cv = new ClientView(); cv.Show(); Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void MenuItem_Click_2(object sender, RoutedEventArgs e) { ClientView cv = new ClientView(); cv.Show(); Close(); }
private void viewClient_Click(object sender, RoutedEventArgs e) { LogicOrders.pr = price.Text; LogicOrders.des = description.Text; ClientView cv = new ClientView(); cv.Show(); Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { Model1 db = new Model1(); int a = Convert.ToInt32(idtxt.Text); var cls = db.Clients .Where(c => c.id_user == a) .FirstOrDefault(); cls.username = username.Text; cls.password = password.Text; cls.last_name = last.Text; cls.first_name = first.Text; cls.phone = phone.Text; cls.email = email.Text; db.SaveChanges(); MessageBox.Show("Данные о клиенте изменены!"); ClientView cv = new ClientView(); cv.Show(); Close(); }