using Servise.Classes; using System; using System.Data.SqlClient; using System.Windows.Forms; namespace Servise.Forms.User { public partial class edpass : Form { DataBase conect = new DataBase(); public edpass() { InitializeComponent(); } private void edpass_Load(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) { }         //Проверка пароля и сохранение в БД         private void EditPas_Click(object sender, EventArgs e) { if (textBox1.Text == textBox2.Text || textBox1.Text == textBox3.Text) { if (textBox1.Text == UserInform.Password) { if (textBox2.Text == textBox3.Text) { var indert = "update employees set password= '" + textBox2.Text.GetHashCode() + "' where login ='" + UserInform.Login + "'"; var command = new SqlCommand(indert, conect.getConect()); command.ExecuteNonQuery(); UserInform.Password = textBox3.Text.Trim(); this.Hide(); Users goUser = new Users(); goUser.Show(); } else { MessageBox.Show("Пароли не совпадают"); } } else { MessageBox.Show("Старый пароль указан не верно"); } } else { MessageBox.Show("Старый пароль одинаков со старым"); } } private void edpass_FormClosed(object sender, FormClosedEventArgs e) { Application.Exit(); } } }