private void LoadGrid() { try { _obj_GS = new PMS_GoalSettings(); _obj_GS.GS_MODE = 31; _obj_GS.EMPID = Convert.ToInt32(rcmb_RpMgr.SelectedItem.Value); _obj_GS.GS_APPRAISAL_CYCLE = Convert.ToString(rtxt_AppraisalCycle.SelectedItem.Value);//Convert.ToInt32(dtappidzzR.Rows[0]["APPRCYCLE_ID"]); _obj_GS.GS_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_EMP = Pms_Bll.get_GS(_obj_GS); if (dt_EMP.Rows.Count > 0) { RG_ApprAppraisal.DataSource = dt_EMP; RG_ApprAppraisal.DataBind(); } else { DataTable dt = new DataTable(); RG_ApprAppraisal.DataSource = dt; RG_ApprAppraisal.DataBind(); } for (int index = 0; index < RG_ApprAppraisal.Items.Count; index++) { CheckBox chk = RG_ApprAppraisal.Items[index].FindControl("chckbtn_Select") as CheckBox; chk.Checked = false; } if (RG_ApprAppraisal.Items.Count == 0) { tr_btns.Visible = false; BLL.ShowMessage(this, "No records to Display."); return; } else { tr_btns.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_GsApproval", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadGrid() { try { DataTable dt_EMP = new DataTable(); ViewState["Status"] = 0; PMS_EMPSETUP _obj_Pms_EmpSetup; _obj_Pms_EmpSetup = new PMS_EMPSETUP(); //_obj_Pms_EmpSetup.Mode = 19; _obj_Pms_EmpSetup.EMP_ID = Convert.ToInt32(rcmb_RpMgr.SelectedItem.Value); //_obj_Pms_EmpSetup.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); _obj_Pms_EmpSetup.GSLIFECYCLE = Convert.ToInt32(rtxt_AppraisalCycle.SelectedItem.Value);//Convert.ToInt32(dtappidzzR.Rows[0]["APPRCYCLE_ID"]); _obj_Pms_EmpSetup.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); //DataTable dt_EMP = Pms_Bll.get_EmpSetup(_obj_Pms_EmpSetup); int logEmpID = Convert.ToInt32(Session["EMP_ID"]); DataTable dtAppProcessEmpData = BLL.get_PMS_APPROVAL_PROCESS_BY_ORG_ID(Convert.ToInt32(Session["ORG_ID"]), Convert.ToInt32(rcmb_BU.SelectedValue)); if (dtAppProcessEmpData.Rows.Count > 0) { if (logEmpID == Convert.ToInt32(dtAppProcessEmpData.Rows[0]["PMS_APPROVAL_PROCESS_EMP_ID_1"])) { //_obj_Pms_EmpSetup.Mode = 1; _obj_Pms_EmpSetup.Mode = 23; } 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_EmpSetup.Mode = 24; } else if (logEmpID == Convert.ToInt32(dtAppProcessEmpData.Rows[0]["PMS_APPROVAL_PROCESS_EMP_ID_3"])) { _obj_Pms_EmpSetup.Mode = 25; } else { //status = 1; _obj_Pms_EmpSetup.Mode = 0; } } else { status = 2; } dt_EMP = BLL.Load_Pms_Approver_Appraisal_Grid(_obj_Pms_EmpSetup); //dt_EMP = Pms_Bll.get_EmpSetup(_obj_Pms_EmpSetup); if (dt_EMP.Rows.Count > 0) { RG_ApprAppraisal.DataSource = dt_EMP; RG_ApprAppraisal.DataBind(); } else { DataTable dt = new DataTable(); RG_ApprAppraisal.DataSource = dt; RG_ApprAppraisal.DataBind(); } int count = 0; for (int index = 0; index < RG_ApprAppraisal.Items.Count; index++) { CheckBox chk = RG_ApprAppraisal.Items[index].FindControl("chckbtn_Select") as CheckBox; if (Convert.ToString(dt_EMP.Rows[index]["APPRAISAL_STATUS"]) == "1" || Convert.ToString(dt_EMP.Rows[index]["APPRAISAL_STATUS"]) == "2" || Convert.ToString(dt_EMP.Rows[index]["APPRAISAL_STATUS"]) == "3") { chk.Enabled = true; } else { chk.Enabled = false; count++; } chk.Checked = false; } if (count == RG_ApprAppraisal.Items.Count) { if (RG_ApprAppraisal.Items.Count == 0) { ViewState["Status"] = 2; } else { ViewState["Status"] = 1; } tr_comments.Visible = false; tr_btns.Visible = false; rtxt_comments.Text = string.Empty; } else { tr_comments.Visible = true; tr_btns.Visible = true; rtxt_comments.Text = string.Empty; } } 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"); } }