private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         _account.Update(Account.Id, txtUserName.Text, txtPassword.Text);
         WorkerForm.btnCancel_Click(WorkerForm, new EventArgs());
         Close();
     }
     catch
     {
         txtUserName.Text = "";
         txtConfirm.Text  = "";
         txtPassword.Text = "";
         txtPassword.Focus();
     }
 }
Beispiel #2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (txtConfirm.Text == txtPassword.Text && txtConfirm.Text != null && txtPassword.Text != null)
     {
         _account.Insert(Workers.Id, txtUserName.Text, txtPassword.Text);
         Close();
         WorkerForm.btnCancel_Click(WorkerForm, new EventArgs());
         WorkerForm.Worker = Workers;
     }
     else
     {
         txtConfirm.Text  = "";
         txtPassword.Text = "";
         txtPassword.Focus();
     }
 }