Example #1
0
 private void bAdd_Click(object sender, EventArgs e)
 {
     if (!CheckPWDValidity())
     {
         MessageBox.Show("Password do not match", "Password Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return;
     }
     if (tbFullName.Text == "")
     {
         MessageBox.Show("Full name cannot be empty", "Full name Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return;
     }
     usec.UserName  = tbUID.Text;
     usec.Password  = es.EncodeText(tbPWD1.Text);
     usec.FullName  = tbFullName.Text;
     usec.CreatedBy = 1;
     try
     {
         usec.AddUser();
         MessageBox.Show("Record Saved ", "Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Saving returned and error \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }