private void LoadAppraisalCycle() { try { rtxt_AppraisalCycle.ClearSelection(); rtxt_AppraisalCycle.Items.Clear(); rtxt_AppraisalCycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 9; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BU.SelectedItem.Value); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); DataTable DT_AppraisalCycle = new DataTable(); DT_AppraisalCycle = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (DT_AppraisalCycle.Rows.Count != 0) { rtxt_AppraisalCycle.Items.Clear(); rtxt_AppraisalCycle.DataSource = DT_AppraisalCycle; rtxt_AppraisalCycle.DataTextField = "APPRCYCLE_NAME"; rtxt_AppraisalCycle.DataValueField = "APPRCYCLE_ID"; rtxt_AppraisalCycle.DataBind(); rtxt_AppraisalCycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsAppraisalnew", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void RG_Appraisalcycle_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { try { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 1; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); DataTable dt = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (dt.Rows.Count != 0) { RG_Appraisalcycle.DataSource = dt; } else { DataTable dt_Details = new DataTable(); RG_Appraisalcycle.DataSource = dt_Details; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsAppraisalCycle", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void loadAppCycleGoal() { try { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.OPERATION = operation.Empty; _obj_Pms_Appraisalcycle.MODE = 8; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BusinessUnitGoal.SelectedItem.Value); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); DataTable DT_AppraisalCycle = new DataTable(); DT_AppraisalCycle = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (DT_AppraisalCycle.Rows.Count != 0) { RCB_AppraisalCycleGoal.DataSource = DT_AppraisalCycle; RCB_AppraisalCycleGoal.DataTextField = "APPRCYCLE_NAME"; RCB_AppraisalCycleGoal.DataValueField = "APPRCYCLE_ID"; RCB_AppraisalCycleGoal.DataBind(); RCB_AppraisalCycleGoal.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } else { DataTable dt1 = new DataTable(); RCB_AppraisalCycleGoal.DataSource = dt1; RCB_AppraisalCycleGoal.DataBind(); RCB_AppraisalCycleGoal.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Pms_Reports", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// Here loadgrid() method for load a grid... /// </summary> protected void loadgrid() { try { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 11; _obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(Session["EMP_ID"]);//where i am passing employee to get bunit _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dtemzz = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); _obj_Pms_Appraisalcycle.MODE = 8; if (dtemzz.Rows.Count != 0) { _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(dtemzz.Rows[0]["EMP_BUSINESSUNIT_ID"]); DataTable dtappidzz = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (dtappidzz.Rows.Count != 0) { _obj_Pms_AppStatus = new SPMS_APRAISALSTATUS(); _obj_Pms_AppStatus.APP_EMP_ID = Convert.ToInt32(Session["EMP_ID"]); _obj_Pms_AppStatus.APP_LASTMDFBY = Convert.ToInt32(rcmb_appcycle.SelectedItem.Value);//Convert.ToInt32(dtappidzz.Rows[0]["APPRCYCLE_ID"]); _obj_Pms_AppStatus.Mode = 6; _obj_Pms_AppStatus.APP_STATUS_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt = Pms_Bll.get_AppStatus(_obj_Pms_AppStatus); if (dt.Rows.Count != 0) { RG_Employeertg.DataSource = dt; RG_Employeertg.DataBind(); } else { DataTable dt1 = new DataTable(); RG_Employeertg.DataSource = dt1; RG_Employeertg.DataBind(); } } else { DataTable dt1 = new DataTable(); RG_Employeertg.DataSource = dt1; RG_Employeertg.DataBind(); } } else { DataTable dt1 = new DataTable(); RG_Employeertg.DataSource = dt1; RG_Employeertg.DataBind(); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "FrmEmployeeRating", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_BusinessUnit_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcmb_BusinessUnit.SelectedItem.Text != "Select") { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.OPERATION = operation.Empty; _obj_Pms_Appraisalcycle.MODE = 8; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable DT_AppraisalCycle = new DataTable(); DT_AppraisalCycle = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (DT_AppraisalCycle.Rows.Count != 0) { rcmb_AppCycle.DataSource = DT_AppraisalCycle; rcmb_AppCycle.DataTextField = "APPRCYCLE_NAME"; rcmb_AppCycle.DataValueField = "APPRCYCLE_ID"; rcmb_AppCycle.DataBind(); rcmb_AppCycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } else { DataTable dt4 = new DataTable(); rcmb_AppCycle.DataSource = dt4; rcmb_AppCycle.DataBind(); rcmb_AppCycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); return; } } else { Pms_Bll.ShowMessage(this, "Please Select Business Unit"); DataTable dt5 = new DataTable(); rcmb_AppCycle.DataSource = dt5; rcmb_AppCycle.DataBind(); //rcmb_RManager.Visible = false; //lbl_RM.Visible = false; rcmb_RManager.DataSource = dt5; rcmb_RManager.DataBind(); Rg_Ratings.Visible = false; return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Pms_Reports", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcm_app_cycleAppDisc_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcm_app_cycleAppDisc.SelectedItem.Text != "Select") { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 8; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcm_bunitAppDisc.SelectedValue); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); DataTable dtappidzz1 = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (dtappidzz1.Rows.Count != 0) { _obj_Spms_Appraisal = new SPMS_APPRAISAL(); _obj_Spms_Appraisal.Mode = 26; _obj_Spms_Appraisal.APPRAISAL_BUSSINESS_UNIT = Convert.ToInt32(rcm_bunitAppDisc.SelectedItem.Value); _obj_Spms_Appraisal.APPRAISAL_APPRAISALCYCLE = Convert.ToInt32(rcm_app_cycleAppDisc.SelectedItem.Value);//Convert.ToInt32(dtappidzz1.Rows[0]["APPRCYCLE_ID"]); _obj_Spms_Appraisal.APPRAISAL_ORGANISATION_ID = Convert.ToInt32(Session["org_id"]); DataTable DT = Pms_Bll.get_Appraisal(_obj_Spms_Appraisal); if (DT.Rows.Count != 0) { Rg_appdisc.DataSource = DT; Rg_appdisc.DataBind(); Rm_App_Disc.SelectedIndex = 1; } else { DataTable dt2 = new DataTable(); Rg_appdisc.DataSource = dt2; Rg_appdisc.DataBind(); Rm_App_Disc.SelectedIndex = 1; } } } else { Pms_Bll.ShowMessage(this, "No Active Appraisal Cycle Under Business Unit"); DataTable dt1 = new DataTable(); Rg_appdisc.DataSource = dt1; Rg_appdisc.DataBind(); Rm_Goal_Reports.SelectedIndex = 1; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Pms_Reports", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// HERE I AM LOADING Goals DETAILS FROM PREVIOUS GOAL SETTING DETAILS TABLE /// </summary> protected void LoadAppraisalCycle1() { try { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 11; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(Session["empid1"]);//where i am passing employee to get bunit DataTable dtem = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (dtem.Rows.Count != 0) { _obj_Pms_Appraisalcycle.MODE = 7; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(dtem.Rows[0]["EMP_BUSINESSUNIT_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (dt.Rows.Count != 0) { rcm_apprcycle.DataSource = dt; rcm_apprcycle.DataTextField = "APPRCYCLE_NAME"; rcm_apprcycle.DataValueField = "APPRCYCLE_ID"; rcm_apprcycle.DataBind(); rcm_apprcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } else { DataTable dt44 = new DataTable(); rcm_apprcycle.DataSource = dt44; rcm_apprcycle.DataBind(); rcm_apprcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } else { DataTable dt44 = new DataTable(); rcm_apprcycle.DataSource = dt44; rcm_apprcycle.DataBind(); rcm_apprcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } catch (Exception ex) { //Pms_Bll.ShowMessage(this, ex.Message.ToString()); //return; SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsTask", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadAppraisalCycle() { try { rcmb_appcycle.ClearSelection(); rcmb_appcycle.Items.Clear(); rcmb_appcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 11; _obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(Session["EMP_ID"]);//where i am passing employee to get bunit _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dtemzz = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 9; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(dtemzz.Rows[0]["EMP_BUSINESSUNIT_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); DataTable DT_AppraisalCycle = new DataTable(); DT_AppraisalCycle = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (DT_AppraisalCycle.Rows.Count != 0) { rcmb_appcycle.DataSource = DT_AppraisalCycle; rcmb_appcycle.DataTextField = "APPRCYCLE_NAME"; rcmb_appcycle.DataValueField = "APPRCYCLE_ID"; rcmb_appcycle.DataBind(); rcmb_appcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } else { rcmb_appcycle.ClearSelection(); rcmb_appcycle.Items.Clear(); rcmb_appcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "FrmEmployeeRating", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void LoadAppraisalCycle() { try { rcmb_AppCycle.Items.Clear(); _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 9; if (Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value) > 0) { _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value); } else { _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = 0; } _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); DataTable DT_AppraisalCycle = new DataTable(); DT_AppraisalCycle = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (DT_AppraisalCycle.Rows.Count != 0) { rcmb_AppCycle.DataSource = DT_AppraisalCycle; rcmb_AppCycle.DataTextField = "APPRCYCLE_NAME"; rcmb_AppCycle.DataValueField = "APPRCYCLE_ID"; rcmb_AppCycle.DataBind(); rcmb_AppCycle.Items.Insert(0, new RadComboBoxItem("All")); } else { DataTable dt6 = new DataTable(); rcmb_AppCycle.DataSource = dt6; rcmb_AppCycle.DataBind(); rcmb_AppCycle.Items.Insert(0, new RadComboBoxItem("All")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "PmsAppraisalOpen", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadAppraisalCycle() { try { rcmb_AppCycle.Items.Clear(); _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 15; _obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["APPCYCLE_ID"])); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable DT_AppraisalCycle = new DataTable(); DT_AppraisalCycle = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); rcmb_AppCycle.DataSource = DT_AppraisalCycle; rcmb_AppCycle.DataTextField = "APPRCYCLE_NAME"; rcmb_AppCycle.DataValueField = "APPRCYCLE_ID"; rcmb_AppCycle.DataBind(); rcmb_AppCycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_CopyKRA", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Update_Click(object sender, EventArgs e) { try { _obj_GS = new PMS_GoalSettings(); _obj_GS.GS_MODE = 23;//YYY _obj_GS.GS_ORGANISATION_ID = Convert.ToInt32(Session["org_id"]); _obj_GS.GS_APPRAISAL_CYCLE = Convert.ToString(lbl_ID.Text); DataTable dtgsemp = Pms_Bll.get_GS(_obj_GS); _obj_Pms_AppStatus = new SPMS_APRAISALSTATUS(); _obj_Pms_AppStatus.Mode = 8;//YYY _obj_Pms_AppStatus.APP_STATUS_ORG_ID = Convert.ToInt32(Session["org_id"]); _obj_Pms_AppStatus.APP_STATUS_APPRAISALCYCLE = Convert.ToInt32(lbl_ID.Text); DataTable dtappstatusemp = Pms_Bll.get_AppStatus(_obj_Pms_AppStatus); int Status = Convert.ToInt32(rcmb_Status.SelectedItem.Value); if ((dtgsemp.Rows.Count == dtappstatusemp.Rows.Count) || (dtappstatusemp.Rows.Count == 0)) { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(lbl_ID.Text); _obj_Pms_Appraisalcycle.APPRCYCLE_DESC = Pms_Bll.ReplaceQuote(Convert.ToString(txt_AppraisalDescription.Text)); _obj_Pms_Appraisalcycle.APPRCYCLE_ISACTIVE = Convert.ToBoolean(Status); _obj_Pms_Appraisalcycle.APPRCYCLE_MODIFIEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_MODIFIED_DATE = DateTime.Now; _obj_Pms_Appraisalcycle.APPRCYCLE_SELFAPPRAISAL = chk_SelfAppraisal.Checked; if (Status == 1) { DataTable dt_chk = new DataTable(); _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 7; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); dt_chk = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 14; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); DataTable dt_chk1 = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); //if ((dt_chk.Rows.Count != 0) && ((Convert.ToInt32(dt_chk1.Rows[0]["APPRCYCLE_ID"])) != (Convert.ToInt32(lbl_ID.Text)))) // { // Pms_Bll.ShowMessage(this, "There is Already Active Appraisal Cycle"); // } // else // { _obj_Pms_Appraisalcycle.MODE = 4; _obj_Pms_Appraisalcycle.APPRCYCLE_ISACTIVE = Convert.ToBoolean(Status); _obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(lbl_ID.Text); _obj_Pms_Appraisalcycle.APPRCYCLE_MODIFIEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_MODIFIED_DATE = DateTime.Now; _obj_Pms_Appraisalcycle.APPRCYCLE_DESC = Convert.ToString(txt_AppraisalDescription.Text.Replace("'", "''")); _obj_Pms_Appraisalcycle.APPRCYCLE_SELFAPPRAISAL = chk_SelfAppraisal.Checked; bool status = Pms_Bll.set_Appraisalcycle(_obj_Pms_Appraisalcycle); if (status == true) { Pms_Bll.ShowMessage(this, "Record Updated Successfully"); _obj_GS = new PMS_GoalSettings(); _obj_GS.GS_MODE = 20;//YYY _obj_GS.GS_APPRAISAL_CYCLE = Convert.ToString(lbl_ID.Text); bool status22 = Pms_Bll.set_GS(_obj_GS); loadgrid(); btn_Update.Visible = true; RMP_AppraisalCycle.SelectedIndex = 0; } else { Pms_Bll.ShowMessage(this, "Unable to Update the record,Execption Occured"); return; } //} } else { _obj_Pms_Appraisalcycle.MODE = 4; bool status = Pms_Bll.set_Appraisalcycle(_obj_Pms_Appraisalcycle); if (status == true) { Pms_Bll.ShowMessage(this, "Record Updated Successfully"); _obj_GS = new PMS_GoalSettings(); _obj_GS.GS_MODE = 20;//YYY _obj_GS.GS_APPRAISAL_CYCLE = Convert.ToString(lbl_ID.Text); bool status22 = Pms_Bll.set_GS(_obj_GS); loadgrid(); btn_Update.Visible = true; RMP_AppraisalCycle.SelectedIndex = 0; } else { Pms_Bll.ShowMessage(this, "Unable to Update the record,Execption Occured"); return; } } } else { Pms_Bll.ShowMessage(this, "Appraisal Cycle In Process"); return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsAppraisalCycle", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); Pms_Bll.ShowMessage(this, ex.Message.ToString()); return; } }
protected void btn_Save_Click(object sender, EventArgs e) { try { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 12; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); _obj_Pms_Appraisalcycle.APPRCYCLE_NAME = Convert.ToString(txt_Appraisalcycle.Text.Replace("'", "''")); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); DataTable dtname = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (dtname.Rows.Count != 0) { Pms_Bll.ShowMessage(this, "Appraisal Cycle Name Already Exist"); return; } else { //if (Convert.ToDateTime(RDP_EndDate.SelectedDate.Value) < DateTime.Now) //{ // //RDP_StartDate.Clear(); // RDP_EndDate.Clear(); // Pms_Bll.ShowMessage(this, "End Date Should Be Greater Than Current Date"); // return; //} //if (RDP_EndDate.SelectedDate <RDP_StartDate.SelectedDate) //{ // Pms_Bll.ShowMessage(this, "end date"); // return; //} int Status = Convert.ToInt32(rcmb_Status.SelectedItem.Value); if (Status == 1) { //DataTable dt = new DataTable(); //_obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); //_obj_Pms_Appraisalcycle.MODE = 7; //_obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); //_obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); //dt = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); ////in which if there is any active appraisal cycle under that business unit //if (dt.Rows.Count != 0) //{ // Pms_Bll.ShowMessage(this, "There is Already Active Appraisal Cycle"); // return; //} //else //{ _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 10; _obj_Pms_Appraisalcycle.APPCYCLE_STARTDATE = RDP_StartDate.SelectedDate.Value; _obj_Pms_Appraisalcycle.APPCYCLE_ENDDATE = RDP_EndDate.SelectedDate.Value; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); DataTable dt2 = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (Convert.ToString(dt2.Rows[0][0]).Trim() == "0") { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 3; _obj_Pms_Appraisalcycle.APPRCYCLE_NAME = Pms_Bll.ReplaceQuote(Convert.ToString(txt_Appraisalcycle.Text)); _obj_Pms_Appraisalcycle.APPRCYCLE_DESC = Pms_Bll.ReplaceQuote(Convert.ToString(txt_AppraisalDescription.Text)); _obj_Pms_Appraisalcycle.APPCYCLE_STARTDATE = RDP_StartDate.SelectedDate.Value; _obj_Pms_Appraisalcycle.APPCYCLE_ENDDATE = RDP_EndDate.SelectedDate.Value; _obj_Pms_Appraisalcycle.CREATEDBY = Convert.ToInt32(Session["user_id"]); // ### Need to Get the Session _obj_Pms_Appraisalcycle.CREATEDDATE = DateTime.Now; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BUI.SelectedValue); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); _obj_Pms_Appraisalcycle.APPRCYCLE_ISACTIVE = Convert.ToBoolean(Status); _obj_Pms_Appraisalcycle.APPRCYCLE_SELFAPPRAISAL = chk_SelfAppraisal.Checked; bool status = Pms_Bll.set_Appraisalcycle(_obj_Pms_Appraisalcycle); if (status == true) { Pms_Bll.ShowMessage(this, "Record Inserted Successfully"); loadgrid(); ClearFields(); RMP_AppraisalCycle.SelectedIndex = 0; RP_AppraisalCycle.Visible = true; return; } } else { Pms_Bll.ShowMessage(this, "Appraisal Cycle Already Exists for this Date."); return; } //} } else { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 10; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); _obj_Pms_Appraisalcycle.APPCYCLE_STARTDATE = RDP_StartDate.SelectedDate.Value; _obj_Pms_Appraisalcycle.APPCYCLE_ENDDATE = RDP_EndDate.SelectedDate.Value; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); //0;//bbb DataTable dt2 = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (Convert.ToString(dt2.Rows[0][0]).Trim() == "0") { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 3; _obj_Pms_Appraisalcycle.APPRCYCLE_NAME = Pms_Bll.ReplaceQuote(Convert.ToString(txt_Appraisalcycle.Text)); _obj_Pms_Appraisalcycle.APPRCYCLE_DESC = Pms_Bll.ReplaceQuote(Convert.ToString(txt_AppraisalDescription.Text)); _obj_Pms_Appraisalcycle.APPCYCLE_STARTDATE = RDP_StartDate.SelectedDate.Value; _obj_Pms_Appraisalcycle.APPCYCLE_ENDDATE = RDP_EndDate.SelectedDate.Value; _obj_Pms_Appraisalcycle.CREATEDBY = Convert.ToInt32(Session["user_id"]); // ### Need to Get the Session _obj_Pms_Appraisalcycle.CREATEDDATE = DateTime.Now; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BUI.SelectedValue); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); _obj_Pms_Appraisalcycle.APPRCYCLE_ISACTIVE = Convert.ToBoolean(Status); _obj_Pms_Appraisalcycle.APPRCYCLE_SELFAPPRAISAL = chk_SelfAppraisal.Checked; bool status = Pms_Bll.set_Appraisalcycle(_obj_Pms_Appraisalcycle); if (status == true) { Pms_Bll.ShowMessage(this, "Record Inserted Successfully"); loadgrid(); ClearFields(); RMP_AppraisalCycle.SelectedIndex = 0; RP_AppraisalCycle.Visible = true; return; } } else { Pms_Bll.ShowMessage(this, "End Date Should Be Greater Existed End Date"); return; } } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsAppraisalCycle", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void lnk_Edit_Commnad(object sender, CommandEventArgs e) { try { ClearFields(); _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 2; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); _obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(e.CommandArgument); lbl_ID.Text = Convert.ToString(e.CommandArgument); DataTable DT = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); int Status = Convert.ToInt32(DT.Rows[0]["APPRCYCLE_ISACTIVE"]); if (DT.Rows.Count != 0) { lbl_ID.Text = Convert.ToString(DT.Rows[0]["APPRCYCLE_ID"]); txt_Appraisalcycle.Text = Convert.ToString(DT.Rows[0]["APPRCYCLE_NAME"]); txt_AppraisalDescription.Text = Convert.ToString(DT.Rows[0]["APPRCYCLE_DESC"]); LoadCombos(); rcmb_BUI.SelectedIndex = rcmb_BUI.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["APPRCYCLE_BU_ID"])); RDP_StartDate.SelectedDate = Convert.ToDateTime(DT.Rows[0]["APPCYCLE_STARTDATE"]); RDP_EndDate.SelectedDate = Convert.ToDateTime(DT.Rows[0]["APPCYCLE_ENDDATE"]); rcmb_Status.SelectedIndex = rcmb_Status.FindItemIndexByValue(Convert.ToString(Status)); if (DT.Rows[0]["APPRCYCLE_SELFAPPRAISAL"] != System.DBNull.Value) { chk_SelfAppraisal.Checked = Convert.ToBoolean(DT.Rows[0]["APPRCYCLE_SELFAPPRAISAL"]); } else { chk_SelfAppraisal.Checked = false; } RMP_AppraisalCycle.SelectedIndex = 1; btn_Save.Visible = true; btn_Save.Visible = false; btn_Update.Visible = true; txt_Appraisalcycle.Enabled = false; RDP_StartDate.Enabled = false; RDP_EndDate.Enabled = false; rcmb_BUI.Enabled = false; //chk_SelfAppraisal.Enabled = false; if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_Save.Visible = false; btn_Update.Visible = false; } else { btn_Save.Visible = false; btn_Update.Visible = true; } } else { Pms_Bll.ShowMessage(this, "Error Occured"); return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsAppraisalCycle", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void LoadGrid() { try { _obj_pms_EmployeeSetup = new PMS_EMPSETUP(); _obj_pms_EmployeeSetup.EMP_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["EMP_ID"])); _obj_pms_EmployeeSetup.LASTMDFBY = Convert.ToInt32(Session["ORG_ID"]); DataTable dtbuid1 = Pms_Bll.get_LoginInfo(_obj_pms_EmployeeSetup); if (dtbuid1.Rows.Count != 0) { lbl_RPMgr_Name.Text = Convert.ToString(dtbuid1.Rows[0]["REPORTINGMANAGER"]); lbl_ApprMgr_Name.Text = Convert.ToString(dtbuid1.Rows[0]["APPROVALMANAGER"]); _obj_GS = new PMS_GoalSettings(); _obj_GS.GS_MODE = 9; _obj_GS.GS_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_GS.GS_EMP_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["EMP_ID"])); _obj_GS.GS_APPRAISAL_CYCLE = Convert.ToString(Request.QueryString["APPCYCLE_ID"]);//Convert.ToString(dtappid.Rows[0]["APPRCYCLE_ID"]); DataTable dt1 = Pms_Bll.get_GS(_obj_GS); if (dt1.Rows.Count != 0) { lbl_Role_Name.Text = Convert.ToString(dt1.Rows[0]["ROLE_NAMES"]); //lbl_Project_Name.Text = Convert.ToString(dt1.Rows[0]["PROJECT_NAME"]); } } //TO GET SELFAPPRAISAL FOR THE APPRAISAL CYCLE ENABLE OR NOT,18.09.2012 _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 2; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["APPCYCLE_ID"])); DataTable DT = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (DT.Rows.Count > 0) { if (DT.Rows[0]["APPRCYCLE_SELFAPPRAISAL"] != System.DBNull.Value) { if (Convert.ToBoolean(DT.Rows[0]["APPRCYCLE_SELFAPPRAISAL"]) == true) { //RG_EmpAppraisalDetails.Columns[6].Visible = true; //RG_EmpAppraisalDetails.Columns[7].Visible = true; RG_EmpAppraisalDetails.Columns[4].Visible = true; } else { //RG_EmpAppraisalDetails.Columns[6].Visible = false; //RG_EmpAppraisalDetails.Columns[7].Visible = false; RG_EmpAppraisalDetails.Columns[4].Visible = false; } } } //TO LOAD THE GRID _obj_Pms_EmpGoalSetting = new SPMS_EMPGOALSETTING(); _obj_Pms_EmpGoalSetting.Mode = 8; _obj_Pms_EmpGoalSetting.GS_EMP_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["EMP_ID"])); _obj_Pms_EmpGoalSetting.GS_APPRAISAL_CYCLE = Convert.ToString(Request.QueryString["APPCYCLE_ID"]); //Convert.ToString(dtappid.Rows[0]["APPRCYCLE_ID"]); _obj_Pms_EmpGoalSetting.CREATEDBY = Convert.ToInt32(Session["ORG_ID"]); _obj_GS = new PMS_GoalSettings(); DataTable dt = Pms_Bll.get_EmpGoalSetting(_obj_Pms_EmpGoalSetting); if (dt.Rows.Count != 0) { _obj_GS.GS_ID = Convert.ToInt32(dt.Rows[0]["GS_ID"]); } else { _obj_GS.GS_ID = 0; } if (Convert.ToString(Request.QueryString["STR"].Trim()) == "GS_APPROVAL") { _obj_GS.GS_MODE = 33; //RG_EmpAppraisalDetails.Columns[6].Visible = false; //RG_EmpAppraisalDetails.Columns[7].Visible = false; //RG_EmpAppraisalDetails.Columns[8].Visible = false; //RG_EmpAppraisalDetails.Columns[9].Visible = false; RG_EmpAppraisalDetails.Columns[4].Visible = false; RG_EmpAppraisalDetails.Columns[5].Visible = false; RG_EmpAppraisalDetails.Columns[6].Visible = false; } else { _obj_GS.GS_MODE = 37; RG_EmpAppraisalDetails.Columns[2].Visible = false; RG_EmpAppraisalDetails.Columns[3].Visible = false; //RG_EmpAppraisalDetails.Columns[4].Visible = false; //RG_EmpAppraisalDetails.Columns[5].Visible = false; } _obj_GS.GS_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); //_obj_GS.GS_ID = Convert.ToInt32(Session["GSID"]); DataTable dt_details = new DataTable(); dt_details = Pms_Bll.get_GS(_obj_GS); if (dt_details.Rows.Count > 0) { RG_EmpAppraisalDetails.DataSource = dt_details; RG_EmpAppraisalDetails.DataBind(); } else { RG_EmpAppraisalDetails.DataSource = dt_details; RG_EmpAppraisalDetails.DataBind(); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_EMPAppraisalDetails", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_RManager_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcmb_RManager.SelectedItem.Text != "Select") { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 11; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(rcmb_RManager.SelectedItem.Value);//where i am passing employee to get bunit DataTable dtemzzR = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (dtemzzR.Rows.Count != 0) { _obj_Pms_Appraisalcycle.MODE = 8; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); //_obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(dtemzzR.Rows[0]["EMP_BUSINESSUNIT_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value); DataTable dtappidzzR = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); _obj_Spms_Appraisal = new SPMS_APPRAISAL(); _obj_Spms_Appraisal.Mode = 2; _obj_Spms_Appraisal.APPRAISAL_EMP_ID = Convert.ToInt32(rcmb_RManager.SelectedItem.Value); if (dtappidzzR.Rows.Count != 0) { _obj_Spms_Appraisal.APPRAISAL_ID = Convert.ToInt32(rcmb_AppCycle.SelectedItem.Value); //Convert.ToInt32(dtappidzzR.Rows[0]["APPRCYCLE_ID"]); } _obj_Spms_Appraisal.APPRAISAL_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_Rmanager = Pms_Bll.get_EmpRatingDetails(_obj_Spms_Appraisal); if (dt_Rmanager.Rows.Count != 0) { Rg_Ratings.DataSource = dt_Rmanager; Rg_Ratings.DataBind(); _obj_Pms_AppStatus = new SPMS_APRAISALSTATUS(); _obj_Pms_AppStatus.Mode = 7; _obj_Pms_AppStatus.APP_STATUS_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Pms_AppStatus.APP_STATUS_APPRAISALCYCLE = Convert.ToInt32(rcmb_AppCycle.SelectedItem.Value); DataTable dtappsttusemp = Pms_Bll.get_AppStatus(_obj_Pms_AppStatus); if (dtappsttusemp.Rows.Count != 0) { for (int k = 0; k <= Rg_Ratings.Items.Count - 1; k++) { for (int z = 0; z < dtappsttusemp.Rows.Count; z++) { if (Convert.ToInt32(dt_Rmanager.Rows[k]["EMP_ID"]) == Convert.ToInt32(dtappsttusemp.Rows[z]["APP_EMP_ID"])) { LinkButton lnkrej = Rg_Ratings.Items[k].FindControl("lnk_Employee_Edit") as LinkButton; lnkrej.Visible = false; } } } } else { Rg_Ratings.DataSource = dt_Rmanager; Rg_Ratings.DataBind(); //Pms_Bll.ShowMessage(this, "No Employee Completed Appraisal Status"); } Rm_Reprts_Main_PAGE.SelectedIndex = 2; } else { Pms_Bll.ShowMessage(this, "No Employee Under Reporting Manager"); //Rg_Ratings.Visible = false; return; } } //else //{ // Pms_Bll.ShowMessage(this, "Employee Is In Active"); // //Rg_Ratings.Visible = false; // return; //} } else { Pms_Bll.ShowMessage(this, "Please Select Reporting Manager"); //Rg_Ratings.Visible = false; return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Pms_Reports", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// WHILE INSERTING THERE IS NO NEED TO ADD LAST MDF BY,LAST MDF DATE,BASED ON LABEL _KRAID IF IT IS NULL THEN PERFORM INSERTION /// IF END DATE IS NULL THEN WE HAVE TO USE THIS AND IT IS TO BE DEFINED IN TRANSLAYER /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Save_Click(object sender, EventArgs e) { try { if (lbl_Task_Id.Text == "") { _obj_Pms_Task = new SPMS_TASK(); _obj_Pms_Task.Mode = 8; _obj_Pms_Task.TASK_NAME = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskName.Text)); _obj_Pms_Task.TASK_EMP_ID = Convert.ToInt32(rcmb_EmployeeType.SelectedItem.Value); _obj_Pms_Task.TASK_GOAL_ID = Convert.ToInt32(rcmb_GoalType.SelectedItem.Value); _obj_Pms_Task.TASK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt = Pms_Bll.get_Task(_obj_Pms_Task); if (dt.Rows.Count != 0) { Pms_Bll.ShowMessage(this, "Task Name Already Exist"); return; } else { if (rdtp_DATE.SelectedDate < DateTime.Now) { rdtp_DATE.Clear(); Pms_Bll.ShowMessage(this, "TaskDate Should Be Greater Than Current Date"); return; } _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 11; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(Session["EMP_ID"]);//where i am passing employee to get bunit DataTable dtem = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (dtem.Rows.Count != 0) { _obj_Pms_Appraisalcycle.MODE = 7; _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(dtem.Rows[0]["EMP_BUSINESSUNIT_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt22 = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (dt22.Rows.Count != 0) { DateTime dt_st = Convert.ToDateTime(dt22.Rows[0]["APPCYCLE_STARTDATE"]); DateTime dt_et = Convert.ToDateTime(dt22.Rows[0]["APPCYCLE_ENDDATE"]); if ((rdtp_DATE.SelectedDate.Value > dt_et) || (rdtp_DATE.SelectedDate.Value < dt_st)) { BLL.ShowMessage(this, "Date Should Validate With Appraisal Cycle Date"); return; } } else { BLL.ShowMessage(this, "Error Occured"); return; } } else { Pms_Bll.ShowMessage(this, "Employee Is In Active"); return; } _obj_Pms_Task = new SPMS_TASK(); _obj_Pms_Task.TASK_EMP_ID = Convert.ToInt32(rcmb_EmployeeType.SelectedItem.Value); _obj_Pms_Task.TASK_NAME = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskName.Text)); _obj_Pms_Task.TASK_DESCRIPTION = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskDescription.Text)); _obj_Pms_Task.TASK_DATE = rdtp_DATE.SelectedDate.Value; _obj_Pms_Task.TASK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Pms_Task.TASK_GOAL_ID = Convert.ToInt32(rcmb_GoalType.SelectedItem.Value); _obj_Pms_Task.TASK_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_Pms_Task.TASK_CREATEDDATE = DateTime.Now; _obj_Pms_Task.TASK_APPRAISAL_CYCLE = Convert.ToInt32(rcm_apprcycle.SelectedItem.Value); _obj_Pms_Task.Mode = 4; bool status = Pms_Bll.set_Task(_obj_Pms_Task); if (status == true) { LoadGrid(); Rg_Task.DataBind(); btn_Save.Visible = true; Rm_TASK_PAGE.SelectedIndex = 0; Rp_TASK_VIEWDETAILS.Visible = false; Rp_TASK_VIEWMAIN.Visible = true; Pms_Bll.ShowMessage(this, "Task Inserted Successfully"); return; } } } else { _obj_Pms_Task = new SPMS_TASK(); _obj_Pms_Task.TASK_ID = Convert.ToInt32(lbl_Task_Id.Text); _obj_Pms_Task.TASK_EMP_ID = Convert.ToInt32(rcmb_EmployeeType.SelectedItem.Value); _obj_Pms_Task.TASK_NAME = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskName.Text)); _obj_Pms_Task.TASK_DESCRIPTION = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskDescription.Text)); _obj_Pms_Task.TASK_DATE = rdtp_DATE.SelectedDate.Value; _obj_Pms_Task.TASK_GOAL_ID = Convert.ToInt32(rcmb_GoalType.SelectedItem.Value); _obj_Pms_Task.TASK_LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); _obj_Pms_Task.TASK_LASTMDFDATE = DateTime.Now; _obj_Pms_Task.TASK_APPRAISAL_CYCLE = Convert.ToInt32(rcm_apprcycle.SelectedItem.Value); _obj_Pms_Task.Mode = 5; bool status = Pms_Bll.set_Task(_obj_Pms_Task); if (status == true) { LoadGrid(); Rg_Task.DataBind(); btn_Save.Visible = true; Rm_TASK_PAGE.SelectedIndex = 0; Rp_TASK_VIEWDETAILS.Visible = false; Rp_TASK_VIEWMAIN.Visible = true; } if (status == true) { Pms_Bll.ShowMessage(this, "Task Updated Successfully"); // return; } } } catch (Exception ex) { //Pms_Bll.ShowMessage(this, ex.Message.ToString()); //return; SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsTask", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// HERE I AM LOADING Goals DETAILS FROM PREVIOUS GOAL SETTING DETAILS TABLE /// </summary> protected void LoadAppraisalCycle() { try { //PMS_Appraisalcycle _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); //_obj_Pms_Appraisalcycle.MODE = 11; //_obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(Session["EMP_ID"]);//where i am passing employee to get bunit //DataTable dtem = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); //_obj_Pms_Appraisalcycle.MODE = 7; //_obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(dtem.Rows[0]["EMP_BUSINESSUNIT_ID"]); // _obj_GS = new PMS_GoalSettings(); //_obj_GS.GS_MODE = 22; //_obj_GS.GS_EMP_ID=Convert.ToInt32((rcmb_EmployeeType.SelectedItem.Value)); //_obj_GS.GS_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); //DataTable dt = Pms_Bll.get_GS(_obj_GS); //if (dt.Rows.Count != 0) //{ // rcm_apprcycle.DataSource = dt; // rcm_apprcycle.DataTextField = "APPRCYCLE_NAME"; // rcm_apprcycle.DataValueField = "APPRCYCLE_ID"; // rcm_apprcycle.DataBind(); // rcm_apprcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); //} //else //{ // DataTable dt44 = new DataTable(); // rcm_apprcycle.DataSource = dt44; // rcm_apprcycle.DataBind(); // rcm_apprcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); //} rcm_apprcycle.Items.Clear(); _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 9; if (Convert.ToInt32(rcmb_BusinessUnitType.SelectedItem.Value) > 0) { //_obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(dt.Rows[0]["BUSINESSUNIT_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BusinessUnitType.SelectedItem.Value); } else { _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = 0; } _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["org_id"]); DataTable DT_AppraisalCycle = new DataTable(); DT_AppraisalCycle = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (DT_AppraisalCycle.Rows.Count != 0) { rcm_apprcycle.DataSource = DT_AppraisalCycle; rcm_apprcycle.DataTextField = "APPRCYCLE_NAME"; rcm_apprcycle.DataValueField = "APPRCYCLE_ID"; rcm_apprcycle.DataBind(); rcm_apprcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } else { DataTable dt6 = new DataTable(); rcm_apprcycle.DataSource = dt6; rcm_apprcycle.DataBind(); rcm_apprcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } catch (Exception ex) { //Pms_Bll.ShowMessage(this, ex.Message.ToString()); //return; SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsTask", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Approve_Click(object sender, EventArgs e) { try { int logEmpID = Convert.ToInt32(Session["EMP_ID"]); bool status = false; int count = 0; DataTable dtAppProcessEmpData = BLL.get_PMS_APPROVAL_PROCESS_BY_ORG_ID(Convert.ToInt32(Session["ORG_ID"]), Convert.ToInt32(rcmb_BU.SelectedValue)); for (int index = 0; index < RG_ApprAppraisal.Items.Count; index++) { CheckBox chk = RG_ApprAppraisal.Items[index].FindControl("chckbtn_Select") as CheckBox; if (chk.Checked) { count++; string EMP_ID = Convert.ToString(RG_ApprAppraisal.Items[index]["EMP_ID"].Text); string rtng = Convert.ToString(RG_ApprAppraisal.Items[index]["APPRAISAL_AVGRTG"].Text); //RadRating rtng = RG_ApprAppraisal.Items[index].FindControl("rtng_emprtng") as RadRating; _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(rcmb_BU.SelectedItem.Value); _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dtappid = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); _obj_Pms_EmpGoalSetting = new SPMS_EMPGOALSETTING(); _obj_Pms_EmpGoalSetting.Mode = 8; _obj_Pms_EmpGoalSetting.GS_EMP_ID = Convert.ToInt32(EMP_ID); if (dtappid.Rows.Count != 0) { _obj_Pms_EmpGoalSetting.GS_APPRAISAL_CYCLE = Convert.ToString(rtxt_AppraisalCycle.SelectedItem.Value);//Convert.ToString(dtappid.Rows[0]["APPRCYCLE_ID"]); } else { _obj_Pms_EmpGoalSetting.GS_APPRAISAL_CYCLE = "0"; } _obj_Pms_EmpGoalSetting.CREATEDBY = Convert.ToInt32(Session["ORG_ID"]); DataTable dt = Pms_Bll.get_EmpGoalSetting(_obj_Pms_EmpGoalSetting); _obj_GS = new PMS_GoalSettings(); if (dt.Rows.Count != 0) { _obj_GS.GS_ID = Convert.ToInt32(dt.Rows[0]["GS_ID"]); } else { _obj_GS.GS_ID = 0; } //TO UPDATE THE STATUS IN APPRAISAL _obj_Spms_Appraisal = new SPMS_APPRAISAL(); _obj_Spms_Appraisal.APPRAISAL_EMP_ID = Convert.ToInt32(EMP_ID); _obj_Spms_Appraisal.APPRAISAL_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Spms_Appraisal.APPRAISAL_APPRAISALCYCLE = Convert.ToInt32(rtxt_AppraisalCycle.SelectedItem.Value);//Convert.ToInt32(dtappid.Rows[0]["APPRCYCLE_ID"]); _obj_Spms_Appraisal.APPRAISAL_STATUS = 3; _obj_Spms_Appraisal.APPRAISAL_LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); _obj_Spms_Appraisal.APPRAISAL_LASTMDFDATE = DateTime.Now; _obj_Spms_Appraisal.Mode = 48; status = Pms_Bll.set_Appraisal(_obj_Spms_Appraisal); //TO GET THE APPRAISAL ID _obj_Spms_Appraisal = new SPMS_APPRAISAL(); _obj_Spms_Appraisal.APPRAISAL_EMP_ID = Convert.ToInt32(EMP_ID); _obj_Spms_Appraisal.APPRAISAL_APPRAISALCYCLE = Convert.ToInt32(rtxt_AppraisalCycle.SelectedItem.Value); //Convert.ToInt32(dtappid.Rows[0]["APPRCYCLE_ID"]); _obj_Spms_Appraisal.Mode = 5; _obj_Spms_Appraisal.APPRAISAL_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_app_id = Pms_Bll.get_Appraisal(_obj_Spms_Appraisal); //TO CHECK WHETHER DATA EXISTS IN APPRAISAL APPROVER OR NOT _obj_Pms_AppApprover = new SPMS_APRAISALAPPROVER(); if (dt_app_id.Rows.Count != 0) { _obj_Pms_AppApprover.APP_APPROVER_APP_ID = Convert.ToInt32(dt_app_id.Rows[0]["APPRAISAL_ID"]); } else { _obj_Pms_AppApprover.APP_APPROVER_APP_ID = 0; } _obj_Pms_AppApprover.Mode = 6; DataTable dt_appr = Pms_Bll.get_AppApprover(_obj_Pms_AppApprover); if (dt_appr.Rows.Count == 0) { //TO INSERT DATA INTO APPRAISAL APPROVER _obj_Pms_AppApprover = new SPMS_APRAISALAPPROVER(); if (dt_app_id.Rows.Count != 0) { _obj_Pms_AppApprover.APP_APPROVER_APP_ID = Convert.ToInt32(dt_app_id.Rows[0]["APPRAISAL_ID"]); } else { _obj_Pms_AppApprover.APP_APPROVER_APP_ID = 0; } _obj_Pms_AppApprover.Mode = 3; _obj_Pms_AppApprover.APP_APPROVER_RATING = Convert.ToDecimal(rtng); _obj_Pms_AppApprover.APP_APPROVER_COMMENTS = Convert.ToString(Pms_Bll.ReplaceQuote(rtxt_comments.Text)); _obj_Pms_AppApprover.APP_APPROVER_CREATEDBY = Convert.ToInt32(Session["user_id"]); _obj_Pms_AppApprover.APP_APPROVER_CREATEDDATE = DateTime.Now; _obj_Pms_AppApprover.APP_APPROVER_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); if (dtAppProcessEmpData.Rows.Count > 0) { if (logEmpID == Convert.ToInt32(dtAppProcessEmpData.Rows[0]["PMS_APPROVAL_PROCESS_EMP_ID_1"])) { _obj_Pms_AppApprover.APP_APPROVER_STATUS = 1; } else if (logEmpID == Convert.ToInt32(string.IsNullOrEmpty(dtAppProcessEmpData.Rows[0]["PMS_APPROVAL_PROCESS_EMP_ID_2"].ToString()) ? 0 : Convert.ToInt32(dtAppProcessEmpData.Rows[0]["PMS_APPROVAL_PROCESS_EMP_ID_2"]))) { _obj_Pms_AppApprover.APP_APPROVER_STATUS = 2; } else if (logEmpID == Convert.ToInt32(dtAppProcessEmpData.Rows[0]["PMS_APPROVAL_PROCESS_EMP_ID_3"])) { _obj_Pms_AppApprover.APP_APPROVER_STATUS = 3; } else { _obj_Pms_AppApprover.APP_APPROVER_STATUS = 0; } } bool status1 = Pms_Bll.set_AppApprover(_obj_Pms_AppApprover); } else { //TO UPDATE DATA IN APPRAISAL APPROVER _obj_Pms_AppApprover = new SPMS_APRAISALAPPROVER(); if (dt_app_id.Rows.Count != 0) { _obj_Pms_AppApprover.APP_APPROVER_APP_ID = Convert.ToInt32(dt_app_id.Rows[0]["APPRAISAL_ID"]); } else { _obj_Pms_AppApprover.APP_APPROVER_APP_ID = 0; } _obj_Pms_AppApprover.Mode = 8; _obj_Pms_AppApprover.APP_APPROVER_RATING = Convert.ToDecimal(rtng); //_obj_Pms_AppApprover.APP_APPROVER_COMMENTS = Convert.ToString(rtxt_comments.Text.Replace("'", "''")); _obj_Pms_AppApprover.APP_APPROVER_COMMENTS = Convert.ToString(Pms_Bll.ReplaceQuote(rtxt_comments.Text)); _obj_Pms_AppApprover.APP_APPROVER_LASTMDFBY = Convert.ToInt32(Session["user_id"]); _obj_Pms_AppApprover.APP_APPROVER_LASTMDFDATE = DateTime.Now; _obj_Pms_AppApprover.APP_APPROVER_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); if (dtAppProcessEmpData.Rows.Count > 0) { if (logEmpID == Convert.ToInt32(dtAppProcessEmpData.Rows[0]["PMS_APPROVAL_PROCESS_EMP_ID_1"])) { _obj_Pms_AppApprover.APP_APPROVER_STATUS = 1; } else if (logEmpID == Convert.ToInt32(string.IsNullOrEmpty(dtAppProcessEmpData.Rows[0]["PMS_APPROVAL_PROCESS_EMP_ID_2"].ToString()) ? 0 : Convert.ToInt32(dtAppProcessEmpData.Rows[0]["PMS_APPROVAL_PROCESS_EMP_ID_2"]))) { _obj_Pms_AppApprover.APP_APPROVER_STATUS = 2; } else if (logEmpID == Convert.ToInt32(dtAppProcessEmpData.Rows[0]["PMS_APPROVAL_PROCESS_EMP_ID_3"])) { _obj_Pms_AppApprover.APP_APPROVER_STATUS = 3; } else { _obj_Pms_AppApprover.APP_APPROVER_STATUS = 0; } } bool status1 = Pms_Bll.set_AppApprover(_obj_Pms_AppApprover); } } } if (count == 0) { BLL.ShowMessage(this, "Please Select Atleast one Employee to Approve."); return; } BLL.ShowMessage(this, "Approver Comments Finalized Successfully."); LoadGrid(); Rm_Appraisal_PAGE.SelectedIndex = 0; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_ApprAppraisal_latest", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// HERE I AM LOADING Goals DETAILS FROM PREVIOUS GOAL SETTING DETAILS TABLE /// </summary> protected void LoadGoal1() { try { _obj_Pms_Appraisalcycle = new PMS_Appraisalcycle(); _obj_Pms_Appraisalcycle.MODE = 11; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_ID = Convert.ToInt32(Session["empid1"]);//where i am passing employee to get bunit DataTable dtem = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (dtem.Rows.Count != 0) { _obj_Pms_Appraisalcycle.MODE = 8; _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(dtem.Rows[0]["EMP_BUSINESSUNIT_ID"]); DataTable dtappid = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle); if (dtappid.Rows.Count != 0) { rcmb_GoalType.Items.Clear(); SPMS_GOALSETTING _obj_Pms_GoalSetting = new SPMS_GOALSETTING(); _obj_Pms_GoalSetting.Mode = 10; _obj_Pms_GoalSetting.CREATEDBY = Convert.ToInt32(Session["ORG_ID"]); _obj_Pms_GoalSetting.GSDTL_ID = Convert.ToInt32(Session["empid1"]); //i am passing employee _obj_Pms_GoalSetting.BU_ID = Convert.ToInt32(dtappid.Rows[0]["APPRCYCLE_ID"]); //i am passing apprycle cycle value DataTable dt = Pms_Bll.get_GoalSetting(_obj_Pms_GoalSetting); if (dt.Rows.Count != 0) { rcmb_GoalType.DataSource = dt; rcmb_GoalType.DataTextField = "GSDTL_NAME"; rcmb_GoalType.DataValueField = "GSDTL_ID"; rcmb_GoalType.DataBind(); rcmb_GoalType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } else { DataTable dt44 = new DataTable(); rcmb_GoalType.DataSource = dt44; rcmb_GoalType.DataBind(); rcmb_GoalType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } else { Pms_Bll.ShowMessage(this, "Employee Is Not Under Active Appraisal"); DataTable dt44 = new DataTable(); rcmb_GoalType.DataSource = dt44; rcmb_GoalType.DataBind(); rcmb_GoalType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } else { Pms_Bll.ShowMessage(this, "Employee Is Inactive"); DataTable dt44 = new DataTable(); rcmb_GoalType.DataSource = dt44; rcmb_GoalType.DataBind(); rcmb_GoalType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } catch (Exception ex) { //Pms_Bll.ShowMessage(this, ex.Message.ToString()); //return; SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsTask", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }