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="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"); } }
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"); } }