using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using PasswordCheckDll; namespace СУБД_Швейная_фабрика { public partial class FormProfile : Form { public FormProfile() { InitializeComponent(); } private void FormProfile_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'db_22factoryDataSet1.Users' table. You can move, or remove it, as needed. this.usersTableAdapter.Fill(this.db_22factoryDataSet1.Users); } private void BtnSave_Click(object sender, EventArgs e) { if (TbxOldPass.Text != LblPass.Text) { MessageBox.Show("Вы ввели неверный текущий пароль!", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (TbxNewPass.Text != "") { if (!PasswordCheckClass.PasswordCheck(TbxNewPass.Text)) { MessageBox.Show("Новый пароль не соответствует требованиям!", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } LblPass.Text = TbxNewPass.Text; } BsUsers.EndEdit(); this.usersTableAdapter.Update(this.db_22factoryDataSet1.Users); this.DialogResult = DialogResult.OK; Close(); } private void CbxShowPass_CheckedChanged(object sender, EventArgs e) { TbxNewPass.UseSystemPasswordChar = !TbxNewPass.UseSystemPasswordChar; TbxOldPass.UseSystemPasswordChar = !TbxOldPass.UseSystemPasswordChar; } } }