/// <summary> /// Event handler for the populate all button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnPopulateAll_Click(object sender, System.EventArgs e) { // String that holds the error message string strErrorMessage = ""; // Integers holding the organisation properties int intCourseID; int intLessonFrequency, intQuizFrequency, intQuizPassMark; BusinessServices.Unit objUnit = new BusinessServices.Unit(); // Gather the selected values intCourseID = int.Parse(this.cboCourse.SelectedValue); intLessonFrequency = int.Parse(this.cboLessonFrequency.SelectedValue); intQuizFrequency = int.Parse(this.cboQuizFrequency.SelectedValue); DateTime lessonCompletionDate = DateTime.Parse("1/1/1900"); strErrorMessage = Bdw.Application.Salt.Web.General.Shared.Validation.Validate_Frequency_CompletionDates(ref lessonCompletionDate, cboLessonFrequency.SelectedValue, cboLCompletionDay.SelectedValue, cboLCompletionMonth.SelectedValue, cboLCompletionYear.SelectedValue); DateTime quizCompletionDate = DateTime.Parse("1/1/1900"); strErrorMessage = Bdw.Application.Salt.Web.General.Shared.Validation.Validate_Frequency_CompletionDates(ref quizCompletionDate, cboQuizFrequency.SelectedValue, cboQCompletionDay.SelectedValue, cboQCompletionMonth.SelectedValue, cboQCompletionYear.SelectedValue); try { intQuizPassMark = int.Parse(this.txtQuizPassMark.Text); if ((intQuizPassMark < 1) || (intQuizPassMark > 100)) { strErrorMessage = c_strPassMarkValidation; } } catch { intQuizPassMark = 100; strErrorMessage = c_strPassMarkValidation; } if (strErrorMessage == "") { objUnit.SaveModuleRuleToAll(this.m_intUnitID, intCourseID, intLessonFrequency, intQuizFrequency, intQuizPassMark, lessonCompletionDate, quizCompletionDate, UserContext.UserID, UserContext.UserData.OrgID); this.GetModuleRule(); this.lblMessage.Text = ResourceManager.GetString("lblMessage.Populated"); //"The Compliance Rules have been populated to all the modules in the course."; this.lblMessage.CssClass = "SuccessMessage"; } else { this.lblMessage.Text = strErrorMessage; this.lblMessage.CssClass = "WarningMessage"; } // Reset the grid this.grdModules.EditItemIndex = -1; }