/// <summary> /// load grid methods /// </summary> /// public void LoadGrid() { try { SMHR_CHAPTERS _obj_Smhr_Chapter = new SMHR_CHAPTERS(); _obj_Smhr_Chapter.OPERATION = operation.Select; _obj_Smhr_Chapter.CHARPTER_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable DT = BLL.get_Chapter(_obj_Smhr_Chapter); if (DT.Rows.Count != 0) { Rg_Course.DataSource = DT; } else { DataTable dt1 = new DataTable(); Rg_Course.DataSource = dt1; } clearControls(); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Chapters", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_CourseName_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (string.Compare(rcmb_CourseName.SelectedItem.Text, "Select", true) != 0) { SMHR_COURSESCHEDULE _obj_Smhr_TrgRqst = new SMHR_COURSESCHEDULE(); _obj_Smhr_TrgRqst.OPERATION = operation.Course; _obj_Smhr_TrgRqst.COURSESCHEDULE_COURSEID = Convert.ToInt32(rcmb_CourseName.SelectedValue); _obj_Smhr_TrgRqst.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);//YYY rcmb_CourseSchedule.DataSource = BLL.get_CourseSchedule(_obj_Smhr_TrgRqst); rcmb_CourseSchedule.DataValueField = "CourseSchedule_ID"; rcmb_CourseSchedule.DataTextField = "CourseSchedule_Name"; rcmb_CourseSchedule.DataBind(); rcmb_CourseSchedule.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); SMHR_CHAPTERS _obj_Chapter = new SMHR_CHAPTERS(); _obj_Chapter.OPERATION = operation.Select1; _obj_Chapter.CHARPTER_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Chapter.CHAPTER_COURSE_ID = Convert.ToInt32(rcmb_CourseName.SelectedValue); radChapters.DataSource = BLL.get_Chapter(_obj_Chapter); radChapters.DataTextField = "CHAPTER_NAME"; radChapters.DataValueField = "CHAPTER_ID"; radChapters.DataBind(); radChapters.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingFeedBack", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// To Load BusinessUnit Details the Dropdown /// </summary> #endregion #region edit command methods /// <summary> /// to edit particular course based on command argument /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lnk_Edit_Command(object sender, CommandEventArgs e) { try { // lbl_CourseHeader.Visible = false; rcmb_CN.Enabled = false; clearControls(); LoadDropDowns(); //lbl_CourseName.Enabled = false; SMHR_CHAPTERS _obj_Smhr_Chapter = new SMHR_CHAPTERS(); _obj_Smhr_Chapter.CHARPTER_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_Chapter.CHAPTER_ID = Convert.ToInt32(e.CommandArgument); _obj_Smhr_Chapter.OPERATION = operation.Get; DataTable dt = BLL.get_Chapter(_obj_Smhr_Chapter); if (dt.Rows.Count != 0) { lbl_ChapterId.Text = Convert.ToString(dt.Rows[0]["CHAPTER_ID"]); rtxt_ChapterDesc.Text = Convert.ToString(dt.Rows[0]["CHAPTER_DESCRIPTION"]); rtxt_ChapterName.Text = Convert.ToString(dt.Rows[0]["CHAPTER_NAME"]); rcmb_CN.SelectedIndex = rcmb_CN.Items.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["CHAPTER_COURSE_ID"])); rad_IsActive.Checked = Convert.ToBoolean(dt.Rows[0]["CHAPTER_STATUS"]); //rad_IsActive.Checked = true; if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_Update.Visible = false; } else { btn_Update.Visible = true; } Rm_Course_page.SelectedIndex = 1; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Chapters", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadCourse() { try { SMHR_CHAPTERS _obj_Chapter = new SMHR_CHAPTERS(); _obj_Chapter.OPERATION = operation.Select1; _obj_Chapter.CHARPTER_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Chapter.CHAPTER_COURSE_ID = Convert.ToInt32(rcmb_Course.SelectedValue); rcmb_Chapter.DataSource = BLL.get_Chapter(_obj_Chapter); rcmb_Chapter.DataTextField = "CHAPTER_NAME"; rcmb_Chapter.DataValueField = "CHAPTER_ID"; rcmb_Chapter.DataBind(); rcmb_Chapter.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingFeedBackQuestions", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// save click methods /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Save_Click(object sender, EventArgs e) { try { SMHR_CHAPTERS _obj_Smhr_Chapter = new SMHR_CHAPTERS(); _obj_Smhr_Chapter.CHAPTER_NAME = rtxt_ChapterName.Text; _obj_Smhr_Chapter.CHAPTER_DESCRIPTION = rtxt_ChapterDesc.Text; _obj_Smhr_Chapter.CHAPTER_COURSE_ID = Convert.ToInt32(rcmb_CN.SelectedValue); _obj_Smhr_Chapter.CHARPTER_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_Chapter.CHAPTER_STATUS = rad_IsActive.Checked; _obj_Smhr_Chapter.CHAPTER_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session _obj_Smhr_Chapter.CHAPTER_CREATEDDATE = DateTime.Now; _obj_Smhr_Chapter.CHARPTER_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_Chapter.CHAPTER_LASTMDFDBY = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session _obj_Smhr_Chapter.CHAPTER_LASTMDFDATE = DateTime.Now; switch (((Button)sender).ID.ToUpper()) { case "BTN_UPDATE": _obj_Smhr_Chapter.CHAPTER_ID = Convert.ToInt32(lbl_ChapterId.Text); _obj_Smhr_Chapter.OPERATION = operation.Update; if (Convert.ToBoolean(rad_IsActive.Checked) == false) { //SMHR_COURSESCHEDULE _obj_CourseSchedule = new SMHR_COURSESCHEDULE(); //_obj_CourseSchedule.OPERATION = operation.Check2; //_obj_CourseSchedule.COURSESCHEDULEID = Convert.ToInt32(lblCourseScheduleID.Text); SMHR_TRAINING_ONLINEASSESSMENT _obj_Online = new SMHR_TRAINING_ONLINEASSESSMENT(); _obj_Online.OPERATION = operation.Check2; _obj_Online.TRAINING_ASSESSMENT_CHAPTER_ID = Convert.ToInt32(lbl_ChapterId.Text); DataTable dt = BLL.get_OnlineAssessment(_obj_Online); if (Convert.ToString(dt.Rows[0]["Count"]) != "0") { BLL.ShowMessage(this, "Cannot make inactive"); rad_IsActive.Checked = true; return; } } if (BLL.set_Chapter(_obj_Smhr_Chapter)) { BLL.ShowMessage(this, "Information Updated Successfully"); } else { BLL.ShowMessage(this, "Information Not Saved"); } break; case "BTN_SAVE": _obj_Smhr_Chapter.OPERATION = operation.Check; if (Convert.ToString(BLL.get_Chapter(_obj_Smhr_Chapter).Rows[0]["Count"]) != "0") { BLL.ShowMessage(this, "Chapter with this Name Already Exists"); return; } _obj_Smhr_Chapter.OPERATION = operation.Insert; if (BLL.set_Chapter(_obj_Smhr_Chapter)) { BLL.ShowMessage(this, "Information Saved Successfully"); } else { BLL.ShowMessage(this, "Information Not Saved"); } break; default: break; } Rm_Course_page.SelectedIndex = 0; LoadGrid(); Rg_Course.DataBind(); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Chapters", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }