private void LoadEmployee()
 {
     try
     {
         SMHR_PENSION_CONTRIBUTION objPensionContribution = new SMHR_PENSION_CONTRIBUTION();
         objPensionContribution.OPERATION                = operation.Employee;
         objPensionContribution.ORGANISATION_ID          = Convert.ToInt32(Session["ORG_ID"]);
         objPensionContribution.BUID                     = Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value);
         objPensionContribution.PENSION_SALALRYSTRUCT_ID = Convert.ToInt32(rcmb_SalStruct.SelectedValue);
         //_obj_Smhr_BusinessUnit.lOANREQUEST_EMPLOYEEID = Convert.ToInt32(Session["USER_ID"]);
         rcmb_EmployeeName.Items.Clear();
         DataTable dtEMP = BLL.get_PensionContribution(objPensionContribution);
         rcmb_EmployeeName.DataSource     = dtEMP;
         rcmb_EmployeeName.DataTextField  = "employeename";
         rcmb_EmployeeName.DataValueField = "emp_id";
         rcmb_EmployeeName.DataBind();
         if (dtEMP.Rows.Count > 0)
         {
             rcmb_EmployeeName.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("ALL", "-1"));
         }
         else
         {
             rcmb_EmployeeName.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
         }
         //rcmb_EmployeeName.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
         //rcmb_EmployeeName.Enabled = false;
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "PensionStatement", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
    protected void lnk_Edit_Command(object sender, CommandEventArgs e)
    {
        try
        {
            btn_Save.Visible         = false;
            btn_Update.Visible       = true;
            Rm_CY_page.SelectedIndex = 1;
            LoadEmployeeTypes();

            SMHR_PENSION_CONTRIBUTION objPensionContribution = new SMHR_PENSION_CONTRIBUTION();
            objPensionContribution.PENSION_CONTRIBUTION_ID = Convert.ToInt32(e.CommandArgument);
            hdnPensionCntID.Value            = Convert.ToString(e.CommandArgument);
            objPensionContribution.OPERATION = operation.Edit;
            DataTable dtPensionContribution = BLL.get_PensionContribution(objPensionContribution);
            if (dtPensionContribution.Rows.Count > 0)
            {
                rcmb_EmployeeType.SelectedIndex = rcmb_EmployeeType.FindItemIndexByValue(Convert.ToString(dtPensionContribution.Rows[0]["PENSION_EMPTYPE"]));
                rcmb_EmployeeType.Enabled       = false;
                rtxt_EmployeeValue.Value        = Convert.ToDouble(dtPensionContribution.Rows[0]["PENSION_EMPLOYEE_VALUE"]);
                rtxt_EmployerValue.Value        = Convert.ToDouble(dtPensionContribution.Rows[0]["PENSION_EMPLOYER_VALUE"]);
            }
            else
            {
                rcmb_EmployeeType.ClearSelection();
                rcmb_EmployeeType.Enabled = false;
                rtxt_EmployeeValue.Value  = null;
                rtxt_EmployerValue.Value  = null;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PensionContribution", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
 private void LoadDates()
 {
     try
     {
         SMHR_PENSION_CONTRIBUTION objPensionContribution = new SMHR_PENSION_CONTRIBUTION();
         objPensionContribution.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         objPensionContribution.OPERATION       = operation.Select;
         DataTable dtdates = BLL.get_PensionContribution(objPensionContribution);
         ViewState["Dates"] = dtdates;
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "PensionStatement", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
 private void LoadGrid()
 {
     try
     {
         SMHR_PENSION_CONTRIBUTION objPensionContribution = new SMHR_PENSION_CONTRIBUTION();
         objPensionContribution.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         objPensionContribution.OPERATION       = operation.Get;
         DataTable dtPensionCont = new DataTable();
         dtPensionCont = BLL.get_PensionContribution(objPensionContribution);
         Rg_PensionContribution.DataSource = dtPensionCont;
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PensionContribution", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            SMHR_PENSION_CONTRIBUTION objPensionContribution = new SMHR_PENSION_CONTRIBUTION();

            objPensionContribution.PENSION_EMPTYPE_ID     = Convert.ToInt32(rcmb_EmployeeType.SelectedValue);
            objPensionContribution.PENSION_EMPTYPE        = rcmb_EmployeeType.SelectedItem.Text;
            objPensionContribution.PENSION_EMPLOYEE_VALUE = Convert.ToDouble(rtxt_EmployeeValue.Value);
            objPensionContribution.PENSION_EMPLOYER_VALUE = Convert.ToDouble(rtxt_EmployerValue.Value);
            objPensionContribution.ORGANISATION_ID        = Convert.ToInt32(Session["ORG_ID"]);

            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_UPDATE":
                objPensionContribution.PENSION_CONTRIBUTION_ID = Convert.ToInt32(hdnPensionCntID.Value);
                objPensionContribution.LASTMDFDATE             = DateTime.Now;
                objPensionContribution.LASTMDFBY = Convert.ToInt32(Session["USER_ID"]);
                objPensionContribution.OPERATION = operation.Update;
                //if (BLL.set_PensionScheme(objPensionContribution))
                if (BLL.set_PensionContribution(objPensionContribution))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Updated");
                }
                break;

            case "BTN_SAVE":
                objPensionContribution.OPERATION = operation.Check;

                DataTable dt = BLL.get_PensionContribution(objPensionContribution);
                if (dt.Rows.Count > 0)
                {
                    BLL.ShowMessage(this, "A Record For Selected Employee Type Already Exists.");
                    return;
                }

                objPensionContribution.CREATEDDATE = DateTime.Now;
                objPensionContribution.CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                objPensionContribution.OPERATION   = operation.Insert;

                if (BLL.set_PensionContribution(objPensionContribution))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;

            default:
                break;
            }
            Rm_CY_page.SelectedIndex = 0;
            LoadGrid();
            Rg_PensionContribution.DataBind();

            clearControls();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PensionContribution", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }