/// <summary> /// loading trgs under login user /// </summary> private void LoadData() { try { SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 8; _obj_Smhr_TrgRqst.TR_RAISEDBY = Convert.ToInt32(Session["emp_id"]); _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["org_id"]);//YYY DataTable DT = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (DT.Rows.Count != 0) { RG_TrainingApproval.DataSource = DT; RG_TrainingApproval.DataBind(); } else { DataTable DT1 = new DataTable(); RG_TrainingApproval.DataSource = DT1; RG_TrainingApproval.DataBind(); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingApproval", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <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_CC.Enabled = false; rcmb_BusinessUnitType.Enabled = false; clearControls(); LoadCombos(); //lbl_CourseName.Enabled = false; DataTable dt = BLL.get_Course(new SMHR_COURSE(Convert.ToInt32(Convert.ToString(e.CommandArgument)))); if (dt.Rows.Count != 0) { lbl_CourseId.Text = Convert.ToString(dt.Rows[0]["COURSE_ID"]); LoadBusinessUnit(); rcmb_BusinessUnitType.SelectedIndex = rcmb_BusinessUnitType.Items.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["COURSE_BUSINESSUNIT_ID"])); rtxt_CourseName.Text = Convert.ToString(dt.Rows[0]["COURSE_NAME"]); rtxt_CourseDesc.Text = Convert.ToString(dt.Rows[0]["COURSE_DESC"]); rcmb_CC.SelectedIndex = rcmb_CC.Items.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["COURSE_CATEGORYID"])); //LoadSkill(); SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.TR_DESCRIPTION = Convert.ToString(dt.Rows[0]["COURSE_SKILL_WID"]); _obj_Smhr_TrgRqst.Mode = 28;//addinbll DataTable DT = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (DT.Rows.Count != 0) { rlb_skills.DataSource = DT; rlb_skills.DataValueField = "HR_MASTER_ID"; rlb_skills.DataTextField = "HR_MASTER_CODE"; rlb_skills.DataBind(); } skil_id.Visible = 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_Course", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadCombos() { try { SMHR_BUSINESSUNIT _obj_smhr_businessunit = new SMHR_BUSINESSUNIT(); SMHR_LOGININFO _obj_SMHR_LoginInfo = new SMHR_LOGININFO(); _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_LoginInfo.LOGIN_ID = Convert.ToInt32(Session["USER_ID"]); DataTable dt_BUDetails = BLL.get_Business_Units(_obj_SMHR_LoginInfo); if (dt_BUDetails.Rows.Count != 0) { rcmb_BU.DataSource = dt_BUDetails; rcmb_BU.DataValueField = "BUSINESSUNIT_ID"; rcmb_BU.DataTextField = "BUSINESSUNIT_CODE"; rcmb_BU.DataBind(); rcmb_BU.Items.Insert(0, new RadComboBoxItem("Select")); } else { DataTable dt_Details = new DataTable(); rcmb_BU.DataSource = dt_BUDetails; rcmb_BU.DataBind(); rcmb_BU.Items.Insert(0, new RadComboBoxItem("Select")); } //Business Unit //Training Nameonly approved trainings will come DataTable DT = new DataTable(); _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 16; _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); rcmb_TRName.DataSource = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); rcmb_TRName.DataTextField = "TR_TITLE"; rcmb_TRName.DataValueField = "TR_ID"; rcmb_TRName.DataBind(); rcmb_TRName.Items.Insert(0, new 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"); } }
protected void loadDropDown() { try{ DataTable DT = new DataTable(); _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 1; rcmb_ScheduleName.DataSource = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); rcmb_ScheduleName.DataTextField = "TR_TITLE"; rcmb_ScheduleName.DataValueField = "TR_ID"; rcmb_ScheduleName.DataBind(); rcmb_ScheduleName.Items.Insert(0, new RadComboBoxItem("Select", "0")); rcmb_ScheduleName.SelectedIndex = -1; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingResponse", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// load grid methods /// </summary> public void LoadSkill() { try { if (rcmb_BusinessUnitType.SelectedItem.Text != "SELECT") { SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.TR_LASTMDFBY = Convert.ToInt32(rcmb_BusinessUnitType.SelectedItem.Value); _obj_Smhr_TrgRqst.Mode = 23;//addinbll DataTable DT = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (DT.Rows.Count != 0) { rlb_skills.DataSource = DT; rlb_skills.DataValueField = "HR_MASTER_ID"; rlb_skills.DataTextField = "HR_MASTER_CODE"; rlb_skills.DataBind(); } else { DataTable dt1 = new DataTable(); rlb_skills.DataSource = dt1; rlb_skills.DataBind(); } clearControls(); } else { BLL.ShowMessage(this, "Please Select Business Unit"); return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Course", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// /// </summary> /// <param name="o"></param> /// <param name="e"></param> protected void Rcm_Employee_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (Rcm_Employee.SelectedItem.Text != "Select") { SMHR_TrgSaveFeedback _obj_Smhr_TrgSaveFeedback = new SMHR_TrgSaveFeedback(); _obj_Smhr_TrgSaveFeedback.Mode = 4; _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_TR_ID = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_EMP_ID = Convert.ToInt32(Session["EMP_ID"]); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_DATE = Convert.ToDateTime(rdtp_strtdate.SelectedDate); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_EMPLOYEE_ID_for = Convert.ToString(Rcm_Employee.SelectedItem.Value); DataTable dtstatus = BLL.get_TrgSaveFeedback(_obj_Smhr_TrgSaveFeedback); if (dtstatus.Rows.Count != 0) { BLL.ShowMessage(this, "Alraedy Feedback Given"); btn_save_trgfeedbacques.Visible = false; lbl_starttime.Visible = true; rtp_starttime.Visible = true; lbl_endtime.Visible = true; rtp_endtime.Visible = true; Lbl_Trg.Visible = true; Rcmb_Trg.Visible = true; lbl_Employee.Visible = true; Rcm_Employee.Visible = true; expertise_id.Visible = true; CHGEXPERTID.Visible = false; Rg_SaveTrgFeedback.Visible = true; SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 14; _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_TrnEE.TRAINEE_EMPID = Convert.ToInt32(Session["EMP_ID"]); DataTable dtemp15 = BLL.get_TRAINEE(_obj_Smhr_TrnEE); //if employee is trainee then if (dtemp15.Rows.Count != 0) { expertise_id.Visible = false; CHGEXPERTID.Visible = false; } else { // SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 12;//YYY _obj_Smhr_TrnEE.TRAINEE_EMPID = Convert.ToInt32(Rcm_Employee.SelectedItem.Value); _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dtemp1 = BLL.get_TRAINEE(_obj_Smhr_TrnEE); if (dtemp1.Rows[0]["APPSKL_EXPERT"] != System.DBNull.Value) { if (Convert.ToInt32(dtemp1.Rows[0]["APPSKL_EXPERT"]) == 1) { lbl_Expert.Text = "Beginner"; } else if (Convert.ToInt32(dtemp1.Rows[0]["APPSKL_EXPERT"]) == 2) { lbl_Expert.Text = "Intermediate"; } else if (Convert.ToInt32(dtemp1.Rows[0]["APPSKL_EXPERT"]) == 3) { lbl_Expert.Text = "Expert"; } } else { lbl_Expert.Text = "Skill Not Given"; } } _obj_Smhr_TrgSaveFeedback.Mode = 5; _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_TR_ID = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_DATE = Convert.ToDateTime(rdtp_strtdate.SelectedDate); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_EMPLOYEE_ID_for = Convert.ToString(Rcm_Employee.SelectedItem.Value); DataTable dtstatus22 = BLL.get_TrgSaveFeedback(_obj_Smhr_TrgSaveFeedback); Rg_SaveTrgFeedback.DataSource = dtstatus22; Rg_SaveTrgFeedback.DataBind(); RadioButton rdopt1 = new RadioButton(); RadioButton rdopt2 = new RadioButton(); RadioButton rdopt3 = new RadioButton(); RadioButton rdopt4 = new RadioButton(); for (int a = 0; a < Rg_SaveTrgFeedback.Items.Count; a++) { rdopt1 = Rg_SaveTrgFeedback.Items[a].FindControl("rd_feedbkoption1") as RadioButton; rdopt2 = Rg_SaveTrgFeedback.Items[a].FindControl("rd_feedbkoption2") as RadioButton; rdopt3 = Rg_SaveTrgFeedback.Items[a].FindControl("rd_feedbkoption3") as RadioButton; rdopt4 = Rg_SaveTrgFeedback.Items[a].FindControl("rd_feedbkoption4") as RadioButton; if (rdopt1.Text != "") { rdopt1.Checked = true; } if (rdopt2.Text != "") { rdopt2.Checked = true; } if (rdopt3.Text != "") { rdopt3.Checked = true; } if (rdopt4.Text != "") { rdopt4.Checked = true; } if (Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION1"]) == string.Empty) { rdopt1.Text = string.Empty; } else if (Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION1"]) != string.Empty) { rdopt1.Text = Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION1"]); } if (Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION2"]) == string.Empty) { rdopt2.Text = string.Empty; } else if (Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION2"]) != string.Empty) { rdopt2.Text = Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION2"]); } if (Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION3"]) == string.Empty) { rdopt3.Text = string.Empty; } else if (Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION3"]) != string.Empty) { rdopt3.Text = Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION3"]); } if (Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION4"]) == string.Empty) { rdopt4.Text = string.Empty; } else if (Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION4"]) != string.Empty) { rdopt4.Text = Convert.ToString(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION4"]); } //if (Convert.ToInt32(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION2"]) == 0) //{ // rdopt2.Checked = false; //} //else if (Convert.ToInt32(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION2"]) == 1) //{ // rdopt2.Checked = true; //} //if (Convert.ToInt32(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION3"]) == 0) //{ // rdopt3.Checked = false; //} //else if (Convert.ToInt32(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION3"]) == 1) //{ // rdopt3.Checked = true; //} //if (Convert.ToInt32(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION4"]) == 0) //{ // rdopt4.Checked = false; //} //else if (Convert.ToInt32(dtstatus22.Rows[a]["FEEDBACKQUESTS_OPTION4"]) == 1) //{ // rdopt4.Checked = true; //} } return; } else { SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 14; _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_TrnEE.TRAINEE_EMPID = Convert.ToInt32(Session["EMP_ID"]); DataTable dtemp15 = BLL.get_TRAINEE(_obj_Smhr_TrnEE); //if employee is trainee then if (dtemp15.Rows.Count != 0) { expertise_id.Visible = false; CHGEXPERTID.Visible = false; } else { //Rcmb_Trg.Items.Insert(0, new RadComboBoxItem("Select")); _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 12;//YYY _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_TrnEE.TRAINEE_EMPID = Convert.ToInt32(Rcm_Employee.SelectedItem.Value); DataTable dtemp1 = BLL.get_TRAINEE(_obj_Smhr_TrnEE); if (dtemp1.Rows[0]["APPSKL_EXPERT"] != System.DBNull.Value) { if (Convert.ToInt32(dtemp1.Rows[0]["APPSKL_EXPERT"]) == 1) { lbl_Expert.Text = "Beginner"; } else if (Convert.ToInt32(dtemp1.Rows[0]["APPSKL_EXPERT"]) == 2) { lbl_Expert.Text = "Intermediate"; } else if (Convert.ToInt32(dtemp1.Rows[0]["APPSKL_EXPERT"]) == 3) { lbl_Expert.Text = "Expert"; } } else { lbl_Expert.Text = "Skill Not Given"; } expertise_id.Visible = true; CHGEXPERTID.Visible = true; nogradeid.Visible = true; } SMHR_ASSIGNFEEDBACK_EMPLOYEE _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE(); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 5; SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 21; _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable DT455 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); for (int i = 0; i < DT455.Rows.Count; i++) { if ((Convert.ToInt32(DT455.Rows[i]["login_emp_id"]) == Convert.ToInt32(Session["EMP_ID"]))) { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0; break; } else { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } } _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDBY = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); //i am passing trg and employee to get feedback_id DataTable dtfeedbackid = BLL.get__SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE); if (dtfeedbackid.Rows.Count != 0) { SMHR_TRGFEEDBACKQUESDTLS _obj_Smhr_TRGFEEDBACKQUESDTLS = new SMHR_TRGFEEDBACKQUESDTLS(); _obj_Smhr_TRGFEEDBACKQUESDTLS.Mode = 4; _obj_Smhr_TRGFEEDBACKQUESDTLS.TRFDBDTL_FDBID = Convert.ToInt32(dtfeedbackid.Rows[0]["FEEDBACK_ID"]); DataTable dtques = BLL.get_TRGFEEDBAKQUESTDTLS(_obj_Smhr_TRGFEEDBACKQUESDTLS); if (dtques.Rows.Count != 0) { Rg_SaveTrgFeedback.DataSource = dtques; Rg_SaveTrgFeedback.DataBind(); Rg_SaveTrgFeedback.Visible = true; btn_save_trgfeedbacques.Visible = true; } else { DataTable dt5 = new DataTable(); Rg_SaveTrgFeedback.DataSource = dt5; Rg_SaveTrgFeedback.DataBind(); Rg_SaveTrgFeedback.Visible = true; btn_save_trgfeedbacques.Visible = false; return; } if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_save_trgfeedbacques.Visible = false; } } else { DataTable dt4 = new DataTable(); Rg_SaveTrgFeedback.DataSource = dt4; Rg_SaveTrgFeedback.DataBind(); Rg_SaveTrgFeedback.Visible = true; btn_save_trgfeedbacques.Visible = false; } lbl_starttime.Visible = true; rtp_starttime.Visible = true; lbl_endtime.Visible = true; rtp_endtime.Visible = true; Lbl_Trg.Visible = true; Rcmb_Trg.Visible = true; lbl_Employee.Visible = true; Rcm_Employee.Visible = true; } } else { BLL.ShowMessage(this, "Please Select Emoployee"); lbl_starttime.Visible = true; rtp_starttime.Visible = true; lbl_endtime.Visible = true; rtp_endtime.Visible = true; Lbl_Trg.Visible = true; Rcmb_Trg.Visible = true; lbl_Employee.Visible = true; Rcm_Employee.Visible = true; expertise_id.Visible = false; CHGEXPERTID.Visible = false; Rg_SaveTrgFeedback.Visible = false; btn_save_trgfeedbacques.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_SaveTrgfeedbackquestion", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// date selected index changed /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void rdtp_strtdate_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e) { try { if (rdtp_strtdate.SelectedDate != null) { DataTable dt = new DataTable(); Rcmb_Trg.DataSource = dt; Rcmb_Trg.DataBind(); rtp_starttime.SelectedDate = null; rtp_endtime.SelectedDate = null; lbl_starttime.Visible = true; rtp_starttime.Visible = true; nogradeid.Visible = false; lbl_endtime.Visible = true; rtp_endtime.Visible = true; Lbl_Trg.Visible = true; Rcmb_Trg.Visible = true; lbl_Employee.Visible = false; Rcm_Employee.Visible = false; expertise_id.Visible = false; Rg_SaveTrgFeedback.Visible = false; Rcmb_Trg.SelectedIndex = -1; CHGEXPERTID.Visible = false; SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 14; _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_TrnEE.TRAINEE_EMPID = Convert.ToInt32(Session["EMP_ID"]); DataTable dtemp15 = BLL.get_TRAINEE(_obj_Smhr_TrnEE); SMHR_TRAININGSCHEDULE _obj_Smhr_TRAININGSCHEDULE = new SMHR_TRAININGSCHEDULE(); SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 21; _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable DT455 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); _obj_Smhr_TRAININGSCHEDULE.Mode = 9;//YYY for (int i = 0; i < DT455.Rows.Count; i++) { if ((Convert.ToInt32(DT455.Rows[i]["login_emp_id"]) == Convert.ToInt32(Session["EMP_ID"]))) { _obj_Smhr_TRAININGSCHEDULE.TS_PARAM1 = 0; break; } else { _obj_Smhr_TRAININGSCHEDULE.TS_PARAM1 = Convert.ToInt32(Session["EMP_ID"]); } } _obj_Smhr_TRAININGSCHEDULE.TS_LASTMDFDATE = Convert.ToDateTime(rdtp_strtdate.SelectedDate); _obj_Smhr_TRAININGSCHEDULE.TS_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dttime = BLL.get_TRAININGSCHEDULE(_obj_Smhr_TRAININGSCHEDULE); if (dttime.Rows.Count != 0) { //here based on date i am getting training,starttime,endtime rtp_starttime.SelectedDate = Convert.ToDateTime(dttime.Rows[0]["SESSION_STARTTIME"]); rtp_endtime.SelectedDate = Convert.ToDateTime(dttime.Rows[0]["SESSION_ENDTIME"]); Rcmb_Trg.DataSource = dttime; Rcmb_Trg.DataValueField = "TR_ID"; Rcmb_Trg.DataTextField = "TR_TITLE"; Rcmb_Trg.DataBind(); Rcmb_Trg.Items.Insert(0, new RadComboBoxItem("Select")); } else { BLL.ShowMessage(this, "No Training Exists On This Date"); } } else { BLL.ShowMessage(this, "Please Select Date"); lbl_starttime.Visible = false; rtp_starttime.Visible = false; lbl_endtime.Visible = false; rtp_endtime.Visible = false; Lbl_Trg.Visible = false; Rcmb_Trg.Visible = false; lbl_Employee.Visible = false; Rcm_Employee.Visible = false; expertise_id.Visible = false; Rg_SaveTrgFeedback.Visible = false; CHGEXPERTID.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_SaveTrgfeedbackquestion", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// save feedback methods /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_save_trgfeedbacques_Click(object sender, EventArgs e) { try { SMHR_TrgSaveFeedback _obj_Smhr_TrgSaveFeedback = new SMHR_TrgSaveFeedback(); //_obj_Smhr_TrgSaveFeedback.Mode = 4; //_obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_TR_ID = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); //_obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_EMP_ID = Convert.ToInt32(Session["EMP_ID"]); //DataTable dtstatus = BLL.get_TrgSaveFeedback(_obj_Smhr_TrgSaveFeedback); //if (dtstatus.Rows.Count != 0) //{ // BLL.ShowMessage(this, "Alraedy Feedback Given"); // DataTable dt9 = new DataTable(); // Rg_SaveTrgFeedback.DataSource = dt9; // Rg_SaveTrgFeedback.DataBind(); // Rg_SaveTrgFeedback.Visible = true; // btn_save_trgfeedbacques.Visible = false; // return; //} //else //{ if ((rcm_changeExpertise.SelectedItem.Text == "Select") & (chk_nograde.Checked == false) & (chk_nograde.Visible == true)) { BLL.ShowMessage(this, "Select Expertise"); return; } Label lblfeedbackid = new Label(); Label lblfeedbackquestion = new Label(); RadioButton rdopt1 = new RadioButton(); RadioButton rdopt2 = new RadioButton(); RadioButton rdopt3 = new RadioButton(); RadioButton rdopt4 = new RadioButton(); for (int a = 0; a < Rg_SaveTrgFeedback.Items.Count; a++) { lblfeedbackid = Rg_SaveTrgFeedback.Items[a].FindControl("lbl_feedbk_id") as Label; lblfeedbackquestion = Rg_SaveTrgFeedback.Items[a].FindControl("lbl_feedbk_question") as Label; rdopt1 = Rg_SaveTrgFeedback.Items[a].FindControl("rd_feedbkoption1") as RadioButton; rdopt2 = Rg_SaveTrgFeedback.Items[a].FindControl("rd_feedbkoption2") as RadioButton; rdopt3 = Rg_SaveTrgFeedback.Items[a].FindControl("rd_feedbkoption3") as RadioButton; rdopt4 = Rg_SaveTrgFeedback.Items[a].FindControl("rd_feedbkoption4") as RadioButton; _obj_Smhr_TrgSaveFeedback.Mode = 3; _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_TR_ID = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_EMP_ID = Convert.ToInt32(Session["EMP_ID"]); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_ID = Convert.ToInt32(lblfeedbackid.Text); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTION = Convert.ToString(lblfeedbackquestion.Text); if (rdopt1.Checked == true) { _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_OPTION1 = Convert.ToString(rdopt1.Text); } else { _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_OPTION1 = string.Empty; } if (rdopt2.Checked == true) { _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_OPTION2 = Convert.ToString(rdopt2.Text); } else { _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_OPTION2 = string.Empty; } if (rdopt3.Checked == true) { _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_OPTION3 = Convert.ToString(rdopt3.Text); } else { _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_OPTION3 = string.Empty; } if (rdopt4.Checked == true) { _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_OPTION4 = Convert.ToString(rdopt4.Text); } else { _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_OPTION4 = string.Empty; } //_obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_OPTION2 = Convert.ToBoolean(rdopt2.Text); //_obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_OPTION3 = Convert.ToBoolean(rdopt3.Text); //_obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_FEEDBACKQUESTS_OPTION4 = Convert.ToBoolean(rdopt4.Text); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_EMPLOYEE_ID_for = Convert.ToString(Rcm_Employee.SelectedItem.Value); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_DATE = Convert.ToDateTime(rdtp_strtdate.SelectedDate); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_ENDTIME = Convert.ToString(Convert.ToDateTime(rtp_endtime.SelectedDate).TimeOfDay); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_STARTTIME = Convert.ToString(Convert.ToDateTime(rtp_starttime.SelectedDate).TimeOfDay); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_STATUS = 1; _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_Smhr_TrgSaveFeedback.SAVEFEEDBACK_CREATEDDATE = DateTime.Now; bool status = BLL.set_TrgSaveFeedback(_obj_Smhr_TrgSaveFeedback); if (status == true) { BLL.ShowMessage(this, "Feedback Saved Successfully"); } } if (chk_nograde.Checked == false) { SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 14; _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_TrnEE.TRAINEE_EMPID = Convert.ToInt32(Session["EMP_ID"]); DataTable dtemp15 = BLL.get_TRAINEE(_obj_Smhr_TrnEE); if (dtemp15.Rows.Count != 0) { } else { SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 29;//YYY _obj_Smhr_TrgRqst.TR_ID = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dtmultiid = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 18;//YYY _obj_Smhr_TrgRqst.TR_LASTMDFBY = Convert.ToInt32(Rcm_Employee.SelectedItem.Value); _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dtapplicantid = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (dtapplicantid.Rows.Count != 0) { _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 27; //_obj_Smhr_TrgRqst.TR_LASTMDFBY = Convert.ToInt32(rcm_changeExpertise.SelectedItem.Value); //_obj_Smhr_TrgRqst.TR_ID = Convert.ToInt32(dtapplicantid.Rows[0]["emp_applicant_id"]); _obj_Smhr_TrgRqst.TR_ID = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); //trg _obj_Smhr_TrgRqst.TR_LASTMDFBY = Convert.ToInt32(dtapplicantid.Rows[0]["emp_applicant_id"]); //applicant if (dtmultiid.Rows.Count != 0) { _obj_Smhr_TrgRqst.TR_DESCRIPTION = Convert.ToString(dtmultiid.Rows[0]["course_skill_wid"]);//skillmulti } else { _obj_Smhr_TrgRqst.TR_DESCRIPTION = "0"; } _obj_Smhr_TrgRqst.LASTMDFBY = Convert.ToInt32(rcm_changeExpertise.SelectedItem.Value);//expert _obj_Smhr_TrgRqst.TR_CREATEDBY = Convert.ToInt32(Session["user_id"]); _obj_Smhr_TrgRqst.TR_CREATEDDATE = DateTime.Now; _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["org_id"]); bool stat = BLL.set_TrgRqst(_obj_Smhr_TrgRqst); BLL.ShowMessage(this, "Skills Have Been Updated"); } } } else { } lbl_starttime.Visible = false; rtp_starttime.Visible = false; lbl_endtime.Visible = false; rtp_endtime.Visible = false; Lbl_Trg.Visible = false; Rcmb_Trg.Visible = false; nogradeid.Visible = false; lbl_Employee.Visible = false; Rcm_Employee.Visible = false; expertise_id.Visible = false; LBL_DATE.Visible = true; rdtp_strtdate.Visible = true; CHGEXPERTID.Visible = false; Rg_SaveTrgFeedback.Visible = false; rdtp_strtdate.SelectedDate = null; btn_save_trgfeedbacques.Visible = false; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_SaveTrgfeedbackquestion", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// when trg changed based if trainee trainer will come for trainer trainee will come /// </summary> /// <param name="o"></param> /// <param name="e"></param> protected void Rcmb_Trg_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (Rcmb_Trg.SelectedItem.Text != "Select") { SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 14;//YYY _obj_Smhr_TrnEE.TRAINEE_EMPID = Convert.ToInt32(Session["EMP_ID"]); _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dtemp15 = BLL.get_TRAINEE(_obj_Smhr_TrnEE); //if employee is trainee then if (dtemp15.Rows.Count != 0) { SMHR_TRAINER _obj_Smhr_Trner = new SMHR_TRAINER(); _obj_Smhr_Trner.TRAINERDETAILS_TR_ID = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); _obj_Smhr_Trner.Mode = 15;//YYY _obj_Smhr_Trner.TRAINERDETAILS_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); //if trg is internal trg then DataTable dttrgexist = BLL.get_TRAINer(_obj_Smhr_Trner); if (Convert.ToInt32(dttrgexist.Rows[0]["emp_id"]) != 0) { Rcm_Employee.DataSource = dttrgexist; Rcm_Employee.DataValueField = "emp_id"; Rcm_Employee.DataTextField = "EMPLOYEE_NAME"; Rcm_Employee.DataBind(); Rcm_Employee.Items.Insert(0, new RadComboBoxItem("Select")); } else { _obj_Smhr_Trner = new SMHR_TRAINER(); _obj_Smhr_Trner.TRAINERDETAILS_TR_ID = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); _obj_Smhr_Trner.Mode = 16;//YYY _obj_Smhr_Trner.TRAINERDETAILS_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); //if trg of external trg DataTable dttrgexist22 = BLL.get_TRAINer(_obj_Smhr_Trner); if (dttrgexist22.Rows[0]["TRAINERDETAILS_EMPLOYEENAME"] != string.Empty) { Rcm_Employee.DataSource = dttrgexist22; Rcm_Employee.DataValueField = "TRAINERDETAILS_EMPLOYEENAME"; Rcm_Employee.DataTextField = "TRAINERDETAILS_EMPLOYEENAME"; Rcm_Employee.DataBind(); Rcm_Employee.Items.Insert(0, new RadComboBoxItem("Select")); } else {//if trg of external trainer Rcm_Employee.DataSource = dttrgexist22; Rcm_Employee.DataValueField = "TRAINERDETAILS_CONTACTPERSON"; Rcm_Employee.DataTextField = "TRAINERDETAILS_CONTACTPERSON"; Rcm_Employee.DataBind(); Rcm_Employee.Items.Insert(0, new RadComboBoxItem("Select")); } } lbl_Employee.Text = "Trainer :"; } else {//loads trainee SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 21; _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable DT455 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); // SMHR_TRAINER _obj_Smhr_Trner = new SMHR_TRAINER(); _obj_Smhr_Trner.TRAINERDETAILS_TR_ID = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); _obj_Smhr_Trner.Mode = 18;//YYY _obj_Smhr_Trner.TRAINERDETAILS_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dttrainer = BLL.get_TRAINer(_obj_Smhr_Trner); //if (Convert.ToInt32(DT455.Rows[0]["login_emp_id"]) == Convert.ToInt32(Session["EMP_ID"]) ) //{//if hr logs in if (Convert.ToInt32(Session["EMP_ID"]) != 0) { _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 5; _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_TrnEE.TRAINEE_TR_ID = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); DataTable dtemp1 = BLL.get_TRAINEE(_obj_Smhr_TrnEE); Rcm_Employee.DataSource = dtemp1; Rcm_Employee.DataValueField = "TRAINEE_EMPID"; Rcm_Employee.DataTextField = "EMPLOYEE_NAME"; Rcm_Employee.DataBind(); Rcm_Employee.Items.Insert(0, new RadComboBoxItem("Select")); lbl_Employee.Text = "Trainee :"; } else if (dttrainer.Rows.Count != 0) {//if internal trainer logs in if (Convert.ToInt32(dttrainer.Rows[0]["TRAINERDETAILS_EMPLOYEEID"]) == Convert.ToInt32(Session["EMP_ID"])) { _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 5; _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_TrnEE.TRAINEE_TR_ID = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); DataTable dtemp1 = BLL.get_TRAINEE(_obj_Smhr_TrnEE); Rcm_Employee.DataSource = dtemp1; Rcm_Employee.DataValueField = "TRAINEE_EMPID"; Rcm_Employee.DataTextField = "EMPLOYEE_NAME"; Rcm_Employee.DataBind(); Rcm_Employee.Items.Insert(0, new RadComboBoxItem("Select")); lbl_Employee.Text = "Trainee :"; } } else { BLL.ShowMessage(this, "No Trainee Under This User"); DataTable dt5 = new DataTable(); Rcm_Employee.DataSource = dt5; Rcm_Employee.DataBind(); Rcm_Employee.Items.Insert(0, new RadComboBoxItem("Select")); } } lbl_starttime.Visible = true; rtp_starttime.Visible = true; lbl_endtime.Visible = true; rtp_endtime.Visible = true; Lbl_Trg.Visible = true; Rcmb_Trg.Visible = true; lbl_Employee.Visible = true; Rcm_Employee.Visible = true; expertise_id.Visible = false; CHGEXPERTID.Visible = false; // SMHR_ASSIGNFEEDBACK_EMPLOYEE _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE(); // _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 5; // _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(Session["EMP_ID"]); // _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDBY = Convert.ToInt32(Rcmb_Trg.SelectedItem.Value); // //i am passing trg and employee to get feedback_id // DataTable dtfeedbackid = BLL.get__SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE); // if (dtfeedbackid.Rows.Count != 0) // { // SMHR_TRGFEEDBACKQUESDTLS _obj_Smhr_TRGFEEDBACKQUESDTLS = new SMHR_TRGFEEDBACKQUESDTLS(); // _obj_Smhr_TRGFEEDBACKQUESDTLS.Mode = 4; // _obj_Smhr_TRGFEEDBACKQUESDTLS.TRFDBDTL_FDBID = Convert.ToInt32(dtfeedbackid.Rows[0]["FEEDBACK_ID"]); // DataTable dtques = BLL.get_TRGFEEDBAKQUESTDTLS(_obj_Smhr_TRGFEEDBACKQUESDTLS); // if (dtques.Rows.Count != 0) // { // Rg_SaveTrgFeedback.DataSource = dtques; // Rg_SaveTrgFeedback.DataBind(); // Rg_SaveTrgFeedback.Visible = true; // btn_save_trgfeedbacques.Visible = true; // } // else // { // DataTable dt5 = new DataTable(); // Rg_SaveTrgFeedback.DataSource = dt5; // Rg_SaveTrgFeedback.DataBind(); // Rg_SaveTrgFeedback.Visible = true; // btn_save_trgfeedbacques.Visible = false; // return; // } // } // else // { // DataTable dt4 = new DataTable(); // Rg_SaveTrgFeedback.DataSource = dt4; // Rg_SaveTrgFeedback.DataBind(); // Rg_SaveTrgFeedback.Visible = true; // btn_save_trgfeedbacques.Visible = false; // } //} //else //{ // BLL.ShowMessage(this, "Please Select Training"); // DataTable dt9 = new DataTable(); // Rg_SaveTrgFeedback.DataSource = dt9; // Rg_SaveTrgFeedback.DataBind(); // Rg_SaveTrgFeedback.Visible = true; // btn_save_trgfeedbacques.Visible = false; // return; //} } else { BLL.ShowMessage(this, "Please Select Training"); lbl_starttime.Visible = true; rtp_starttime.Visible = true; lbl_endtime.Visible = true; rtp_endtime.Visible = true; Lbl_Trg.Visible = true; Rcmb_Trg.Visible = true; lbl_Employee.Visible = false; Rcm_Employee.Visible = false; expertise_id.Visible = false; CHGEXPERTID.Visible = false; Rg_SaveTrgFeedback.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_SaveTrgfeedbackquestion", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_Attdtls_BU_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcmb_Attdtls_BU.SelectedItem.Text != "Select") { //only approved trgs will come here //SMHR_TRAINER _obj_Smhr_Trner = new SMHR_TRAINER(); //_obj_Smhr_Trner.TRAINERDETAILS_BUSINESSUNITID = Convert.ToInt32(rcmb_Attdtls_BU.SelectedItem.Value); //_obj_Smhr_Trner.Mode = 7; //DataTable dttrg = BLL.get_TRAINer(_obj_Smhr_Trner); SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 15; _obj_Smhr_TrnEE.TRAINEE_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_Attdtls_BU.SelectedItem.Value); _obj_Smhr_TrnEE.TRAINEE_EMPID = Convert.ToInt32(Session["EMP_ID"]); _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dttraineeexist = BLL.get_TRAINEE(_obj_Smhr_TrnEE); if (dttraineeexist.Rows.Count != 0) { rcmb_Attdtls_Training.DataSource = dttraineeexist; rcmb_Attdtls_Training.DataTextField = "TR_TITLE"; rcmb_Attdtls_Training.DataValueField = "TR_ID"; rcmb_Attdtls_Training.DataBind(); rcmb_Attdtls_Training.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "-1")); lbl_AttDtls_Training.Visible = true; rcmb_Attdtls_Training.Visible = true; rdtp_AttDtls_AttDt.Visible = false; lbl_AttDtls_AttDt.Visible = false; rgd_AttDtls_Emp.Visible = false; } else {//IF THR LOGIN USER EQUAL TO HR THEN DISPLY TRG UNDER HR SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 21; _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable DT455 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); //if (Convert.ToInt32(DT455.Rows[0]["login_emp_id"]) == Convert.ToInt32(Session["EMP_ID"])) //{ //for hr if (Convert.ToInt32(Session["EMP_ID"]) != 0) { _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 16; _obj_Smhr_TrnEE.TRAINEE_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_Attdtls_BU.SelectedItem.Value); _obj_Smhr_TrnEE.TRAINEE_EMPID = 0; _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dttraineeexist1 = BLL.get_TRAINEE(_obj_Smhr_TrnEE); if (dttraineeexist1.Rows.Count != 0) { rcmb_Attdtls_Training.DataSource = dttraineeexist1; rcmb_Attdtls_Training.DataTextField = "TR_TITLE"; rcmb_Attdtls_Training.DataValueField = "TR_ID"; rcmb_Attdtls_Training.DataBind(); rcmb_Attdtls_Training.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "-1")); lbl_AttDtls_Training.Visible = true; rcmb_Attdtls_Training.Visible = true; rdtp_AttDtls_AttDt.Visible = false; lbl_AttDtls_AttDt.Visible = false; rgd_AttDtls_Emp.Visible = false; } else { BLL.ShowMessage(this, "No Training Under This User"); return; } } else { BLL.ShowMessage(this, "No Training Under This User"); return; } } } else { BLL.ShowMessage(this, "Please Select BusinessUnit"); rdtp_AttDtls_AttDt.Visible = false; lbl_AttDtls_AttDt.Visible = false; rgd_AttDtls_Emp.Visible = false; lbl_AttDtls_Training.Visible = false; rcmb_Attdtls_Training.Visible = false; return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_trainingattendancedtls", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void loadEmployees() { try { if (rdtp_AttDtls_AttDt.SelectedDate <= DateTime.Now) { SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst; _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 24; _obj_Smhr_TrgRqst.TR_LASTMDFDATE = Convert.ToDateTime(rdtp_AttDtls_AttDt.SelectedDate); _obj_Smhr_TrgRqst.TR_CREATEDDATE = DateTime.Now; DataTable dtdiff = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); _obj_Smhr_TrgRqst.Mode = 25; _obj_Smhr_TrgRqst.TR_ID = Convert.ToInt32(rcmb_Attdtls_Training.SelectedItem.Value); _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["org_id"]); DataTable dtequal = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (dtequal.Rows.Count != 0) { if ((rdtp_AttDtls_AttDt.SelectedDate == DateTime.Now) || ((Convert.ToInt32(dtdiff.Rows[0]["diffdate"])) <= (Convert.ToInt32(dtequal.Rows[0]["FEEDBACK_BACKDATE"])))) { Telerik.Web.UI.RadComboBox ddlList = new RadComboBox(); SMHR_TRAININGATTENDANCEDTLS _obj_Smhr_TrngAttendanceDtls = new SMHR_TRAININGATTENDANCEDTLS(); _obj_Smhr_TrngAttendanceDtls.Mode = 5; _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_TR_ID = Convert.ToInt32(rcmb_Attdtls_Training.SelectedItem.Value); _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_DATE = Convert.ToDateTime(rdtp_AttDtls_AttDt.SelectedDate); DataTable dtfinal = BLL.get_TRgAttandencedtls(_obj_Smhr_TrngAttendanceDtls); if (dtfinal.Rows.Count != 0) {//if attendance not finalised if (Convert.ToInt32(dtfinal.Rows[0]["ATTENDANCE_ISFINAL"]) == 1) { _obj_Smhr_TrngAttendanceDtls.Mode = 6; _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_TR_ID = Convert.ToInt32(rcmb_Attdtls_Training.SelectedItem.Value); _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_DATE = Convert.ToDateTime(rdtp_AttDtls_AttDt.SelectedDate); DataTable dtfinal1 = BLL.get_TRgAttandencedtls(_obj_Smhr_TrngAttendanceDtls); if (dtfinal1.Rows.Count != 0) { rgd_AttDtls_Emp.DataSource = dtfinal1; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = false; btn_finalise.Visible = true; rgd_AttDtls_Emp.Visible = true; for (int j = 0; j <= rgd_AttDtls_Emp.Items.Count - 1; j++) { ddlList = rgd_AttDtls_Emp.Items[j].FindControl("rcmb_AttDtls_Status") as RadComboBox; if (Convert.ToString(Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"])) == "Present") { ddlList.SelectedIndex = ddlList.FindItemIndexByValue(Convert.ToString("P")); } else if (Convert.ToString(Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"])) == "Absent") { ddlList.SelectedIndex = ddlList.FindItemIndexByValue(Convert.ToString("A")); } //ddlList.SelectedItem.Text = Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"]); } BLL.ShowMessage(this, "Attendace Details Not Finalised"); return; } else { DataTable dt1 = new DataTable(); rgd_AttDtls_Emp.DataSource = dt1; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = false; btn_finalise.Visible = false; rgd_AttDtls_Emp.Visible = true; } } else if (Convert.ToInt32(dtfinal.Rows[0]["ATTENDANCE_ISFINAL"]) == 2) {//if attendance already finalised _obj_Smhr_TrngAttendanceDtls.Mode = 7; _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_TR_ID = Convert.ToInt32(rcmb_Attdtls_Training.SelectedItem.Value); _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_DATE = Convert.ToDateTime(rdtp_AttDtls_AttDt.SelectedDate); DataTable dtfinal1 = BLL.get_TRgAttandencedtls(_obj_Smhr_TrngAttendanceDtls); rgd_AttDtls_Emp.DataSource = dtfinal1; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = false; btn_finalise.Visible = false; for (int j = 0; j <= rgd_AttDtls_Emp.Items.Count - 1; j++) { ddlList = rgd_AttDtls_Emp.Items[j].FindControl("rcmb_AttDtls_Status") as RadComboBox; if (Convert.ToString(Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"])) == "Present") { ddlList.SelectedIndex = ddlList.FindItemIndexByValue(Convert.ToString("P")); } else if (Convert.ToString(Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"])) == "Absent") { ddlList.SelectedIndex = ddlList.FindItemIndexByValue(Convert.ToString("A")); } //ddlList.SelectedItem.Text = Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"]); } BLL.ShowMessage(this, "Attendace Details Finalised"); rgd_AttDtls_Emp.Visible = true; rgd_AttDtls_Emp.Enabled = false; return; } } else { SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 6; _obj_Smhr_TrnEE.TRAINEE_TR_ID = Convert.ToInt32(rcmb_Attdtls_Training.SelectedItem.Value); _obj_Smhr_TrnEE.TRAINEE_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_Attdtls_BU.SelectedItem.Value); _obj_Smhr_TrnEE.TRAINEE_LASTMDFDATE = Convert.ToDateTime(rdtp_AttDtls_AttDt.SelectedDate); DataTable dtemp = BLL.get_TRAINEE(_obj_Smhr_TrnEE); if (dtemp.Rows.Count != 0) { rgd_AttDtls_Emp.DataSource = dtemp; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = true; btn_finalise.Visible = true; rgd_AttDtls_Emp.Visible = true; rgd_AttDtls_Emp.Enabled = true; return; } else { DataTable dt1 = new DataTable(); rgd_AttDtls_Emp.DataSource = dt1; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = false; btn_finalise.Visible = false; rgd_AttDtls_Emp.Visible = true; return; } } } else { SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 6; _obj_Smhr_TrnEE.TRAINEE_TR_ID = Convert.ToInt32(rcmb_Attdtls_Training.SelectedItem.Value); _obj_Smhr_TrnEE.TRAINEE_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_Attdtls_BU.SelectedItem.Value); _obj_Smhr_TrnEE.TRAINEE_LASTMDFDATE = Convert.ToDateTime(rdtp_AttDtls_AttDt.SelectedDate); DataTable dtemp = BLL.get_TRAINEE(_obj_Smhr_TrnEE); if (dtemp.Rows.Count != 0) { rgd_AttDtls_Emp.DataSource = dtemp; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = true; btn_finalise.Visible = false; for (int j = 0; j <= rgd_AttDtls_Emp.Items.Count - 1; j++) { RadComboBox ddlList = rgd_AttDtls_Emp.Items[j].FindControl("rcmb_AttDtls_Status") as RadComboBox; ddlList.SelectedItem.Text = "Absent"; } rgd_AttDtls_Emp.Visible = true; rgd_AttDtls_Emp.Enabled = false; btn_AttDtls_Submit.Visible = false; return; } else { DataTable dt1 = new DataTable(); rgd_AttDtls_Emp.DataSource = dt1; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = false; btn_finalise.Visible = false; rgd_AttDtls_Emp.Enabled = false; rgd_AttDtls_Emp.Visible = true; return; } } } else { if ((rdtp_AttDtls_AttDt.SelectedDate == DateTime.Now)) { Telerik.Web.UI.RadComboBox ddlList = new RadComboBox(); SMHR_TRAININGATTENDANCEDTLS _obj_Smhr_TrngAttendanceDtls = new SMHR_TRAININGATTENDANCEDTLS(); _obj_Smhr_TrngAttendanceDtls.Mode = 5; _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_TR_ID = Convert.ToInt32(rcmb_Attdtls_Training.SelectedItem.Value); _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_DATE = Convert.ToDateTime(rdtp_AttDtls_AttDt.SelectedDate); DataTable dtfinal = BLL.get_TRgAttandencedtls(_obj_Smhr_TrngAttendanceDtls); if (dtfinal.Rows.Count != 0) {//if attendance not finalised if (Convert.ToInt32(dtfinal.Rows[0]["ATTENDANCE_ISFINAL"]) == 1) { _obj_Smhr_TrngAttendanceDtls.Mode = 6; _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_TR_ID = Convert.ToInt32(rcmb_Attdtls_Training.SelectedItem.Value); _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_DATE = Convert.ToDateTime(rdtp_AttDtls_AttDt.SelectedDate); DataTable dtfinal1 = BLL.get_TRgAttandencedtls(_obj_Smhr_TrngAttendanceDtls); if (dtfinal1.Rows.Count != 0) { rgd_AttDtls_Emp.DataSource = dtfinal1; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = false; btn_finalise.Visible = true; rgd_AttDtls_Emp.Visible = true; for (int j = 0; j <= rgd_AttDtls_Emp.Items.Count - 1; j++) { ddlList = rgd_AttDtls_Emp.Items[j].FindControl("rcmb_AttDtls_Status") as RadComboBox; if (Convert.ToString(Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"])) == "Present") { ddlList.SelectedIndex = ddlList.FindItemIndexByValue(Convert.ToString("P")); } else if (Convert.ToString(Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"])) == "Absent") { ddlList.SelectedIndex = ddlList.FindItemIndexByValue(Convert.ToString("A")); } //ddlList.SelectedItem.Text = Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"]); } BLL.ShowMessage(this, "Attendace Details Not Finalised"); return; } else { DataTable dt1 = new DataTable(); rgd_AttDtls_Emp.DataSource = dt1; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = false; btn_finalise.Visible = false; rgd_AttDtls_Emp.Visible = true; } } else if (Convert.ToInt32(dtfinal.Rows[0]["ATTENDANCE_ISFINAL"]) == 2) {//if attendance already finalised _obj_Smhr_TrngAttendanceDtls.Mode = 7; _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_TR_ID = Convert.ToInt32(rcmb_Attdtls_Training.SelectedItem.Value); _obj_Smhr_TrngAttendanceDtls.ATTENDANCE_DATE = Convert.ToDateTime(rdtp_AttDtls_AttDt.SelectedDate); DataTable dtfinal1 = BLL.get_TRgAttandencedtls(_obj_Smhr_TrngAttendanceDtls); rgd_AttDtls_Emp.DataSource = dtfinal1; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = false; btn_finalise.Visible = false; for (int j = 0; j <= rgd_AttDtls_Emp.Items.Count - 1; j++) { ddlList = rgd_AttDtls_Emp.Items[j].FindControl("rcmb_AttDtls_Status") as RadComboBox; if (Convert.ToString(Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"])) == "Present") { ddlList.SelectedIndex = ddlList.FindItemIndexByValue(Convert.ToString("P")); } else if (Convert.ToString(Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"])) == "Absent") { ddlList.SelectedIndex = ddlList.FindItemIndexByValue(Convert.ToString("A")); } //ddlList.SelectedItem.Text = Convert.ToString(dtfinal1.Rows[j]["ATTENDANCE_STATUS"]); } BLL.ShowMessage(this, "Attendace Details Finalised"); rgd_AttDtls_Emp.Visible = true; rgd_AttDtls_Emp.Enabled = false; return; } } else { SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 6; _obj_Smhr_TrnEE.TRAINEE_TR_ID = Convert.ToInt32(rcmb_Attdtls_Training.SelectedItem.Value); _obj_Smhr_TrnEE.TRAINEE_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_Attdtls_BU.SelectedItem.Value); _obj_Smhr_TrnEE.TRAINEE_LASTMDFDATE = Convert.ToDateTime(rdtp_AttDtls_AttDt.SelectedDate); DataTable dtemp = BLL.get_TRAINEE(_obj_Smhr_TrnEE); if (dtemp.Rows.Count != 0) { rgd_AttDtls_Emp.DataSource = dtemp; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = true; btn_finalise.Visible = true; rgd_AttDtls_Emp.Visible = true; rgd_AttDtls_Emp.Enabled = true; return; } else { DataTable dt1 = new DataTable(); rgd_AttDtls_Emp.DataSource = dt1; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = false; btn_finalise.Visible = false; rgd_AttDtls_Emp.Visible = true; return; } } } else { SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 6; _obj_Smhr_TrnEE.TRAINEE_TR_ID = Convert.ToInt32(rcmb_Attdtls_Training.SelectedItem.Value); _obj_Smhr_TrnEE.TRAINEE_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_Attdtls_BU.SelectedItem.Value); _obj_Smhr_TrnEE.TRAINEE_LASTMDFDATE = Convert.ToDateTime(rdtp_AttDtls_AttDt.SelectedDate); DataTable dtemp = BLL.get_TRAINEE(_obj_Smhr_TrnEE); if (dtemp.Rows.Count != 0) { rgd_AttDtls_Emp.DataSource = dtemp; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = true; btn_finalise.Visible = false; for (int j = 0; j <= rgd_AttDtls_Emp.Items.Count - 1; j++) { RadComboBox ddlList = rgd_AttDtls_Emp.Items[j].FindControl("rcmb_AttDtls_Status") as RadComboBox; ddlList.SelectedItem.Text = "Absent"; } rgd_AttDtls_Emp.Visible = true; rgd_AttDtls_Emp.Enabled = false; btn_AttDtls_Submit.Visible = false; return; } else { DataTable dt1 = new DataTable(); rgd_AttDtls_Emp.DataSource = dt1; rgd_AttDtls_Emp.DataBind(); btn_AttDtls_Submit.Visible = false; btn_finalise.Visible = false; rgd_AttDtls_Emp.Enabled = false; rgd_AttDtls_Emp.Visible = true; return; } } } } else { BLL.ShowMessage(this, "Future Attendance Cannot Given"); rgd_AttDtls_Emp.Visible = false; btn_finalise.Visible = false; btn_AttDtls_Submit.Visible = false; return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_trainingattendancedtls", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_assign_Click(object sender, EventArgs e) { try { //assign feedback to trainer of that trg if (rcmb_CourseSchedule.SelectedItem.Text == "Trainer") { SMHR_ASSIGNFEEDBACK_EMPLOYEE _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE(); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION = operation.MODE1; _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME = BLL.ReplaceQuote(Convert.ToString(rtxt_AssessmentName.Text)); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID = Convert.ToInt32(rcmb_CC.SelectedItem.Value); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID = Convert.ToInt32(rcmb_CourseName.SelectedItem.Value); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_CourseSchedule.SelectedItem.Text); DataTable dt5 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE); SMHR_TRAINER _obj_Smhr_Trner = new SMHR_TRAINER(); _obj_Smhr_Trner.Mode = 5; _obj_Smhr_Trner.TRAINERDETAILS_TR_ID = Convert.ToInt32(rcmb_CourseName.SelectedItem.Value); DataTable dt1 = BLL.get_TRAINer(_obj_Smhr_Trner); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 2; _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]); //if trg is external then inplace of trainer we are passing hr employeeid if (dt1.Rows.Count != 0) { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(dt1.Rows[0]["TRAINERDETAILS_EMPLOYEEID"]); } else {//IF TRAINER EXTERNAL WE HAVE TO GIVE HR ID _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 21; _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable DT45 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (DT45.Rows.Count != 0) { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0; } else { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0; } } DataTable dt2 = BLL.get__SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE); if (dt2.Rows.Count != 0) { BLL.ShowMessage(this, "Tarining Already Assigned To Employee"); return; } else { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE(); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 3; _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]); if (dt1.Rows.Count != 0) { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(dt1.Rows[0]["TRAINERDETAILS_EMPLOYEEID"]); } else { _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 21; _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable DT455 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (DT455.Rows.Count != 0) { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0; } else { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0; } } _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDDATE = DateTime.Now; bool status = BLL.set_SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE); if (status == true) { BLL.ShowMessage(this, "Feedback Assigned Successfully"); LoadGrid(); Rg_TrgFeedback.DataBind(); Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0; return; } } } else if (rcmb_CourseSchedule.SelectedItem.Text == "Trainee") { SMHR_ASSIGNFEEDBACK_EMPLOYEE _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE(); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 6; _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(lbl_id.Text); DataTable dttrnee = BLL.get__SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE); if (dttrnee.Rows.Count != 0) { BLL.ShowMessage(this, "Tarining Already Assigned To Trainee"); return; } else { SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 5; _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_TrnEE.TRAINEE_TR_ID = Convert.ToInt32(rcmb_CourseName.SelectedItem.Value); DataTable dtemp = BLL.get_TRAINEE(_obj_Smhr_TrnEE); // for (int i = 0; i <= dtemp.Rows.Count ; i++) // { foreach (DataRow item in dtemp.Rows) { _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION = operation.MODE1; _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID = Convert.ToInt32(rcmb_CC.SelectedItem.Value); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID = Convert.ToInt32(rcmb_CourseName.SelectedItem.Value); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_CourseSchedule.SelectedItem.Text); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME = BLL.ReplaceQuote(Convert.ToString(rtxt_AssessmentName.Text)); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt5 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE(); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 3; _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(item["TRAINEE_EMPID"]); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDDATE = DateTime.Now; bool status = BLL.set_SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE); if (status == true) { //BLL.ShowMessage(this, "Feedback Assigned Successfully"); //LoadGrid(); //Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0; } //BLL.ShowMessage(this, "Feedback Assigned Successfully"); LoadGrid(); Rg_TrgFeedback.DataBind(); Rm_TRGFEEDABCK_PAGE.SelectedIndex = 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> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Approve_Click(object sender, EventArgs e) { try { CheckBox chkBox = new CheckBox(); Label lblID = new Label(); string str = ""; bool status = false; for (int index = 0; index <= RG_TrainingApproval.Items.Count - 1; index++) { chkBox = RG_TrainingApproval.Items[index].FindControl("chk_Choose") as CheckBox; lblID = RG_TrainingApproval.Items[index].FindControl("lbltrgID") as Label; if (chkBox.Checked) { if (str == "") { str = "" + lblID.Text + ""; } else { str = str + "," + lblID.Text + ""; } SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 9; _obj_Smhr_TrgRqst.TR_ID = Convert.ToInt32(lblID.Text); _obj_Smhr_TrgRqst.TR_APPROVEDBY = Convert.ToInt32(Session["emp_id"]); _obj_Smhr_TrgRqst.TR_STATUS = "Approved"; status = BLL.set_TrgRqst(_obj_Smhr_TrgRqst); } } if (string.IsNullOrEmpty(str)) { BLL.ShowMessage(this, "Please Select Training"); return; } if (status == true) { SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.TR_ID = Convert.ToInt32(lblID.Text); _obj_Smhr_TrgRqst.Mode = 13; DataTable dt_ger_tr = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (dt_ger_tr.Rows.Count != 0) { for (int i = 0; i < dt_ger_tr.Rows.Count; i++) { if (dt_ger_tr.Rows[i]["LOGIN_EMAILID"] != System.DBNull.Value) { Dal.ExecuteNonQuery("EXEC USP_SEND_EMAIL_TRAINING @LOGIN_EMAILID='" + Convert.ToString(dt_ger_tr.Rows[i]["LOGIN_EMAILID"]) + "',@RAISEDBY='" + Convert.ToString(dt_ger_tr.Rows[i]["RAISEDBY"]) + "',@APPROVEDBY='" + Convert.ToString(dt_ger_tr.Rows[i]["APPROVEDBY"]) + "',@TR_TITLE='" + Convert.ToString(dt_ger_tr.Rows[i]["TR_TITLE"]) + "'"); } } } SMHR_TRAINER _obj_Smhr_Trner = new SMHR_TRAINER(); _obj_Smhr_Trner.TRAINERDETAILS_TR_ID = Convert.ToInt32(lblID.Text); _obj_Smhr_Trner.Mode = 18; _obj_Smhr_Trner.TRAINERDETAILS_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dttrgexist = BLL.get_TRAINer(_obj_Smhr_Trner); if (dttrgexist.Rows.Count != 0) { if (Convert.ToInt32(dttrgexist.Rows[0]["TRAINERDETAILS_EMPLOYEEID"]) != 0) { _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.TR_ID = Convert.ToInt32(lblID.Text); _obj_Smhr_TrgRqst.Mode = 14; DataTable dt_ger_tr1 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (dt_ger_tr1.Rows.Count != 0) { for (int i = 0; i < dt_ger_tr1.Rows.Count; i++) { if (dt_ger_tr1.Rows[i]["LOGIN_EMAILID"] != System.DBNull.Value) { Dal.ExecuteNonQuery(" exec USP_SEND_EMAIL_TRAINEE @LOGIN_EMAILID = '" + Convert.ToString(dt_ger_tr1.Rows[i]["LOGIN_EMAILID"]) + "',@EMPLOYEE ='" + Convert.ToString(dt_ger_tr1.Rows[i]["EMPLOYEE"]) + "',@TR_TITLE ='" + Convert.ToString(dt_ger_tr1.Rows[i]["TR_TITLE"]) + "',@TS_STARTDATE ='" + Convert.ToString(dt_ger_tr1.Rows[i]["TS_STARTDATE"]) + "',@TS_SESSIONS='" + Convert.ToString(dt_ger_tr1.Rows[i]["TS_SESSIONS"]) + "',@TS_STARTTIME ='" + Convert.ToString(dt_ger_tr1.Rows[i]["TS_STARTTIME"]) + "',@TS_ENDTIME ='" + Convert.ToString(dt_ger_tr1.Rows[i]["TS_ENDTIME"]) + "'"); } } } } else { _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.TR_ID = Convert.ToInt32(lblID.Text); _obj_Smhr_TrgRqst.Mode = 22; DataTable dt_ger_tr2 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (dt_ger_tr2.Rows.Count != 0) { for (int i = 0; i < dt_ger_tr2.Rows.Count; i++) { if (dt_ger_tr2.Rows[i]["LOGIN_EMAILID"] != System.DBNull.Value) { Dal.ExecuteNonQuery(" exec USP_SEND_EMAIL_TRAINEE @LOGIN_EMAILID = '" + Convert.ToString(dt_ger_tr2.Rows[i]["LOGIN_EMAILID"]) + "',@EMPLOYEE ='" + Convert.ToString(dt_ger_tr2.Rows[i]["EMPLOYEE"]) + "',@TR_TITLE ='" + Convert.ToString(dt_ger_tr2.Rows[i]["TR_TITLE"]) + "',@TS_STARTDATE ='" + Convert.ToString(dt_ger_tr2.Rows[i]["TS_STARTDATE"]) + "',@TS_SESSIONS='" + Convert.ToString(dt_ger_tr2.Rows[i]["TS_SESSIONS"]) + "',@TS_STARTTIME ='" + Convert.ToString(dt_ger_tr2.Rows[i]["TS_STARTTIME"]) + "',@TS_ENDTIME ='" + Convert.ToString(dt_ger_tr2.Rows[i]["TS_ENDTIME"]) + "'"); } } } } } BLL.ShowMessage(this, "Selected Trainings Approved"); BLL.ShowMessage(this, "Notification Send"); LoadData(); RG_TrainingApproval.DataBind(); //RG_ExpenseApproval.Visible = false; return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingApproval", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Reject_Click(object sender, EventArgs e) { try { CheckBox chkBox = new CheckBox(); Label lblID = new Label(); int index; bool status = false; int i = 0; string str = ""; for (index = 0; index <= RG_TrainingApproval.Items.Count - 1; index++) { chkBox = RG_TrainingApproval.Items[index].FindControl("chk_Choose") as CheckBox; lblID = RG_TrainingApproval.Items[index].FindControl("lbltrgID") as Label; if (chkBox.Checked) { if (str == "") { str = "" + lblID.Text + ""; } else { str = str + "," + lblID.Text + ""; } SMHR_TRAININGREQUEST _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 9; _obj_Smhr_TrgRqst.TR_ID = Convert.ToInt32(lblID.Text); _obj_Smhr_TrgRqst.TR_APPROVEDBY = Convert.ToInt32(Session["emp_id"]); _obj_Smhr_TrgRqst.TR_STATUS = "Rejected"; status = BLL.set_TrgRqst(_obj_Smhr_TrgRqst); } else { i = i + 1; } } if (i == RG_TrainingApproval.Items.Count) { BLL.ShowMessage(this, "Please Select Training"); return; } if (status == true) { BLL.ShowMessage(this, "Selected Trainings Rejected"); LoadData(); RG_TrainingApproval.DataBind(); //RG_ExpenseApproval.Visible = false; return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingApproval", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Save_Click(object sender, EventArgs e) { try { if (rlb_Quetions.Items.Count != 0) { SMHR_TRAININGFEEDBACK _obj_SMHR_TRAININGFEEDBACK_RESPONSE = new SMHR_TRAININGFEEDBACK(); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION = operation.MODE6; _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID = Convert.ToInt32(rcmb_TRName.SelectedValue); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_Type.SelectedValue); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID = Convert.ToInt32(rcmb_BU.SelectedValue); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt93 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE); if (dt93.Rows.Count != 0) { BLL.ShowMessage(this, "Already Feedback Assigned For Training"); RP_trgfeedback_VIEWDETAILS.Visible = false; Rp_TRGFEEDABCK_VIEWMAIN.Visible = true; Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0; LoadGrid(); Rg_TrgFeedback.DataBind(); Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0; } else { bool res2 = false; _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID = Convert.ToInt32(rcmb_TRName.SelectedValue); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_Type.SelectedValue); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID = Convert.ToInt32(rcmb_BU.SelectedValue); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackName.Text)); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_DESCRIPTION = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackDescription.Text)); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_STATUS = 0; _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.CREATEDDATE = DateTime.Now; _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BACKDATE = Convert.ToInt32(rnt_bakdateddate.Value); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION = operation.Insert; res2 = BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE); Label lblApp = new Label(); for (int index = 0; index < RG_FeedBack.Items.Count; index++) { lblApp = RG_FeedBack.Items[index].FindControl("lblAppID") as Label; SMHR_TRGFEEDBACKQUESDTLS _obj_Smhr_TRGFEEDBACKQUESDTLS = new SMHR_TRGFEEDBACKQUESDTLS(); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION = operation.MODE1; _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackName.Text)); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID = Convert.ToInt32(rcmb_TRName.SelectedValue); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_Type.SelectedValue); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID = Convert.ToInt32(rcmb_BU.SelectedValue); DataTable dt5 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE); _obj_Smhr_TRGFEEDBACKQUESDTLS.TRFDBDTL_FDBID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]); _obj_Smhr_TRGFEEDBACKQUESDTLS.TRFDBDTL_QUESTIONSID = Convert.ToInt32(lblApp.Text); _obj_Smhr_TRGFEEDBACKQUESDTLS.Mode = 3; _obj_Smhr_TRGFEEDBACKQUESDTLS.TRFDBDTL_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_Smhr_TRGFEEDBACKQUESDTLS.TRFDBDTL_CREATEDDATE = DateTime.Now; bool status = BLL.set_TRGFEEDBAKQUESTDTLS(_obj_Smhr_TRGFEEDBACKQUESDTLS); Session["TR_ID"] = Convert.ToInt32(rcmb_TRName.SelectedValue); Session["CATEGORY"] = Convert.ToString(rcmb_Type.SelectedValue); Session["BU_ID"] = Convert.ToInt32(rcmb_BU.SelectedValue); int a = Convert.ToInt32(Session["TR_ID"]); //if (Convert.ToString(BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE).Rows[0]["Count"]) != "0") ////{ //// BLL.ShowMessage(this, "Trainig FeedBack Already Saved Successfully"); //// return; ////} ////else ////{ // //_obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION = operation.Insert; // //res2 = BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE); ////} } if (res2 == true) { BLL.ShowMessage(this, "Training FeedBack Saved Successfully"); rlb_Quetions.Enabled = false; btn_Preview.Visible = true; //btn_Finalize.Visible = true; btn_Save.Visible = false; rcmb_Type.Enabled = false; rcmb_BU.Enabled = false; rcmb_TRName.Enabled = false; rtxt_FeedbackDescription.Text = string.Empty; rtxt_FeedbackName.Enabled = false; RP_trgfeedback_VIEWDETAILS.Visible = false; Rp_TRGFEEDABCK_VIEWMAIN.Visible = true; Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0; LoadGrid(); Rg_TrgFeedback.DataBind(); Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0; //assign feedback to trainer of that trg if (rcmb_Type.SelectedItem.Text == "Trainer") { SMHR_ASSIGNFEEDBACK_EMPLOYEE _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE(); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION = operation.MODE1; _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackName.Text)); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID = Convert.ToInt32(rcmb_BU.SelectedItem.Value); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID = Convert.ToInt32(rcmb_TRName.SelectedItem.Value); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_Type.SelectedItem.Text); DataTable dt5 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE); SMHR_TRAINER _obj_Smhr_Trner = new SMHR_TRAINER(); _obj_Smhr_Trner.Mode = 5; _obj_Smhr_Trner.TRAINERDETAILS_TR_ID = Convert.ToInt32(rcmb_TRName.SelectedItem.Value); DataTable dt1 = BLL.get_TRAINer(_obj_Smhr_Trner); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 2; _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]); //if trg is external then inplace of trainer we are passing hr employeeid if (dt1.Rows.Count != 0) { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(dt1.Rows[0]["TRAINERDETAILS_EMPLOYEEID"]); } else {//IF TRAINER EXTERNAL WE HAVE TO GIVE HR ID _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 21; _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable DT45 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (DT45.Rows.Count != 0) { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0; } else { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0; } } DataTable dt2 = BLL.get__SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE); if (dt2.Rows.Count != 0) { BLL.ShowMessage(this, "Tarining Already Assigned To Employee"); return; } else { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE(); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 3; _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]); if (dt1.Rows.Count != 0) { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(dt1.Rows[0]["TRAINERDETAILS_EMPLOYEEID"]); } else { _obj_Smhr_TrgRqst = new SMHR_TRAININGREQUEST(); _obj_Smhr_TrgRqst.Mode = 21; _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable DT455 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst); if (DT455.Rows.Count != 0) { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0; } else { _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0; } } _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDDATE = DateTime.Now; bool status = BLL.set_SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE); if (status == true) { BLL.ShowMessage(this, "Feedback Assigned Successfully"); RP_trgfeedback_VIEWDETAILS.Visible = false; Rp_TRGFEEDABCK_VIEWMAIN.Visible = true; Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0; LoadGrid(); Rg_TrgFeedback.DataBind(); Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0; } } } else if (rcmb_Type.SelectedItem.Text == "Trainee") { _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION = operation.MODE1; _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackName.Text)); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID = Convert.ToInt32(rcmb_BU.SelectedItem.Value); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID = Convert.ToInt32(rcmb_TRName.SelectedItem.Value); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_Type.SelectedItem.Text); DataTable dt55 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE); SMHR_ASSIGNFEEDBACK_EMPLOYEE _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE(); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 6; //_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(lbl_id.Text); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt55.Rows[0]["FEEDBACK_ID"]); DataTable dttrnee = BLL.get__SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE); if (dttrnee.Rows.Count != 0) { BLL.ShowMessage(this, "Training Already Assigned To Trainee"); } else { SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE(); _obj_Smhr_TrnEE.Mode = 5; _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_TrnEE.TRAINEE_TR_ID = Convert.ToInt32(rcmb_TRName.SelectedItem.Value); DataTable dtemp = BLL.get_TRAINEE(_obj_Smhr_TrnEE); // for (int i = 0; i <= dtemp.Rows.Count ; i++) // { foreach (DataRow item in dtemp.Rows) { _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION = operation.MODE1; _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID = Convert.ToInt32(rcmb_BU.SelectedItem.Value); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID = Convert.ToInt32(rcmb_TRName.SelectedItem.Value); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_Type.SelectedItem.Text); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackName.Text)); _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt5 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE(); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 3; _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(item["TRAINEE_EMPID"]); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDDATE = DateTime.Now; bool status = BLL.set_SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE); if (status == true) { //LoadGrid(); //Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0; } //BLL.ShowMessage(this, "Feedback Assigned Successfully"); BLL.ShowMessage(this, "Feedback Assigned Successfully"); RP_trgfeedback_VIEWDETAILS.Visible = false; Rp_TRGFEEDABCK_VIEWMAIN.Visible = true; Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0; LoadGrid(); Rg_TrgFeedback.DataBind(); Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0; } } } return; } else { BLL.ShowMessage(this, "Please Check Feedback Question"); return; } } } else { BLL.ShowMessage(this, "Please Check Feedback Question"); return; } } 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"); } }