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.Shapes; namespace SneakersSkakunov { /// /// Логика взаимодействия для RedactAuth.xaml /// public partial class RedactAuth : Window { Sniker snk = new Sniker(); Users user = new Users(); public RedactAuth(int UsId) { InitializeComponent(); user = snk.Users.Where(x => x.id_Users == UsId).FirstOrDefault(); lg.Text = user.Login.ToString(); } private void FixChange(object sender, RoutedEventArgs e) { user.Login = lg.Text; string CurPass = pss.Text; using (SHA256 hash = SHA256.Create()) { CurPass = BitConverter.ToString(hash.ComputeHash(Encoding.UTF8.GetBytes(CurPass))).Replace("-", ""); } user.Password = CurPass; snk.SaveChanges(); MainFrame.mframe.Navigate(new UserPage(user.id_Users)); MessageBox.Show("Изменения сохранены"); } private void Back(object sender, RoutedEventArgs e) { this.Close(); } } }