12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 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
- {
- /// <summary>
- /// Логика взаимодействия для IzmenPar.xaml
- /// </summary>
- 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();
- }
- }
- }
|