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(); }