protected void loadgrid_Kra() { try { _obj_Pms_goalkradetails = new GOALSETTING_GOALKRA_DETAILS(); _obj_Pms_goalkradetails.MODE = 6; DataTable dt = Pms_Bll.get_Gskra(_obj_Pms_goalkradetails); RG_KraDetails.DataSource = dt; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_GoalSettingKra", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Copy_Click(object sender, EventArgs e) { try { bool status = false; _obj_GS = new PMS_GoalSettings(); _obj_Pms_goalkradetails = new GOALSETTING_GOALKRA_DETAILS(); _obj_Pms_goalIDPdetails = new GOALSETTING_IDP_DETAILS(); _obj_GSdetails = new PMS_GoalSettings_Details(); int count = 0; for (int index = 0; index < Rg_CopyKRA.Items.Count; index++) { CheckBox chk = Rg_CopyKRA.Items[index].FindControl("chckbtn_Select") as CheckBox; if (chk.Checked) { count++; if (Rg_CopyKRA.Items[index]["A"].Text == "KRA") { _obj_Pms_goalkradetails.GS_KRA_KRA_ID = Convert.ToInt32(Rg_CopyKRA.Items[index]["ROLEKRA_ID"].Text); _obj_Pms_goalkradetails.APPCYCLE = Convert.ToInt32(rcmb_AppCycle.SelectedItem.Value); _obj_Pms_goalkradetails.BUID = Convert.ToInt32(Convert.ToString(Request.QueryString["APPCYCLE_ID"])); _obj_Pms_goalkradetails.EMP_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["EMP_ID"])); _obj_Pms_goalkradetails.MODE = 13; status = Pms_Bll.set_Gskra(_obj_Pms_goalkradetails); } else if (Rg_CopyKRA.Items[index]["A"].Text == "IDP") { _obj_Pms_goalIDPdetails.GS_IDP_IDP_ID = Convert.ToInt32(Rg_CopyKRA.Items[index]["ROLEKRA_ID"].Text); _obj_Pms_goalIDPdetails.APPCYCLE = Convert.ToInt32(rcmb_AppCycle.SelectedItem.Value); _obj_Pms_goalIDPdetails.BUID = Convert.ToInt32(Convert.ToString(Request.QueryString["APPCYCLE_ID"])); _obj_Pms_goalIDPdetails.EMP_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["EMP_ID"])); _obj_Pms_goalIDPdetails.MODE = 13; status = Pms_Bll.set_GsIDP(_obj_Pms_goalIDPdetails); } else { _obj_GSdetails.GSDTL_ID = Convert.ToInt32(Rg_CopyKRA.Items[index]["ROLEKRA_ID"].Text); _obj_GSdetails.APPCYCLE = Convert.ToInt32(rcmb_AppCycle.SelectedItem.Value); _obj_GSdetails.BUID = Convert.ToInt32(Convert.ToString(Request.QueryString["APPCYCLE_ID"])); _obj_GSdetails.EMP_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["EMP_ID"])); _obj_GSdetails.GS_DETAILS_MODE = 15; status = Pms_Bll.set_GSdetails(_obj_GSdetails); } } } if (count == 0) { BLL.ShowMessage(this, "Please Select Atleast one KRA to Copy"); return; } if (status) { LoadGrid(); Rg_CopyKRA.DataBind(); if (Rg_CopyKRA.Items.Count == 0) { btn_Copy.Visible = false; } else { btn_Copy.Visible = true; } BLL.ShowMessage(this, "Selected KRAs Copied Successfully."); //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), Guid.NewGuid().ToString(), "refreshOpener();", true); return; } } 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"); } }