Exemplo n.º 1
0
 private void bt_Add_Click(object sender, EventArgs e)
 {
     if (tb_FIO.Text != "" && tb_Phone.Text != "" && tb_Email.Text != "" && cb_Position.SelectedItem != null && tb_Login.Text != "" && tb_Password.Text != "")
     {
         if (EmployeeOperations.CheckLogin(tb_Login.Text))
         {
             EmployeeOperations.AddNewEmp(tb_FIO.Text, tb_Phone.Text, tb_Email.Text, cb_Position.Text, tb_Login.Text, tb_Password.Text, cb_Position.SelectedIndex);
             EmployeeOperations.FillForm(this);
         }
         else
         {
             MessageBox.Show("Пользователь с таким логином уже зарегистрирован в системе");
         }
     }
     else
     {
         MessageBox.Show("Введены не все необходимые данные");
     }
 }
Exemplo n.º 2
0
 // Сгенерировать логин и пароль для нового пользователя
 private void bt_Generate_Click(object sender, EventArgs e)
 {
     string[] LogPas = EmployeeOperations.RandomLogPass();
     tb_Login.Text    = LogPas[0];
     tb_Password.Text = LogPas[1];
 }
Exemplo n.º 3
0
 private void bt_Delete_Click(object sender, EventArgs e)
 {
     EmployeeOperations.RemoveEmp(dgv_Employee.CurrentRow.Cells[2].Value.ToString());
     EmployeeOperations.FillForm(this);
 }
Exemplo n.º 4
0
 private void FormEmployee_Load(object sender, EventArgs e)
 {
     EmployeeOperations.FillForm(this);
 }