/// <summary> /// This method validates the file type options /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void FileTypeOption_Validation(object sender, DevExpress.Web.ValidationEventArgs e) { //Get the entry type int?fileType = (ddFileType.Value == null ? (int?)null : Convert.ToInt32(ddFileType.Value)); //Perform validation if (fileType.HasValue) { if (fileType.Value == (int)Utilities.FileTypeFKs.PROGRAM_WIDE) { int?programFK = (ddProgram.Value == null ? (int?)null : Convert.ToInt32(ddProgram.Value)); if (programFK.HasValue == false) { e.IsValid = false; e.ErrorText = "Required!"; } } else if (fileType.Value == (int)Utilities.FileTypeFKs.HUB_WIDE) { int?hubFK = (ddHub.Value == null ? (int?)null : Convert.ToInt32(ddHub.Value)); if (hubFK.HasValue == false) { e.IsValid = false; e.ErrorText = "Required!"; } } else if (fileType.Value == (int)Utilities.FileTypeFKs.STATE_WIDE) { int?stateFK = (ddState.Value == null ? (int?)null : Convert.ToInt32(ddState.Value)); if (stateFK.HasValue == false) { e.IsValid = false; e.ErrorText = "Required!"; } } else if (fileType.Value == (int)Utilities.FileTypeFKs.COHORT_WIDE) { int?cohortFK = (ddCohort.Value == null ? (int?)null : Convert.ToInt32(ddCohort.Value)); if (cohortFK.HasValue == false) { e.IsValid = false; e.ErrorText = "Required!"; } } } }
/// <summary> /// This method fires when the validation for the txtConfirmNewPassword DevExpress /// Bootstrap TextBox fires and it validates the txtConfirmNewPassword TextBox /// and the txtNewPassword DevExpress TextBox /// </summary> /// <param name="sender">The txtConfirmPassword TextBox</param> /// <param name="e">ValidationEventArgs</param> protected void txtConfirmPassword_Validation(object sender, DevExpress.Web.ValidationEventArgs e) { string password, confirmPassword; //Get the password and confirmation password = txtNewPassword.Value.ToString(); confirmPassword = txtConfirmNewPassword.Value.ToString(); //If the passwords don't match, set validation to false, true otherwise if (password != confirmPassword) { e.IsValid = false; e.ErrorText = "Password confirmation does not match!"; } else { e.IsValid = true; } }
protected void lessonVenuslist_Validation(object sender, DevExpress.Web.ValidationEventArgs e) { Session["venuroomid"] = 0; Session["venuroomid"] = ((ASPxComboBox)sender).Value; }
protected void cmbTimetable_Validation(object sender, DevExpress.Web.ValidationEventArgs e) { Session["Timetable"] = ""; Session["Timetable"] = ((ASPxComboBox)sender).Value; }