123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 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 FormReg : Form
- {
- public FormReg()
- {
- InitializeComponent();
- }
- private void FormReg_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.pracFabricaDataSet.Users);
- BsUsers.AddNew();
- LblRole.Text = "заказчик";
- roleTextBox.Text = "1";
- }
- private void BtnReg_Click(object sender, EventArgs e)
- {
- if (!PasswordCheckClass.PasswordCheck(PassTextBox.Text))
- {
- MessageBox.Show("Пароль не соответствует требованиям.", "Внимание!",
- MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- PassTextBox.Focus();
- return;
- }
- try
- {
- BsUsers.EndEdit();
- this.usersTableAdapter.Update(this.pracFabricaDataSet.Users);
- this.usersTableAdapter.Fill(this.pracFabricaDataSet.Users);
- }
- catch
- {
- MessageBox.Show(@"В базе данных уже есть пользователь с таким логином.
- Введите уникальный логин пользователя.", "Внимание!", MessageBoxButtons.OK,
- MessageBoxIcon.Exclamation);
- LoginTextBox.Focus();
- }
- this.DialogResult = DialogResult.OK;
- Close();
- }
- private void CbxShowPass_CheckedChanged(object sender, EventArgs e)
- {
- PassTextBox.UseSystemPasswordChar = !PassTextBox.UseSystemPasswordChar;
- }
- }
- }
|