using System; using System.Collections.Generic; using System.IO; 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.Shapes; using System.Xml.Linq; namespace SneakersSkakunov { /// /// Логика взаимодействия для Redact.xaml /// public partial class Redact : Window { Sniker snk = new Sniker(); Users user = new Users(); public Redact(int UsId) { InitializeComponent(); user = snk.Users.Where(x => x.id_Users == UsId).FirstOrDefault(); fam.Text = user.Surname; imya.Text = user.Name; otch.Text = user.Patronymic; BirthDate.SelectedDate = user.DateBirth; } private void Edit(object sender, RoutedEventArgs e) { user.Surname = fam.Text; user.Name = imya.Text; user.Patronymic = otch.Text; user.DateBirth = BirthDate.SelectedDate; snk.SaveChanges(); MainFrame.mframe.Navigate(new UserPage(user.id_Users)); MessageBox.Show("Изменения сохранены"); } private void Back(object sender, RoutedEventArgs e) { this.Close(); } } }