/// <summary> /// Here BindEmployees() for EmployeeName Combobox.. /// </summary> /// <param name="dt"></param> protected void BindEmployees(DataTable dt) { try { RCB_EmployeeName.Items.Clear(); RCB_EmployeeName.DataSource = dt; RCB_EmployeeName.DataTextField = "Empname"; RCB_EmployeeName.DataValueField = "EMP_ID"; RCB_EmployeeName.DataBind(); RCB_EmployeeName.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_idp", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// Here Edit a Particular Record.. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lnk_Edit_Commnad(object sender, CommandEventArgs e) { try { clearfields(); _obj_idp = new pms_IDPSCREEN(); _obj_idp.IDP_MODE = 2; _obj_idp.IDP_ID = Convert.ToInt32(e.CommandArgument); DataTable DT = Pms_Bll.get_idp(_obj_idp); if (DT.Rows.Count != 0) { lbl_id.Text = Convert.ToString(DT.Rows[0]["IDP_ID"]); Session["empid1"] = (DT.Rows[0]["IDP_EMP_ID"]); _obj_idp = new pms_IDPSCREEN(); _obj_idp.IDP_MODE = 6; _obj_idp.IDP_EMP_ID = Convert.ToInt32(Convert.ToString(DT.Rows[0]["IDP_EMP_ID"])); _obj_idp.IDP_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_Bus = Pms_Bll.get_idp(_obj_idp); loadBusinessUnit(); if (dt_Bus.Rows.Count != 0) { RCB_BusinessUnit.SelectedIndex = RCB_BusinessUnit.Items.FindItemIndexByValue(Convert.ToString(dt_Bus.Rows[0]["EMP_BUSINESSUNIT_ID"])); } //LoadEmployees(); _obj_Pms_EmpSetup = new PMS_EMPSETUP(); _obj_PMS_getemployee = new PMS_GETEMPLOYEE(); if ((Convert.ToString(Session["EMP_TYPE"])) == "5") { _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } else { _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } _obj_PMS_getemployee.LASTMDFBY = Convert.ToInt32(Session["ORG_ID"]); _obj_PMS_getemployee.BU_ID = Convert.ToInt32(RCB_BusinessUnit.SelectedItem.Value); _obj_PMS_getemployee.Mode = 5; DataTable dtbuid = Pms_Bll.get_RMEmployees(_obj_PMS_getemployee); if (dtbuid.Rows.Count != 0) { RCB_EmployeeName.DataSource = dtbuid; RCB_EmployeeName.DataTextField = "employee"; RCB_EmployeeName.DataValueField = "EMPID"; RCB_EmployeeName.DataBind(); RCB_EmployeeName.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); //RCB_BusinessUnit.Visible = false; //lbl_BusinessUnit.Visible = false; } else { DataTable dt1 = new DataTable(); RCB_EmployeeName.DataSource = dt1; RCB_EmployeeName.DataBind(); //lbl_BusinessUnit.Visible = false; //RCB_BusinessUnit.Visible = false; } RCB_EmployeeName.SelectedIndex = RCB_EmployeeName.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["IDP_EMP_ID"])); //LoadAppraisalCycle1(); //rcm_apprcycle.SelectedIndex = rcm_apprcycle.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["IDP_APPRAISALCYCLE"])); txt_IDP.Text = Pms_Bll.ReplaceQuote(Convert.ToString(DT.Rows[0]["IDP_NAME"])); txt_Description.Text = Pms_Bll.ReplaceQuote(Convert.ToString(DT.Rows[0]["IDP_DESCRIPTION"])); RDP_StartDate.SelectedDate = Convert.ToDateTime(DT.Rows[0]["IDP_STARTDATE"]); //RDP_EndDate.SelectedDate = Convert.ToDateTime(DT.Rows[0]["IDP_ENDDATE"]); txt_Comments.Text = Convert.ToString(DT.Rows[0]["IDP_COMMENTS"]); if (DT.Rows[0]["IDP_STATUS"] != System.DBNull.Value) { if (Convert.ToString(DT.Rows[0]["IDP_STATUS"]).Trim() == "Active") { rcmb_status.SelectedValue = "1"; } else { rcmb_status.SelectedValue = "0"; } } else { rcmb_status.SelectedValue = "0"; } RM_Idpform.SelectedIndex = 1; RP_Idpform.Visible = false; RP_Idpform2.Visible = true; btn_SAVE.Visible = false; btn_UPDATE.Visible = true; RCB_BusinessUnit.Enabled = false; RCB_EmployeeName.Enabled = false; txt_IDP.Enabled = false; //lbl_BusinessUnit.Visible = false; //RCB_BusinessUnit.Visible = false; txt_Comments.Enabled = true; RDP_StartDate.Enabled = false; //RDP_EndDate.Enabled = true; //rcm_apprcycle.Enabled = false; if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_UPDATE.Visible = false; } else { btn_UPDATE.Visible = true; if (rcmb_status.SelectedValue == "0") { BLL.ShowMessage(this, "IDP is Inactive.You can not Update the record."); btn_UPDATE.Visible = false; } } } else { } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_idp", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// Here RCB_BusinessUnit_SelectedIndexChanged for Getting Business Unit From SMHR... /// </summary> /// <param name="o"></param> /// <param name="e"></param> protected void RCB_BusinessUnit_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { try { //LoadEmployees(); if (RCB_BusinessUnit.SelectedIndex > 0) { _obj_Pms_EmpSetup = new PMS_EMPSETUP(); _obj_PMS_getemployee = new PMS_GETEMPLOYEE(); if ((Convert.ToString(Session["EMP_TYPE"])) == "5") { _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } else { _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } _obj_PMS_getemployee.BU_ID = Convert.ToInt32(RCB_BusinessUnit.SelectedItem.Value); _obj_PMS_getemployee.LASTMDFBY = Convert.ToInt32(Session["ORG_ID"]); _obj_PMS_getemployee.Mode = 4; DataTable dtbuid = Pms_Bll.get_RMEmployees(_obj_PMS_getemployee); if (dtbuid.Rows.Count != 0) { RCB_EmployeeName.DataSource = dtbuid; RCB_EmployeeName.DataTextField = "employee"; RCB_EmployeeName.DataValueField = "EMPID"; RCB_EmployeeName.DataBind(); RCB_EmployeeName.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); //RCB_BusinessUnit.Visible = false; //lbl_BusinessUnit.Visible = false; } else { DataTable dt1 = new DataTable(); RCB_EmployeeName.DataSource = dt1; RCB_EmployeeName.DataBind(); //lbl_BusinessUnit.Visible = false; //RCB_BusinessUnit.Visible = false; } //LoadAppraisalCycle(); } else { RCB_EmployeeName.ClearSelection(); RCB_EmployeeName.Items.Clear(); RCB_EmployeeName.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); //rcm_apprcycle.ClearSelection(); //rcm_apprcycle.Items.Clear(); //rcm_apprcycle.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_idp", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }