Esempio n. 1
0
 private void SetControlValidation()
 {
     err.Controls.Clear();
     err.Controls.Add(mtxtCode, "Required");
     err.Controls.Add(mtxtTime, "Required");
     err.CheckAndShowSummaryErrorMessage();
 }
Esempio n. 2
0
        private void SetControlValidation()
        {
            err.Controls.Clear();
            err.Controls.Add(mtxtUsername, "Required");
            err.Controls.Add(mtxtPassword, "Required");
            err.Controls.Add(mtxtFullName, "Required");

            err.CheckAndShowSummaryErrorMessage();
        }
Esempio n. 3
0
 private void cmdSubmit_Click(object sender, EventArgs e)
 {
     // Following function checks all empty fields and returns TRUE if all fields are entered.
     // If any mandotary field is empty this function displays a message and returns FALSE.
     if ((MyErrorProvider.CheckAndShowSummaryErrorMessage() == true))
     {
         MessageBox.Show("Data submited successfully.");
     }
     //MyErrorProvider.ClearAllErrorMessages();
 }
Esempio n. 4
0
 private Boolean IsValid()
 {
     try
     {
         return(err.CheckAndShowSummaryErrorMessage());
     }
     catch (Exception ex)
     {
         MessageHelpers.ShowWarning(ex.Message);
         return(false);
     }
 }
Esempio n. 5
0
 private void ChangePass()
 {
     current_user = userbal.GetByUsername(UserSettings.Username);
     err.Clear();
     if (current_user.Password == mtxtOldPass.Text)
     {
         if (mtxtNewPass.Text != "" && mtxtConPass.Text != "")
         {
             if (mtxtNewPass.Text == mtxtConPass.Text)
             {
                 current_user.Password = mtxtConPass.Text;
                 if (MessageHelpers.ShowQuestion("Are you sure want to change your password?") == DialogResult.Yes)
                 {
                     if (userbal.Update(current_user))
                     {
                         MessageHelpers.ShowInfo("Password successfully changed.");
                         this.Close();
                     }
                     else
                     {
                         throw new Exception("Error occured!");
                     }
                 }
             }
             else
             {
                 err.SetError(mtxtConPass, "Passwords entered does not match!");
             }
         }
         else
         {
             if (mtxtNewPass.Text == "")
             {
                 err.SetError(mtxtNewPass, "Required");
             }
             else if (mtxtNewPass.Text == "")
             {
                 err.SetError(mtxtConPass, "Required");
             }
             else
             {
                 err.SetError(mtxtNewPass, "Required");
                 err.SetError(mtxtConPass, "Required");
             }
         }
     }
     else
     {
         err.SetError(mtxtOldPass, "Please enter your old password!");
     }
     err.CheckAndShowSummaryErrorMessage();
 }