示例#1
0
 protected void rcmb_Bank_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
 {
     try
     {
         if (rcmb_Bank.SelectedIndex > 0)
         {
             rcmb_Branch.Items.Clear();
             _obj_Smhr_Masters = new SMHR_MASTERS();
             //_obj_Smhr_Masters.MASTER_TYPE = "BANK";
             _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
             _obj_Smhr_Masters.OPERATION       = operation.Get_ID;
             _obj_Smhr_Masters.BANKID          = Convert.ToInt32(rcmb_Bank.SelectedValue);
             DataTable dt_Details = new DataTable();
             dt_Details                 = BLL.get_MasterRecords(_obj_Smhr_Masters);
             rcmb_Branch.DataSource     = dt_Details;
             rcmb_Branch.DataTextField  = "BRANCH";
             rcmb_Branch.DataValueField = "BRANCH_ID";
             rcmb_Branch.DataBind();
             rcmb_Branch.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("All", "-1"));
         }
         else
         {
             rcmb_Branch.Items.Clear();
             rcmb_Branch.Text = string.Empty;
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeDueIncrement", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
示例#2
0
    private void LoadCombos()
    {
        try
        {
            obj_smhr_Logininfo                 = new SMHR_LOGININFO();
            obj_smhr_Logininfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"]);
            obj_smhr_Logininfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt_BUDetails = BLL.get_Business_Units(obj_smhr_Logininfo);
            ddl_BusinessUnit.DataSource     = dt_BUDetails;
            ddl_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
            ddl_BusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
            ddl_BusinessUnit.DataBind();
            ddl_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select"));

            ddl_Skill.Items.Clear();
            _obj_Masters                 = new SMHR_MASTERS();
            _obj_Masters.MASTER_TYPE     = "SKILL";
            _obj_Masters.OPERATION       = operation.Select;
            _obj_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt_Details = BLL.get_MasterRecords(_obj_Masters);
            ddl_Skill.DataSource     = dt_Details;
            ddl_Skill.DataTextField  = "HR_MASTER_CODE";
            ddl_Skill.DataValueField = "HR_MASTER_ID";
            ddl_Skill.DataBind();
            ddl_Skill.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("ALL"));
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Employee_Skill_Report", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
示例#3
0
 protected void LoadBank()
 {
     try
     {
         rcmb_Bank.Items.Clear();
         rcmb_Branch.Items.Clear();
         _obj_Smhr_Masters = new SMHR_MASTERS();
         //_obj_Smhr_Masters.MASTER_TYPE = "BANK";
         _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         _obj_Smhr_Masters.OPERATION       = operation.Select4;
         DataTable dt_Details = new DataTable();
         dt_Details               = BLL.get_MasterRecords(_obj_Smhr_Masters);
         rcmb_Bank.DataSource     = dt_Details;
         rcmb_Bank.DataTextField  = "NAME";
         rcmb_Bank.DataValueField = "HR_MASTER_ID";
         rcmb_Bank.DataBind();
         rcmb_Bank.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("All", "-1"));
         rcmb_Branch.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("All", "-1"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeDueIncrement", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
示例#4
0
    private void LoadCombos()
    {
        try
        {
            rcb_Skill.Items.Clear();
            _obj_smhr_masters                 = new SMHR_MASTERS();
            _obj_smhr_masters.MASTER_TYPE     = "SKILL";
            _obj_smhr_masters.OPERATION       = operation.Select;
            _obj_smhr_masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt_Details = BLL.get_MasterRecords(_obj_smhr_masters);
            rcb_Skill.DataSource     = dt_Details;
            rcb_Skill.DataTextField  = "HR_MASTER_CODE";
            rcb_Skill.DataValueField = "HR_MASTER_ID";
            rcb_Skill.DataBind();
            rcb_Skill.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select"));

            DataTable dt = BLL.get_Year(1);
            rcb_YearLastUsed.DataSource     = dt;
            rcb_YearLastUsed.DataValueField = "SMHR_YEAR_ID";
            rcb_YearLastUsed.DataTextField  = "SMHR_YEAR";
            rcb_YearLastUsed.DataBind();
            rcb_YearLastUsed.Items.Insert(0, new RadComboBoxItem("Select"));
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Skills", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
示例#5
0
    private void LoadCombos()
    {
        try
        {
            _obj_Smhr_Masters = new SMHR_MASTERS();
            //Load PayItem Type
            rcmb_PayItemType.Items.Clear();
            _obj_Smhr_Masters.MASTER_TYPE     = "PAYITEMTYPE";
            _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            rcmb_PayItemType.DataSource       = BLL.get_MasterRecords(_obj_Smhr_Masters);
            rcmb_PayItemType.DataTextField    = "HR_MASTER_CODE";
            rcmb_PayItemType.DataValueField   = "HR_MASTER_ID";
            rcmb_PayItemType.DataBind();
            rcmb_PayItemType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));

            //Load PayItem Mode
            rcmb_PayItemMode.Items.Clear();
            _obj_Smhr_Masters.MASTER_TYPE     = "PAYITEMMODE";
            _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            rcmb_PayItemMode.DataSource       = BLL.get_MasterRecords(_obj_Smhr_Masters);
            rcmb_PayItemMode.DataTextField    = "HR_MASTER_CODE";
            rcmb_PayItemMode.DataValueField   = "HR_MASTER_ID";
            rcmb_PayItemMode.DataBind();
            rcmb_PayItemMode.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
            rcmb_PayItemMode.SelectedIndex = 0;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayItemDefine", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
示例#6
0
    //public void load_Localisation_Id()
    //{
    //    try
    //    {
    //        _obj_smhr_Tds = new SMHR_TDS();
    //        _obj_smhr_Tds.TDS_BUSINESSUNIT = Convert.ToInt32(rcmb_BusinessUnit.SelectedValue);
    //        _obj_smhr_Tds.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
    //        _obj_smhr_Tds.OPERATION = operation.Check;
    //        DataTable dt_LocalisationID = BLL.get_Tds(_obj_smhr_Tds);
    //        Session["TDS_LOCALISATION_ID"] = Convert.ToInt32(dt_LocalisationID.Rows[0][0]);
    //    }
    //    catch (Exception ex)
    //    {
    //        SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TdsSlab", ex.StackTrace, DateTime.Now);
    //        Response.Redirect("~/Frm_ErrorPage.aspx");
    //    }
    //}
    protected void rcmb_tdsname_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        try
        {
            _obj_smhr_Tds_Slab                 = new SMHR_TDS_SLAB();
            _obj_smhr_Tds_Slab.OPERATION       = operation.Check;
            _obj_smhr_Tds_Slab.TDS_SLAB_TDS_ID = Convert.ToInt32(rcmb_tdsname.SelectedItem.Value);
            _obj_smhr_Tds_Slab.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            //_obj_smhr_Tds_Slab.TDS_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt_Tds_Id = BLL.get_TdsSlab(_obj_smhr_Tds_Slab);
            if (dt_Tds_Id.Rows.Count > 0)
            {
                Session["TDS_BU_ID"]           = Convert.ToInt32(dt_Tds_Id.Rows[0]["TDS_BUSINESSUNIT_ID"]);
                Session["TDS_LOCALISATION_ID"] = Convert.ToInt32(dt_Tds_Id.Rows[0]["TDS_LOCALISATION_ID"]);
                //load_Localisation_Id();

                _obj_smhr_master                 = new SMHR_MASTERS();
                _obj_smhr_master.OPERATION       = operation.Select;
                _obj_smhr_master.MASTER_TYPE     = "AUSRESIDENCYTYPE";
                _obj_smhr_master.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                DataTable dtlocal = BLL.get_MasterRecords(_obj_smhr_master);
                _obj_smhr_master.MASTER_TYPE = "LOCALISATION";
                _obj_smhr_master.MASTER_ID   = Convert.ToInt32(dt_Tds_Id.Rows[0]["TDS_LOCALISATION_ID"]);
                DataTable dtlocalName = BLL.get_MasterRecords(_obj_smhr_master);
                if (dtlocalName.Rows.Count > 0)
                {
                    if (Convert.ToString(dtlocalName.Rows[0]["HR_MASTER_CODE"]).ToUpper() == "AUSTRALIA")
                    {
                        trRcmbSlab.Visible = true;
                        trTxtSlab.Visible  = false;
                        rcmbSlab.Enabled   = true;
                        if (dtlocal.Rows.Count > 0)
                        {
                            rcmbSlab.DataSource     = dtlocal;
                            rcmbSlab.DataTextField  = "HR_MASTER_CODE";
                            rcmbSlab.DataValueField = "HR_MASTER_ID";
                            rcmbSlab.DataBind();
                            rcmbSlab.Items.Insert(0, new RadComboBoxItem("Select", "0"));
                        }
                    }
                    else
                    {
                        trTxtSlab.Visible  = true;
                        trRcmbSlab.Visible = false;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TdsSlab", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
 protected void LoadGrid()
 {
     try
     {
         _obj_Smhr_Masters                 = new SMHR_MASTERS();
         _obj_Smhr_Masters.MASTER_TYPE     = control.ToUpper();
         _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
         RG_Master.DataSource              = BLL.get_MasterRecords(_obj_Smhr_Masters);
         rm_MR_Page.SelectedIndex          = 0;
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Master", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
示例#8
0
 private void BindQualification()
 {
     try
     {
         SMHR_MASTERS _obj_Smhr_Masters = new SMHR_MASTERS();
         _obj_Smhr_Masters.MASTER_TYPE     = "QUALIFICATION";
         _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
         rc_Qualification.DataSource       = BLL.get_MasterRecords(_obj_Smhr_Masters);
         rc_Qualification.DataValueField   = "HR_MASTER_ID";
         rc_Qualification.DataTextField    = "HR_MASTER_CODE";
         rc_Qualification.DataBind();
         rc_Qualification.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "-1"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "TrainerProfile", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
示例#9
0
 protected void LoadProtectiveUniforms()
 {
     try
     {
         _obj_Smhr_Masters                 = new SMHR_MASTERS();
         _obj_Smhr_Masters.MASTER_TYPE     = "PROTECTIVEUNIFORM";
         _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
         rcmb_UniformName.DataSource       = BLL.get_MasterRecords(_obj_Smhr_Masters);
         rcmb_UniformName.DataTextField    = "HR_MASTER_CODE";
         rcmb_UniformName.DataValueField   = "HR_MASTER_ID";
         rcmb_UniformName.DataBind();
         rcmb_UniformName.Items.Insert(0, new RadComboBoxItem("Select"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Activity", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
示例#10
0
    protected void lnk_MasterEdit_Command(object sender, CommandEventArgs e)
    {
        try
        {
            lbl_Master_ID.Text                = Convert.ToString(e.CommandArgument);
            _obj_Smhr_Masters                 = new SMHR_MASTERS();
            _obj_Smhr_Masters.MASTER_ID       = Convert.ToInt32(lbl_Master_ID.Text);
            _obj_Smhr_Masters.MASTER_TYPE     = control.ToUpper();
            _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            dt = BLL.get_MasterRecords(_obj_Smhr_Masters);

            rtxt_MasterCode.Text = Convert.ToString(dt.Rows[0]["HR_MASTER_CODE"]);
            rtxt_MasterDesc.Text = Convert.ToString(dt.Rows[0]["HR_MASTER_DESC"]);

            btn_Save.Visible = false;

            //code for security
            if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
            {
                btn_Edit.Visible = false;
            }

            else
            {
                btn_Edit.Visible = true;
            }

            rm_MR_Page.SelectedIndex = 1;
            if (Convert.ToString(control) == "BANK")
            {
                rtxt_MasterCode.Enabled = true;
            }
            else
            {
                rtxt_MasterCode.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Master", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
示例#11
0
 private void Loadskills()
 {
     try
     {
         _obj_Smhr_Masters             = new SMHR_MASTERS();
         _obj_Smhr_Masters.MASTER_TYPE = "SKILL";
         _obj_Smhr_Masters.OPERATION   = operation.Select;
         DataTable dt_skills = BLL.get_MasterRecords(_obj_Smhr_Masters);
         RCB_Skills.DataSource     = dt_skills;
         RCB_Skills.DataTextField  = "HR_MASTER_CODE";
         RCB_Skills.DataValueField = "HR_MASTER_ID";
         RCB_Skills.DataBind();
         RCB_Skills.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_skill", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
示例#12
0
 protected void LoadTribe()
 {
     try
     {
         _obj_Smhr_Masters                 = new SMHR_MASTERS();
         _obj_Smhr_Masters.OPERATION       = operation.Chk;
         _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         //DataTable dt_Details = new DataTable();
         DataTable dt_Details = BLL.get_MasterRecords(_obj_Smhr_Masters);
         rcmb_Tribe.DataSource     = dt_Details;
         rcmb_Tribe.DataTextField  = "HR_MASTER_CODE";
         rcmb_Tribe.DataValueField = "HR_MASTER_ID";
         rcmb_Tribe.DataBind();
         rcmb_Tribe.Items.Insert(0, new RadComboBoxItem("ALL"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeList", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
    //private void LoadPeriodElements()
    //{
    //    SMHR_PERIODDTL obj_smhr_Perioddtl = new SMHR_PERIODDTL();
    //    obj_smhr_Perioddtl.OPERATION = operation.Select;
    //    DataTable dt_Details = BLL.get_PeriodDetails(obj_smhr_Perioddtl);
    //    if (dt_Details.Rows.Count != 0)
    //    {
    //        rcmb_PeriodElements.DataSource = dt_Details;
    //        rcmb_PeriodElements.DataValueField = "PRDDTL_ID";
    //        rcmb_PeriodElements.DataTextField = "PRDDTL_NAME";
    //        rcmb_PeriodElements.DataBind();
    //        rcmb_PeriodElements.Items.Insert(0, new RadComboBoxItem("Select"));
    //    }
    //}

    private void LoadGrade()
    {
        try
        {
            obj_smhr_Masters                 = new SMHR_MASTERS();
            obj_smhr_Masters.MASTER_TYPE     = "GRADE";
            obj_smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            rcmb_Grade.Items.Clear();
            DataTable dt_HR_MasterGrade = BLL.get_MasterRecords(obj_smhr_Masters);
            rcmb_Grade.DataSource     = dt_HR_MasterGrade;
            rcmb_Grade.DataTextField  = "HR_MASTER_CODE";
            rcmb_Grade.DataValueField = "HR_MASTER_ID";
            rcmb_Grade.DataBind();
            rcmb_Grade.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "-1"));
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "IncrementReport", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
 protected void LoadNoDueGrid()
 {
     try
     {
         _obj_Smhr_Masters                 = new SMHR_MASTERS();
         _obj_Smhr_Masters.OPERATION       = operation.Select;
         _obj_Smhr_Masters.MASTER_TYPE     = "NODUE";
         _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         DataTable dt1 = BLL.get_MasterRecords(_obj_Smhr_Masters);
         if (dt1.Rows.Count != 0)
         {
             Rg_VNoDues.DataSource = dt1;
             Rg_VNoDues.DataBind();
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Relieving", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
 private void LoadSettlement()
 {
     try
     {
         SMHR_MASTERS objMaster = new SMHR_MASTERS();
         objMaster.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         objMaster.MASTER_TYPE     = "SETTLEMENT";
         objMaster.MODE            = 3;
         DataTable dtSettlemts = BLL.get_MasterRecords(objMaster);
         rcmb_SettlementType.DataSource     = dtSettlemts;
         rcmb_SettlementType.DataValueField = "HR_MASTER_ID";
         rcmb_SettlementType.DataTextField  = "HR_MASTER_CODE";
         rcmb_SettlementType.DataBind();
         rcmb_SettlementType.Items.Insert(0, new RadComboBoxItem("Select", "0"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PensionFFS", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
示例#16
0
 private void BindServiceProviderTypes()
 {
     try
     {
         SMHR_MASTERS _obj_smhr_masters = new SMHR_MASTERS();
         _obj_smhr_masters.OPERATION       = operation.Select;
         _obj_smhr_masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         _obj_smhr_masters.MASTER_TYPE     = "SERVICEPROVIDERTYPE";
         DataTable dt = BLL.get_MasterRecords(_obj_smhr_masters);
         radServiceProviderType.DataSource     = dt;
         radServiceProviderType.DataTextField  = "HR_MASTER_CODE";
         radServiceProviderType.DataValueField = "HR_MASTER_ID";
         radServiceProviderType.DataBind();
         radServiceProviderType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "-1"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_ServiceProviders", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
 public void loadstatus()
 {
     try
     {
         Rcm_status.Items.Clear();
         SMHR_MASTERS _obj_smhr_masters = new SMHR_MASTERS();
         _obj_smhr_masters.MASTER_TYPE     = "STATUS";
         _obj_smhr_masters.OPERATION       = operation.Select;
         _obj_smhr_masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         DataTable dt_Details = BLL.get_MasterRecords(_obj_smhr_masters);//as it is c data done nothing
         Rcm_status.DataSource     = dt_Details;
         Rcm_status.DataTextField  = "HR_MASTER_CODE";
         Rcm_status.DataValueField = "HR_MASTER_ID";
         Rcm_status.DataBind();
         Rcm_status.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Directorate", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
示例#18
0
    private void LoadSkill()
    {
        try
        {
            DataTable dtDetails = new DataTable();

            _obj_Smhr_Masters           = new SMHR_MASTERS();
            _obj_Smhr_Masters.MODE      = 1;
            _obj_Smhr_Masters.MASTER_ID = Convert.ToInt32(lbl_Skill.Text);
            dtDetails = BLL.get_MasterRecords(_obj_Smhr_Masters);

            if (dtDetails.Rows.Count != 0)
            {
                RG_Skills1.DataSource = dtDetails;
                RG_Skills1.DataBind();
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_InterviewAssesment", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
 protected void LoadGrade()
 {
     try
     {
         _obj_Smhr_Masters = new SMHR_MASTERS();
         _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
         _obj_Smhr_Masters.OPERATION       = operation.Select;
         //  _obj_Smhr_Masters.MASTER_TYPE = "GRADESET";
         _obj_Smhr_Masters.MASTER_TYPE = "INTERVIEW ROUNDS";
         DataTable dt_Details = BLL.get_MasterRecords(_obj_Smhr_Masters);
         RCMB_Type.DataSource     = dt_Details;
         RCMB_Type.DataTextField  = "HR_MASTER_CODE";
         RCMB_Type.DataValueField = "HR_MASTER_ID";
         RCMB_Type.DataBind();
         RCMB_Type.Items.Insert(0, new RadComboBoxItem("Select", "0"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_applicantgrade", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
         return;
     }
 }
示例#20
0
 private void LoadCombos()
 {
     try
     {
         SMHR_BUSINESSUNIT _obj_smhr_businessunit = new SMHR_BUSINESSUNIT();
         SMHR_MASTERS      _obj_Smhr_Masters      = new SMHR_MASTERS();
         //Course Category
         rcmb_CC.Items.Clear();
         _obj_Smhr_Masters.MASTER_TYPE     = "COURSE";
         _obj_Smhr_Masters.OPERATION       = operation.Select1;
         _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         rcmb_CC.DataSource     = BLL.get_MasterRecords(_obj_Smhr_Masters);
         rcmb_CC.DataTextField  = "HR_MASTER_CODE";
         rcmb_CC.DataValueField = "HR_MASTER_ID";
         rcmb_CC.DataBind();
         rcmb_CC.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_TrainingFeedBack", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
示例#21
0
    private void LoadCombos()
    {
        try
        {
            SMHR_COURSE _obj_Course = new SMHR_COURSE();
            _obj_Course.OPERATION     = operation.Select2;
            _obj_Course.COURSE_ORG_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); //Convert.ToInt32(Session["ORG_ID"]);
            radCourse.DataSource      = BLL.get_Course(_obj_Course);
            radCourse.DataTextField   = "COURSE_NAME";
            radCourse.DataValueField  = "COURSE_ID";
            radCourse.DataBind();
            radCourse.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));

            _obj_Smhr_Masters                 = new SMHR_MASTERS();
            _obj_Smhr_Masters.MASTER_TYPE     = "COURSETYPE";
            _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
            radCourseType.DataSource          = BLL.get_MasterRecords(_obj_Smhr_Masters);
            radCourseType.DataTextField       = "HR_MASTER_CODE";
            radCourseType.DataValueField      = "HR_MASTER_ID";
            radCourseType.DataBind();
            radCourseType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));

            _obj_Smhr_Location = new SMHR_TRAINING_LOCATION();
            _obj_Smhr_Location.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_Location.OPERATION       = operation.Select1;
            radLocation.DataSource             = BLL.get_TrainingLocation(_obj_Smhr_Location);
            radLocation.DataTextField          = "Location_Name";
            radLocation.DataValueField         = "Location_ID";
            radLocation.DataBind();
            radLocation.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_CourseSchedule", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
示例#22
0
 public void loadSlab()
 {
     try
     {
         _obj_smhr_master                 = new SMHR_MASTERS();
         _obj_smhr_master.OPERATION       = operation.Select;
         _obj_smhr_master.MASTER_TYPE     = "AUSRESIDENCYTYPE";
         _obj_smhr_master.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         DataTable dtlocal = BLL.get_MasterRecords(_obj_smhr_master);
         if (dtlocal.Rows.Count > 0)
         {
             rcmbSlab.DataSource     = dtlocal;
             rcmbSlab.DataTextField  = "HR_MASTER_CODE";
             rcmbSlab.DataValueField = "HR_MASTER_ID";
             rcmbSlab.DataBind();
             rcmbSlab.Items.Insert(0, new RadComboBoxItem("Select", "0"));
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TdsSlab", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
示例#23
0
 protected void lnk_Employee_Edit_Command(object sender, CommandEventArgs e)
 {
     try
     {
         ddlRelation.Items.Clear();
         SMHR_MASTERS _obj_smhr_masters = new SMHR_MASTERS();
         _obj_smhr_masters.MASTER_TYPE     = "RELATIONSHIP";
         _obj_smhr_masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         _obj_smhr_masters.OPERATION       = operation.Select;
         ddlRelation.DataSource            = BLL.get_MasterRecords(_obj_smhr_masters);
         ddlRelation.DataTextField         = "HR_MASTER_CODE";
         ddlRelation.DataValueField        = "HR_MASTER_ID";
         ddlRelation.DataBind();
         ddlRelation.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select"));
         string str_Query   = RG_Employee.MasterTableView.FilterExpression;
         string _lbl_Emp_ID = Convert.ToString(e.CommandArgument);
         HF_EMPID.Value     = _lbl_Emp_ID;
         _obj_smhr_employee = new SMHR_EMPLOYEE();
         _obj_smhr_employee.EMPFMDTL_EMP_ID = Convert.ToInt32(_lbl_Emp_ID); //Convert.ToInt32(_lbl_Emp_ID);
         _obj_smhr_employee.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         _obj_smhr_employee.OPERATION       = operation.Check;
         DataTable dt = BLL.get_EmployeeFamily(_obj_smhr_employee);
         RG_Family.DataSource = dt;
         RG_Family.DataBind();
         Rm_CY_page.SelectedIndex = 1;
         btn_Fam_Correct.Visible  = false;
         clearFamilyFields();
         int Serial = getFamilySerial();
         txt_FSerial.Text = Convert.ToString(Serial);
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_EmpFamDetails_Medical", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
示例#24
0
    protected void btn_import_Click(object sender, EventArgs e)
    {
        try
        {
            string strcon = null;

            string strfilename1 = fu_masters.FileName;
            strfilename2 = Convert.ToString(DateTime.Now.TimeOfDay) + "_" + strfilename1;
            strfilename2 = strfilename2.Replace("/", "").Replace(":", ".");
            if (fu_masters.HasFile)
            {
                if (System.IO.Directory.Exists(Server.MapPath("~/IMPORT_EXCEL/")) == false)
                {
                    System.IO.Directory.CreateDirectory(Server.MapPath("~/IMPORT_EXCEL/"));
                }



                fu_masters.PostedFile.SaveAs(System.IO.Path.Combine(Server.MapPath("~/IMPORT_EXCEL/"), strfilename2));
                string   filename1 = Server.MapPath("~/IMPORT_EXCEL/") + ("") + (Convert.ToString(strfilename2));
                FileInfo fileInfo  = new FileInfo(filename1);
                if (fileInfo.Exists)
                {
                    string path = MapPath(strfilename1);
                    // string name = Path.GetFileName( path );
                    string ext = Path.GetExtension(path);

                    string type = string.Empty;
                    //  set known types based on file extension
                    if (ext != null)
                    {
                        switch (ext.ToLower())
                        {
                        case ".xls":

                            type = "excel";
                            break;

                        case ".xlsx":
                            type = "excel";
                            break;

                        default:
                            type = string.Empty;
                            break;
                        }
                    }
                    if (type == string.Empty)
                    {
                        if (System.IO.Directory.Exists(Server.MapPath("~/IMPORT_EXCEL/")) == true)
                        {
                            string path1 = Server.MapPath("~/IMPORT_EXCEL/") + ("") + (Convert.ToString(strfilename2));
                            System.IO.File.Delete(path1);
                        }
                        BLL.ShowMessage(this, "Please select the Excel File  (Eg: Excel.xlsx). ");
                        return;
                    }
                }
            }


            else
            {
                BLL.ShowMessage(this, "Please Select the File to be uploaded");
                return;
            }
            string strpath = Server.MapPath("~/IMPORT_EXCEL/");

            strpath = strpath + strfilename2;


            // Getting data from excell file to dataset.
            strcon = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source='" + strpath + "';" + "Extended Properties=Excel 12.0;";


            OleDbConnection objConn = null;
            objConn = new OleDbConnection(strcon);
            objConn.Open();

            DataTable dt_chk2 = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
            string    sheetname;
            if (dt_chk2 == null)
            {
                objConn.Close();
                Delete_Excel_File();
                BLL.ShowMessage(this, "Please select the Correct Excel Template  Sheet.");
                return;
            }
            else
            {
                sheetname = Convert.ToString(dt_chk2.Rows[0]["TABLE_NAME"]);
            }
            OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM  [" + sheetname + "]", strcon);



            da.Fill(ds);

            objConn.Close();
            DataTable dt     = new DataTable();
            DataTable dtfail = new DataTable();


            string errormsg = string.Empty;

            string projecttype = null;
            Int32  rowno       = 0;


            string columnno = null;

            Boolean filestatus = true;
            dtfail.Columns.Add("S.NO", typeof(Int32));
            dtfail.Columns.Add("ROWNO", typeof(Int32));
            dtfail.Columns.Add("COLUMNS NAMES", typeof(string));

            if (!(ds.Tables[0].Columns[0].ToString().Trim() == "Name*"))
            {
                Delete_Excel_File();
                BLL.ShowMessage(this, "Please select the Correct Excel Template  Sheet.");
                return;
            }


            if (!(ds.Tables[0].Columns[1].ToString().Trim() == "Description"))
            {
                Delete_Excel_File();
                BLL.ShowMessage(this, "Please select the Correct Excel Template  Sheet.");
                return;
            }
            if (!(ds.Tables[0].Columns[2].ToString().Trim() == "Error Message"))
            {
                Delete_Excel_File();
                BLL.ShowMessage(this, "Please select the Correct Excel Template  Sheet.");
                return;
            }
            if (ds.Tables[0].Rows.Count == 0)
            {
                Delete_Excel_File();
                BLL.ShowMessage(this, "Successfully processed Excel file. No Records are Imported.");
                return;
            }
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if (ds.Tables[0].Rows[i]["Name*"].ToString().Trim() != "")
                {
                    _obj_Smhr_Masters = new SMHR_MASTERS();

                    _obj_Smhr_Masters.MASTER_TYPE     = control.ToUpper();
                    _obj_Smhr_Masters.MASTER_CODE     = ds.Tables[0].Rows[i]["Name*"].ToString().Trim();
                    _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
                    _obj_Smhr_Masters.OPERATION       = operation.Check;
                    if (Convert.ToString(BLL.get_MasterRecords(_obj_Smhr_Masters).Rows[0]["Count"]) != "0")
                    {
                        errormsg   = lblheader.Text + " with this Name Already Exists";
                        filestatus = false;
                        rowno      = i + 2;
                        columnno   = "Name*";
                    }
                }
                else
                {
                    filestatus = false;
                    rowno      = i + 2;
                    columnno   = "Name*";
                }
                //if (!(ds.Tables[0].Rows[i]["Description"].ToString().Trim() != ""))
                //{
                //    filestatus = false;
                //    rowno = i + 2;
                //    columnno = columnno + "," + "Description";

                //}
                if (filestatus == false)
                {
                    DataRow newrow = dtfail.NewRow();
                    newrow["S.NO"] = dtfail.Rows.Count + 1;


                    newrow["ROWNO"]         = rowno;
                    newrow["COLUMNS NAMES"] = columnno;
                    dtfail.Rows.Add(newrow);
                    ds.Tables[0].Rows[i]["Error Message"] = errormsg;
                }
            }
            if (dtfail.Rows.Count > 0)
            {
                Session["dt_fail"] = dtfail;
                Session["ds_data"] = ds;
                Delete_Excel_File();
                //LinkButton lnk_Import_process = (LinkButton)RadPanelBar1.FindItemByValue("AddAttachment").FindControl("lnk_Import_process");
                Telerik.Web.UI.RadWindow newwindow = new Telerik.Web.UI.RadWindow();
                // RWM_POSTREPLY.Windows.Remove(newwindow);
                newwindow.ID = "RadWindow_import";

                newwindow.NavigateUrl       = "~/Payroll/frm_AttendanceImportProcess.aspx";
                newwindow.Title             = "Import Process";
                newwindow.Width             = 1150;
                newwindow.Height            = 580;
                newwindow.VisibleOnPageLoad = true;
                if (RWM_MASTERS.Windows.Count > 1)
                {
                    RWM_MASTERS.Windows.RemoveAt(1);
                }
                RWM_MASTERS.Windows.Add(newwindow);



                RWM_MASTERS.Visible = true;
                return;
            }
            else
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    _obj_Smhr_Masters = new SMHR_MASTERS();

                    _obj_Smhr_Masters.MASTER_TYPE     = control.ToUpper();
                    _obj_Smhr_Masters.MASTER_CODE     = ds.Tables[0].Rows[i]["Name*"].ToString().Trim();
                    _obj_Smhr_Masters.MASTER_DESC     = ds.Tables[0].Rows[i]["Description"].ToString().Trim();
                    _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
                    _obj_Smhr_Masters.ISDELETED       = false;
                    _obj_Smhr_Masters.CREATEDBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
                    _obj_Smhr_Masters.CREATEDDATE     = DateTime.Now;
                    _obj_Smhr_Masters.LASTMDFBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
                    _obj_Smhr_Masters.LASTMDFDATE     = DateTime.Now;
                    _obj_Smhr_Masters.OPERATION       = operation.Insert;
                    if (BLL.set_Master(_obj_Smhr_Masters))
                    {
                        BLL.ShowMessage(this, " Successfully processed Excel file.");
                    }
                }
                rm_MR_Page.SelectedIndex = 0;
                LoadGrid();
                RG_Master.DataBind();
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Master", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            _obj_Smhr_BankBanch = new SMHR_BANKBRANCH();


            _obj_Smhr_BankBanch.BRANCH_NAME    = BLL.ReplaceQuote(rtxt_BranchName.Text);
            _obj_Smhr_BankBanch.BRANCH_BANK_ID = Convert.ToInt32(rcmb_BankCode.SelectedItem.Value);
            //    _obj_Smhr_Masters.ORGANISATION_ID  = Convert.ToInt32(Session["ORG_ID"]);


            _obj_Smhr_BankBanch.CREATEDBY   = Convert.ToInt32(Session["USER_ID"]); //1; // ### Need to Get the Session
            _obj_Smhr_BankBanch.CREATEDDATE = DateTime.Now;

            _obj_Smhr_BankBanch.LASTMDFBY       = Convert.ToInt32(Session["USER_ID"]);//1; // ### Need to Get the Session
            _obj_Smhr_BankBanch.LASTMDFDATE     = DateTime.Now;
            _obj_Smhr_BankBanch.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);

            _obj_Smhr_Masters                 = new SMHR_MASTERS();
            _obj_Smhr_Masters.MASTER_ID       = Convert.ToInt32(rcmb_BankCode.SelectedItem.Value);
            _obj_Smhr_Masters.MASTER_TYPE     = "Bank";
            _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);

            _obj_Smhr_Masters.OPERATION = operation.Select;
            DataTable dtBankCode  = BLL.get_MasterRecords(_obj_Smhr_Masters);
            string    strBankCode = string.Empty;
            if (dtBankCode.Rows.Count > 0)
            {
                strBankCode = Convert.ToString(dtBankCode.Rows[0]["HR_MASTER_CODE"]);
            }
            string strBranchCode = BLL.ReplaceQuote(rtxt_BranchCode.Text.ToUpper());
            //_obj_Smhr_BankBanch.BRANCH_CODE = strBankCode + strBranchCode;
            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_UPDATE":
                _obj_Smhr_BankBanch.BRANCH_ID = Convert.ToInt32(lbl_BranchId.Text);
                //_obj_Smhr_BankBanch.OPERATION = operation.Check;
                _obj_Smhr_BankBanch.OPERATION = operation.Validate1;
                if (Convert.ToString(BLL.get_BankBranch(_obj_Smhr_BankBanch).Rows[0]["Count"]) != "1")
                {
                    BLL.ShowMessage(this, "Branch with this Code Already Exists");
                    return;
                }
                _obj_Smhr_BankBanch.BRANCH_CODE     = strBranchCode;
                _obj_Smhr_BankBanch.OPERATION       = operation.Update;
                _obj_Smhr_BankBanch.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                if (BLL.set_BankBranch(_obj_Smhr_BankBanch))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;

            case "BTN_SAVE":
                //_obj_Smhr_BankBanch.OPERATION = operation.Check;
                //_obj_Smhr_BankBanch.BRANCH_CODE = strBankCode + strBranchCode;
                _obj_Smhr_BankBanch.BRANCH_CODE = strBranchCode;
                _obj_Smhr_BankBanch.OPERATION   = operation.Validate1;
                if (Convert.ToString(BLL.get_BankBranch(_obj_Smhr_BankBanch).Rows[0]["Count"]) != "0")
                {
                    BLL.ShowMessage(this, "Branch with this Code Already Exists");
                    return;
                }
                //  _obj_Smhr_BankBanch.BRANCH_CODE = strBankCode + strBranchCode;
                _obj_Smhr_BankBanch.OPERATION       = operation.Insert;
                _obj_Smhr_BankBanch.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                if (BLL.set_BankBranch(_obj_Smhr_BankBanch))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;

            default:
                break;
            }
            Rm_BB_page.SelectedIndex = 0;
            LoadGrid();
            Rg_BankBranch.DataBind();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_BankBranch", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
示例#26
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            _obj_Smhr_Masters = new SMHR_MASTERS();

            _obj_Smhr_Masters.MASTER_TYPE     = control.ToUpper();
            _obj_Smhr_Masters.MASTER_CODE     = rtxt_MasterCode.Text.Replace("'", "''");
            _obj_Smhr_Masters.MASTER_DESC     = rtxt_MasterDesc.Text.Replace("'", "''");
            _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
            _obj_Smhr_Masters.ISDELETED       = false;
            _obj_Smhr_Masters.CREATEDBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_Masters.CREATEDDATE     = DateTime.Now;
            _obj_Smhr_Masters.LASTMDFBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_Masters.LASTMDFDATE     = DateTime.Now;

            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_SAVE":
                _obj_Smhr_Masters.OPERATION = operation.Check;
                if (Convert.ToString(BLL.get_MasterRecords(_obj_Smhr_Masters).Rows[0]["Count"]) != "0")
                {
                    BLL.ShowMessage(this, "This  " + changetoTitle_Case(_obj_Smhr_Masters.MASTER_TYPE) + " Already Exists");
                    ClearFields();
                    rm_MR_Page.SelectedIndex = 1;
                    btn_Save.Visible         = true;
                    return;
                }
                _obj_Smhr_Masters.OPERATION = operation.Insert;
                if (BLL.set_Master(_obj_Smhr_Masters))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully");
                    rm_MR_Page.SelectedIndex = 0;
                    LoadGrid();
                    RG_Master.DataBind();
                }

                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }

                break;

            case "BTN_EDIT":
                _obj_Smhr_Masters.MASTER_ID = Convert.ToInt32(lbl_Master_ID.Text);
                _obj_Smhr_Masters.OPERATION = operation.Check;
                if (Convert.ToString(BLL.get_MasterRecords(_obj_Smhr_Masters).Rows[0]["Count"]) != "1")
                {
                    BLL.ShowMessage(this, "This  " + changetoTitle_Case(_obj_Smhr_Masters.MASTER_TYPE) + " Already Exists");
                    return;
                }
                _obj_Smhr_Masters.OPERATION = operation.Update;
                if (BLL.set_Master(_obj_Smhr_Masters))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully");
                    rm_MR_Page.SelectedIndex = 0;
                    LoadGrid();
                    RG_Master.DataBind();
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Updated");
                }

                break;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Master", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
        //rm_MR_Page.SelectedIndex = 0;
        //LoadGrid();
        //RG_Master.DataBind();
    }
示例#27
0
    protected void lnk_Edit_Command(object sender, CommandEventArgs e)
    {
        try
        {
            if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
            {
                btn_Update.Visible = false;
            }

            else
            {
                btn_Update.Visible = true;
            }
            rmp_Main.SelectedIndex = 1;
            btn_Save.Visible       = false;
            btn_Update.Visible     = true;
            //rcmb_BusinessUnit.Enabled=false;
            rcmb_tdsname.Enabled     = false;
            rtxt_TdsSlabName.Enabled = false;
            loadDropdown();

            _obj_smhr_Tds_Slab             = new SMHR_TDS_SLAB();
            _obj_smhr_Tds_Slab.OPERATION   = operation.Validate;
            _obj_smhr_Tds_Slab.TDS_SLAB_ID = Convert.ToInt32(e.CommandArgument);
            Session["TDS_SLAB_ID"]         = Convert.ToString(e.CommandArgument);
            DataTable dt = BLL.get_TdsSlab(_obj_smhr_Tds_Slab);

            //rcmb_BusinessUnit.SelectedIndex = rcmb_BusinessUnit.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["BUSINESSUNIT_ID"]));
            rcmb_tdsname.SelectedIndex = rcmb_tdsname.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["TDS_SLAB_TDS_ID"]));
            rtxt_TdsSlabName.Text      = Convert.ToString(dt.Rows[0]["TDS_SLAB_NAME"]);
            rtxt_TdsSlabDesc.Text      = Convert.ToString(dt.Rows[0]["TDS_SLAB_DESC"]);

            _obj_smhr_Tds_Slab                 = new SMHR_TDS_SLAB();
            _obj_smhr_Tds_Slab.OPERATION       = operation.Check;
            _obj_smhr_Tds_Slab.TDS_SLAB_TDS_ID = Convert.ToInt32(dt.Rows[0]["TDS_SLAB_TDS_ID"]);
            _obj_smhr_Tds_Slab.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt_Tds_Id = BLL.get_TdsSlab(_obj_smhr_Tds_Slab);
            if (dt_Tds_Id.Rows.Count > 0)
            {
                _obj_smhr_master                 = new SMHR_MASTERS();
                _obj_smhr_master.OPERATION       = operation.Select;
                _obj_smhr_master.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_smhr_master.MASTER_TYPE     = "LOCALISATION";
                _obj_smhr_master.MASTER_ID       = Convert.ToInt32(dt_Tds_Id.Rows[0]["TDS_LOCALISATION_ID"]);
                DataTable dtlocalName = BLL.get_MasterRecords(_obj_smhr_master);
                if (dtlocalName.Rows.Count > 0)
                {
                    if (Convert.ToString(dtlocalName.Rows[0]["HR_MASTER_CODE"]).ToUpper() == "AUSTRALIA")
                    {
                        trRcmbSlab.Visible = true;
                        trTxtSlab.Visible  = false;
                        rcmbSlab.Enabled   = false;
                        loadSlab();
                        rcmbSlab.SelectedIndex = rcmbSlab.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["TDS_SLAB_HR_ID"]));
                    }
                    else
                    {
                        trRcmbSlab.Visible = false;
                        trTxtSlab.Visible  = true;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TdsSlab", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }