using DLLPass; 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; namespace СУБД_Швейная_фабрика { public partial class FormRegister : Form { public FormRegister() { InitializeComponent(); } private void FormRegister_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'svFabricDataSet.Users' table. You can move, or remove it, as needed. this.usersTableAdapter.Fill(this.svFabricDataSet.Users); usersBindingSource.AddNew(); LblRole.Text = "заказчик"; } private void usersBindingNavigatorSaveItem_Click(object sender, EventArgs e) { this.Validate(); this.usersBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.svFabricDataSet); } private void BtnReg_Click(object sender, EventArgs e) { Form1 f = new Form1(); f.Show(); if (!ClassCheckPass.CheckPass(PassTextBox.Text)) { MessageBox.Show("Пароль не соответствует требованиям.", "Внимание!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); PassTextBox.Focus(); return; // выйти из процедуры } try { usersBindingSource.EndEdit(); this.usersTableAdapter.Update(this.svFabricDataSet.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; } private void LblRole_Click(object sender, EventArgs e) { } private void BtnCancel_Click(object sender, EventArgs e) { Form1 f = new Form1(); f.Show(); } } }