using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace SSS { /// /// Логика взаимодействия для Izmen.xaml /// public partial class Izmen : Page { Entities ent = new Entities(); Client user = new Client(); public Izmen(int UsId) { InitializeComponent(); user = ent.Client.Where(x => x.id_Client == UsId).FirstOrDefault(); Srname.Text = user.Surname; Nam.Text = user.Name; Patr.Text = user.Patronymic; DateBirth.SelectedDate = user.BirthDate; } private void Edit(object sender, RoutedEventArgs e) { user.Surname = Srname.Text; user.Name = Nam.Text; user.Patronymic = Patr.Text; user.BirthDate = DateBirth.SelectedDate; ent.SaveChanges(); MainFrame.Name1.Navigate(new Page3(user.id_Client)); MessageBox.Show("Изменения сохранены"); } private void Back(object sender, RoutedEventArgs e) { this.Close(); } } }