FormProfil.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 DLLCheck;
  11. namespace Швейная_фабрика
  12. {
  13. public partial class FormProfil : Form
  14. {
  15. public FormProfil()
  16. {
  17. InitializeComponent();
  18. }
  19. private void FormProfilZak_Load(object sender, EventArgs e)
  20. {
  21. // TODO: данная строка кода позволяет загрузить данные в таблицу "сlothesFactoryLGDataSet.Users". При необходимости она может быть перемещена или удалена.
  22. this.usersTableAdapter.Fill(this.сlothesFactoryLGDataSet.Users);
  23. passTextBox.UseSystemPasswordChar = true;
  24. }
  25. private void BtnLev_Click(object sender, EventArgs e)
  26. {
  27. if (oldPassTextBox.Text != Lblpass.Text)
  28. {
  29. MessageBox.Show("Вы ввели неверный текущий пароль!", "Внимание",
  30. MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
  31. return;
  32. }
  33. if (passTextBox.Text != "") // изменяется пароль
  34. {
  35. CheckPass ps = new CheckPass();
  36. if (!ps.ClassCheckPass(passTextBox.Text))
  37. {
  38. MessageBox.Show("Новый пароль не соответствует требованиям!",
  39. "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
  40. return;
  41. }
  42. // поместить в БД новый пароль
  43. Lblpass.Text = passTextBox.Text;
  44. }
  45. else
  46. return;
  47. BsUsers.EndEdit();
  48. this.usersTableAdapter.Update(this.сlothesFactoryLGDataSet.Users);
  49. Close();
  50. }
  51. private void CbxShowPass_CheckedChanged(object sender, EventArgs e)
  52. {
  53. passTextBox.UseSystemPasswordChar = !passTextBox.UseSystemPasswordChar;
  54. }
  55. }
  56. }