fProfil.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using PasswordCheckDll;
  11. namespace garment_factory
  12. {
  13. public partial class fProfil : Form
  14. {
  15. public fProfil()
  16. {
  17. InitializeComponent();
  18. }
  19. private void fProfil_Load(object sender, EventArgs e)
  20. {
  21. // TODO: данная строка кода позволяет загрузить данные в таблицу "fabrika2024DataSet.Users". При необходимости она может быть перемещена или удалена.
  22. this.usersTableAdapter.Fill(this.fabrika2024DataSet.Users);
  23. }
  24. private void BtnSave_Click(object sender, EventArgs e)
  25. {
  26. if (tbxoldpasw.Text != lblpassw.Text)
  27. {
  28. MessageBox.Show("Вы ввели неверный старый пароль!", "Внимание",
  29. MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
  30. return;
  31. }
  32. if (tbxnewpasw.Text != "")
  33. {
  34. if (!PasswordCheckClass.PasswordCheck(tbxnewpasw.Text))
  35. {
  36. MessageBox.Show("Новый пароль не соответствует требованиям!",
  37. "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
  38. return;
  39. }
  40. lblpassw.Text = tbxnewpasw.Text;
  41. }
  42. BsUsers.EndEdit();
  43. this.usersTableAdapter.Update(this.fabrika2024DataSet.Users);
  44. this.DialogResult = DialogResult.OK;
  45. Close();
  46. }
  47. private void CbxShowPass_CheckedChanged(object sender, EventArgs e)
  48. {
  49. tbxnewpasw.UseSystemPasswordChar = !tbxnewpasw.UseSystemPasswordChar;
  50. tbxoldpasw.UseSystemPasswordChar = !tbxoldpasw.UseSystemPasswordChar;
  51. }
  52. private void BtnCancel_Click(object sender, EventArgs e)
  53. {
  54. DialogResult=DialogResult.Cancel;
  55. }
  56. }
  57. }