using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; 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 { /// /// Логика взаимодействия для IzmenPar.xaml /// public partial class IzmenPar : Window { Entities ent = new Entities(); Client user = new Client(); public IzmenPar(int UsId) { InitializeComponent(); user = ent.Client.Where(x => x.id_Client == UsId).FirstOrDefault(); Login.Text = user.Login.ToString(); } private void FixChange(object sender, RoutedEventArgs e) { user.Login = Login.Text; string CurPass = Pass.Text; using (SHA256 hash = SHA256.Create()) { CurPass = BitConverter.ToString(hash.ComputeHash(Encoding.UTF8.GetBytes(CurPass))).Replace("-", ""); } user.Password = CurPass; ent.SaveChanges(); MainFrame.Name1.Navigate(new Page3(user.id_Client)); MessageBox.Show("Изменения сохранены"); } private void Back(object sender, RoutedEventArgs e) { this.Close(); } } }