Example #1
0
    private void LoadEmployee()
    {
        try
        {
            obj_smhr_Logininfo = new SMHR_LOGININFO();
            obj_smhr_Logininfo.OPERATION = operation.Check;
            string str_BusinessUnit_ID = Convert.ToString(rcmb_BusinessUnit.SelectedValue).ToUpper();
            //obj_smhr_logininfo.BUID = Convert.ToInt32(str_BusinessUnit_ID);
            //DataTable dt_getBUSINESS_ID = BLL.get_Sup_BusinessUnit(obj_smhr_logininfo);
            //string str_BUSINESSUNIT_ID = Convert.ToString(dt_getBUSINESS_ID.Rows[0][0]);

            obj_smhr_Logininfo.OPERATION = operation.Check;
            obj_smhr_Logininfo.BUID = Convert.ToInt32(str_BusinessUnit_ID);
            DataTable dt_getEMP = BLL.get_Sup_BusinessUnit(obj_smhr_Logininfo);

            rcmb_Employee.Items.Clear();
            rcmb_Employee.DataSource = dt_getEMP;
            rcmb_Employee.DataTextField = "EMP_NAME";
            rcmb_Employee.DataValueField = "EMP_NAME";
            rcmb_Employee.DataBind();
            rcmb_Employee.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("'", "''"), "EmployeeLeaveDetail", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void LoadCombos()
    {
        try
        {
            //rcmb_BusinessUnit.Items.Clear();
            //SMHR_BUSINESSUNIT _obj_Smhr_BusinessUnit = new SMHR_BUSINESSUNIT();
            //_obj_Smhr_BusinessUnit.OPERATION = operation.Select;
            //_obj_Smhr_BusinessUnit.ISDELETED = true;
            //rcmb_BusinessUnit.DataSource = BLL.get_BusinessUnit(_obj_Smhr_BusinessUnit);
            //rcmb_BusinessUnit.DataTextField = "BUSINESSUNIT_CODE";
            //rcmb_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
            //rcmb_BusinessUnit.DataBind();
            //rcmb_BusinessUnit.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));


            SMHR_LOGININFO _obj_smhr_logininfo = new SMHR_LOGININFO();
            _obj_smhr_logininfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
            _obj_smhr_logininfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"].ToString());
            rcmb_BusinessUnit.Items.Clear();
            rcmb_BusinessUnit.DataSource     = BLL.get_Business_Units(_obj_smhr_logininfo);
            rcmb_BusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
            rcmb_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
            rcmb_BusinessUnit.DataBind();
            rcmb_BusinessUnit.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_HolidayCalendar", ex.StackTrace, DateTime.Now);
        }
    }
Example #3
0
    private void LoadCombos()
    {
        try
        {
            _obj_smhr_businessunit = new SMHR_BUSINESSUNIT();


            _obj_SMHR_LoginInfo = new SMHR_LOGININFO();
            _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_SMHR_LoginInfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"]);
            DataTable dt_BUDetails = BLL.get_Business_Units(_obj_SMHR_LoginInfo);
            if (dt_BUDetails.Rows.Count != 0)
            {
                rcmb_BUI.DataSource     = dt_BUDetails;
                rcmb_BUI.DataValueField = "BUSINESSUNIT_ID";
                rcmb_BUI.DataTextField  = "BUSINESSUNIT_CODE";
                rcmb_BUI.DataBind();
                rcmb_BUI.Items.Insert(0, new RadComboBoxItem("Select"));
            }
            else
            {
                DataTable dt_Details = new DataTable();
                rcmb_BUI.DataSource = dt_Details;

                rcmb_BUI.DataBind();
                rcmb_BUI.Items.Insert(0, new RadComboBoxItem("Select"));
            }
        }

        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Kraform", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    /// <summary>
    /// To load all Organisation details
    /// </summary>
    private void LoadOrganisation()
    {
        try
        {
            _obj_LoginInfo = new SMHR_LOGININFO();

            _obj_LoginInfo.OPERATION             = operation.Login1;
            _obj_LoginInfo.LOGIN_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);

            DataTable dt_logindetails = BLL.get_Logindetails(_obj_LoginInfo);

            if (dt_logindetails.Rows.Count > 0)
            {
                rcbOrg.DataSource     = dt_logindetails;
                rcbOrg.DataTextField  = "ORGANISATION_NAME";
                rcbOrg.DataValueField = "ORGANISATION_ID";
                rcbOrg.DataBind();

                rcbOrg.SelectedIndex = rcbOrg.Items.FindItemIndexByValue(Convert.ToString(Session["ORG_ID"]));
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmGratuityReportSS", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #5
0
 private void LoadBusinessUnit()
 {
     try
     {
         _obj_SMHR_LoginInfo = new SMHR_LOGININFO();
         _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         _obj_SMHR_LoginInfo.LOGIN_ID        = Convert.ToInt32(Session["USER_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_BusinessUnit.Items.Insert(ddl_BusinessUnit.Items.Count(), new RadComboBoxItem("All", "-1"));
         //SMHR_DEPARTMENT _obj_smhr_department = new SMHR_DEPARTMENT();
         //_obj_smhr_department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         //_obj_smhr_department.MODE = 5;
         //DataTable dt_dept = BLL.get_Department(_obj_smhr_department);
         //ddl_Department.DataSource = dt_dept;
         //ddl_Department.DataValueField = "DEPARTMENT_ID";
         //ddl_Department.DataTextField = "DEPARTMENT_NAME";
         //ddl_Department.DataBind();
         //ddl_Department.Items.Insert(0, new RadComboBoxItem("Select"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeYearOfExperience", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
 protected void loadDropdown()
 {
     //_obj_Smhr_BusinessUnitBank = new SMHR_BUSINESSUNITBANK();
     //_obj_Smhr_BusinessUnitBank.OPERATION = operation.Check;
     //rcmb_BusinessUnits.Items.Clear();
     //rcmb_BusinessUnits.DataSource = BLL.get_BusinessUnitBank(_obj_Smhr_BusinessUnitBank);
     //rcmb_BusinessUnits.DataTextField = "BUSINESSUNIT_CODE";
     //rcmb_BusinessUnits.DataValueField = "BUSINESSUNIT_ID";
     //rcmb_BusinessUnits.DataBind();
     //rcmb_BusinessUnits.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
     try
     {
         SMHR_LOGININFO _obj_smhr_logininfo = new SMHR_LOGININFO();
         _obj_smhr_logininfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
         _obj_smhr_logininfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"].ToString());
         rcmb_BusinessUnits.Items.Clear();
         rcmb_BusinessUnits.DataSource     = BLL.get_Business_Units(_obj_smhr_logininfo);
         rcmb_BusinessUnits.DataTextField  = "BUSINESSUNIT_CODE";
         rcmb_BusinessUnits.DataValueField = "BUSINESSUNIT_ID";
         rcmb_BusinessUnits.DataBind();
         rcmb_BusinessUnits.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_BusinessUnitBanks", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
 private void LoadBusinessUnit()
 {
     _obj_SMHR_BusinessUnit = new SMHR_BUSINESSUNIT();
     try
     {
         if ((Convert.ToInt32(Session["EMP_ID"]) == 0))
         {
             rad_BusinessUnit.Items.Clear();
             _obj_SMHR_LoginInfo = new SMHR_LOGININFO();
             _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
             _obj_SMHR_LoginInfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"]);
             DataTable dt_BUDetails = BLL.get_Business_Units(_obj_SMHR_LoginInfo);
             if (dt_BUDetails.Rows.Count > 0)
             {
                 rad_BusinessUnit.DataSource     = dt_BUDetails;
                 rad_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
                 rad_BusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
                 rad_BusinessUnit.DataBind();
             }
             rad_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select"));
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "MonitoringPensionContribution", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
Example #8
0
    private void LoadOrganisation()
    {
        try
        {
            //obj_smhr_Organisation = new SMHR_ORGANISATION();
            //obj_smhr_Organisation.MODE = 1;
            //DataTable dt_OrganisationDetails = BLL.get_Organisation(obj_smhr_Organisation);
            //rcmb_Organisation.DataSource = dt_OrganisationDetails;
            //rcmb_Organisation.DataValueField = "ORGANISATION_ID";
            //rcmb_Organisation.DataTextField = "ORGANISATION_DESC";
            //rcmb_Organisation.DataBind();
            //rcmb_Organisation.Items.Insert(0, new RadComboBoxItem("Select"));


            SMHR_LOGININFO _obj_LoginInfo = new SMHR_LOGININFO();
            _obj_LoginInfo.OPERATION             = operation.Login1;
            _obj_LoginInfo.LOGIN_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt_logindetails = BLL.get_Logindetails(_obj_LoginInfo);
            rcmb_Organisation.DataSource     = dt_logindetails;
            rcmb_Organisation.DataTextField  = "organisation_name";
            rcmb_Organisation.DataValueField = "organisation_id";
            rcmb_Organisation.DataBind();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeYearOfExperience", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #9
0
    private void LoadCombos()
    {
        try
        {
            rcmb_BusinessUnit.Items.Clear();
            _obj_SMHR_LoginInfo = new SMHR_LOGININFO();
            _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_SMHR_LoginInfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"]);
            DataTable dt_BUDetails = BLL.get_Business_Units(_obj_SMHR_LoginInfo);
            rcmb_BusinessUnit.DataSource     = dt_BUDetails;
            rcmb_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
            rcmb_BusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
            rcmb_BusinessUnit.DataBind();
            rcmb_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select"));

            _obj_smhr_period                 = new SMHR_PERIOD();
            _obj_smhr_period.OPERATION       = operation.Select;
            _obj_smhr_period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt_Details = BLL.get_PeriodHeaderDetails(_obj_smhr_period);
            rcmb_Period.DataSource     = dt_Details;
            rcmb_Period.DataValueField = "PERIOD_ID";
            rcmb_Period.DataTextField  = "PERIOD_NAME";
            rcmb_Period.DataBind();
            rcmb_Period.Items.Insert(0, new RadComboBoxItem("Select"));
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "PF_contribution", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #10
0
 public void loadDropdown()
 {
     try
     {
         //To load Business unit
         SMHR_LOGININFO _obj_SMHR_LoginInfo = new SMHR_LOGININFO();
         _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         _obj_SMHR_LoginInfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"]);
         //DataTable dt_BUDetails = BLL.get_Business_Units(_obj_SMHR_LoginInfo);
         //_obj_smhr_Organisation = new SMHR_ORGANISATION();
         //_obj_smhr_BusinessUnit = new SMHR_BUSINESSUNIT();
         //_obj_smhr_BusinessUnit.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         //DataTable dt_BusinessUnit = BLL.get_BusinessUnit(_obj_smhr_BusinessUnit);
         DataTable dt_BusinessUnit = BLL.get_Business_Units(_obj_SMHR_LoginInfo);
         rcmb_BusinessUnit.DataSource     = dt_BusinessUnit;
         rcmb_BusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
         rcmb_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
         rcmb_BusinessUnit.DataBind();
         rcmb_BusinessUnit.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_tds", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
    private void LoadBU()
    {
        try
        {
            _obj_smhr_businessunit = new SMHR_BUSINESSUNIT();
            obj_smhr_Period        = new SMHR_PERIOD();

            obj_smhr_logininfo = new SMHR_LOGININFO();
            obj_smhr_logininfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            obj_smhr_logininfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"]);
            DataTable dt_BUDetails = BLL.get_Business_Units(obj_smhr_logininfo);
            rcmb_BU.DataSource     = dt_BUDetails;
            rcmb_BU.DataValueField = "BUSINESSUNIT_ID";
            rcmb_BU.DataTextField  = "BUSINESSUNIT_CODE";
            rcmb_BU.DataBind();

            //if (Convert.ToString(Session["SELFSERVICE"]) == "ADMIN")
            //    rcmb_BU.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("All", "-1"));
            //else
            //    rcmb_BU.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select"));
            rcmb_BU.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("'", "''"), "SmryRptByGndrFrTheMth", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
 protected void LoadEmployees()
 {
     try
     {
         DataTable deptid = new DataTable();
         if (Session["EMP_ID"] != null)
         {
             deptid = BLL.Get_Emp_Dept_id(Convert.ToInt32(Session["EMP_ID"]));
             if (deptid != null)
             {
                 if (deptid.Rows.Count > 0)
                 {
                     ViewState["deptid"] = deptid.Rows[0][0].ToString();
                 }
             }
         }
         _obj_smhr_logininfo = new SMHR_LOGININFO();
         _obj_smhr_logininfo.LOGIN_EMP_ID          = Convert.ToInt32(Session["EMP_ID"]);
         _obj_smhr_logininfo.LOGIN_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         _obj_smhr_logininfo.BUID = Convert.ToInt32(radBU.SelectedValue);
         dt_details = BLL.get_GETRESIGNEDEMPLOYEE(_obj_smhr_logininfo);
         dt_details = removeNullColumnFromDataTable(dt_details);
         rad_Employees.DataSource     = dt_details;
         rad_Employees.DataTextField  = "empname";
         rad_Employees.DataValueField = "EMP_ID";
         rad_Employees.DataBind();
         rad_Employees.Items.Insert(0, new RadComboBoxItem("Select"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Clearance", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
         return;
     }
 }
    /// <summary>
    ///  I Am Loading Business uit values based on business unit id
    /// </summary>

    protected void LoadBusinessUnit()
    {
        try
        {
            rcmb_BusinessUnitType.Items.Clear();
            DataTable dt_Details = new DataTable();

            SMHR_LOGININFO _obj_SMHR_LoginInfo = new SMHR_LOGININFO();
            _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_SMHR_LoginInfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"]);

            DataTable dt_BUDetails = BLL.get_Business_Units(_obj_SMHR_LoginInfo);
            if (dt_BUDetails.Rows.Count != 0)
            {
                rcmb_BusinessUnitType.DataSource     = dt_BUDetails;
                rcmb_BusinessUnitType.DataValueField = "BUSINESSUNIT_ID";
                rcmb_BusinessUnitType.DataTextField  = "BUSINESSUNIT_CODE";
                rcmb_BusinessUnitType.DataBind();
                rcmb_BusinessUnitType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
                rcmb_BusinessUnitType.SelectedIndex = 0;
            }
        }
        catch (Exception ex)
        {
            //Pms_Bll.ShowMessage(this, ex.Message.ToString());
            //return;
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsTask", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #14
0
 protected void LoadBusinessUnit()
 {
     try
     {
         string control = Convert.ToString(Request.QueryString["Control"]);
         obj_smhr_Businessunit              = new SMHR_BUSINESSUNIT();
         obj_smhr_Period                    = new SMHR_PERIOD();
         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);
         rcmb_BusinessUnit.DataSource     = dt_BUDetails;
         rcmb_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
         rcmb_BusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
         rcmb_BusinessUnit.DataBind();
         if (control == "11")
         {
             rcmb_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select"));
         }
         else
         {
             // rcmb_BusinessUnit.Items.Insert(0, new RadComboBoxItem(Convert.ToString(Session["ORG_NAME"])));
         }
     }
     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");
     }
 }
    protected void rcmb_BU_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        try
        {
            if (rcmb_BU.SelectedValue != "")
            {
                if (Convert.ToString(Session["SELFSERVICE"]) == "ADMIN")
                {
                    obj_smhr_logininfo           = new SMHR_LOGININFO();
                    obj_smhr_logininfo.OPERATION = operation.Check;
                    string str_BusinessUnit_ID = Convert.ToString(rcmb_BU.SelectedValue).ToUpper();
                    //obj_smhr_logininfo.BUID = Convert.ToInt32(str_BusinessUnit_ID);
                    //DataTable dt_getBUSINESS_ID = BLL.get_Sup_BusinessUnit(obj_smhr_logininfo);
                    //string str_BUSINESSUNIT_ID = Convert.ToString(dt_getBUSINESS_ID.Rows[0][0]);

                    obj_smhr_logininfo.OPERATION = operation.Check;
                    obj_smhr_logininfo.BUID      = Convert.ToInt32(str_BusinessUnit_ID);
                    DataTable dt_getEMP = BLL.get_Sup_BusinessUnit(obj_smhr_logininfo);

                    rcmb_Emp.Items.Clear();
                    rcmb_Emp.DataSource     = dt_getEMP;
                    rcmb_Emp.DataTextField  = "EMP_NAME";
                    rcmb_Emp.DataValueField = "EMP_ID";
                    rcmb_Emp.DataBind();
                    //rcmb_Employee.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select"));
                    rcmb_Emp.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("All", "-1"));
                    if (rcmb_BU.SelectedValue != "-1")
                    {
                        rcmb_Emp.SelectedValue = "-1";
                    }
                }
                else
                {
                    _obj_smhr_emp_payitems                 = new SMHR_EMP_PAYITEMS();
                    _obj_smhr_emp_payitems.EMP_ID          = Convert.ToInt32(Session["EMP_ID"]);
                    _obj_smhr_emp_payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                    _obj_smhr_emp_payitems.OPERATION       = operation.Self;
                    DataTable dt_EMP = BLL.get_EmpDetails(_obj_smhr_emp_payitems);
                    rcmb_Emp.DataSource     = dt_EMP;
                    rcmb_Emp.DataTextField  = "Empname";
                    rcmb_Emp.DataValueField = "EMP_ID";
                    rcmb_Emp.DataBind();
                    rcmb_Emp.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select"));
                }
            }
            else
            {
                rcmb_Emp.Items.Clear();
                rcmb_Emp.Text             = String.Empty;
                rdt_FromDate.SelectedDate = null;
                rdt_Enddate.SelectedDate  = null;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmpLeaveStmt", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    private void LoadCombos()
    {
        try
        {
            // Loading Business units

            _obj_smhr_businessunit = new SMHR_BUSINESSUNIT();
            _obj_SMHR_LoginInfo    = new SMHR_LOGININFO();
            rcmb_Perioddtls.Items.Clear();
            rcmb_Busniessunit.Items.Clear();
            rcmb_Financialperiod.Items.Clear();
            _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_SMHR_LoginInfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"]);
            dt_Information = BLL.get_Business_Units(_obj_SMHR_LoginInfo);
            if (dt_Information.Rows.Count != 0)
            {
                rcmb_Busniessunit.DataSource     = dt_Information;
                rcmb_Busniessunit.DataValueField = "BUSINESSUNIT_ID";
                rcmb_Busniessunit.DataTextField  = "BUSINESSUNIT_CODE";
                rcmb_Busniessunit.DataBind();
                rcmb_Busniessunit.Items.Insert(0, new RadComboBoxItem("Select"));
                rcmb_Busniessunit.SelectedIndex = 0;
            }
            else
            {
                rcmb_Busniessunit.DataSource = dt_null;
                rcmb_Busniessunit.DataBind();
                rcmb_Busniessunit.Items.Insert(0, new RadComboBoxItem("Select"));
            }

            // Loading Periods

            SMHR_PERIOD _obj_smhr_period = new SMHR_PERIOD();
            _obj_smhr_period.OPERATION       = operation.Select;
            _obj_SMHR_LoginInfo              = new SMHR_LOGININFO();
            _obj_smhr_period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            //_obj_SMHR_LoginInfo.LOGIN_ID = 53;
            dt_Information = BLL.get_PeriodHeaderDetails(_obj_smhr_period);
            if (dt_Information.Rows.Count != 0)
            {
                rcmb_Financialperiod.DataSource     = dt_Information;
                rcmb_Financialperiod.DataValueField = "PERIOD_ID";
                rcmb_Financialperiod.DataTextField  = "PERIOD_NAME";
                rcmb_Financialperiod.DataBind();
                rcmb_Financialperiod.Items.Insert(0, new RadComboBoxItem("Select"));
            }
            else
            {
                rcmb_Financialperiod.DataSource = dt_null;
                rcmb_Financialperiod.DataBind();
                rcmb_Financialperiod.Items.Insert(0, new RadComboBoxItem("Select"));
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Esiexport", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("Training Attendance Details");//TRAINING APPROVAL");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    RG_TrainingApproval.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    btn_submit.Visible = false;
                    //btn_Update.Visible = false;
                }
                else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }
                LoadCombos();
                //LoadData();
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_AttendanceDetails", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }

        //ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "function pageLoad(){ }", true);
    }
Example #18
0
    private void LoadBusinessUnit()
    {
        try
        {
            obj_smhr_Businessunit = new SMHR_BUSINESSUNIT();
            obj_smhr_Period       = new SMHR_PERIOD();
            obj_smhr_Logininfo    = new SMHR_LOGININFO();

            Control = Convert.ToString(Request.QueryString["Control"]);

            if (Convert.ToString(Session["SELFSERVICE"]) == "ADMIN")
            {
                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);
                rcmb_BusinessUnit.DataSource     = dt_BUDetails;
                rcmb_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
                rcmb_BusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
                rcmb_BusinessUnit.DataBind();
                //rcmb_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select"));

                if (Control == "AllocationSummary")
                {
                    //      rcmb_BusinessUnit.Items.Insert(0, new RadComboBoxItem(Convert.ToString(Session["ORG_NAME"]), "-1"));
                }
                else
                {
                    rcmb_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select"));
                }
            }
            else
            {
                _obj_smhr_emp_payitems                 = new SMHR_EMP_PAYITEMS();
                _obj_smhr_emp_payitems.EMP_ID          = Convert.ToInt32(Session["EMP_ID"]);
                _obj_smhr_emp_payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_smhr_emp_payitems.OPERATION       = operation.Self;
                DataTable dt_BU = BLL.get_EmpDetails(_obj_smhr_emp_payitems);
                rcmb_BusinessUnit.DataSource     = dt_BU;
                rcmb_BusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
                rcmb_BusinessUnit.DataValueField = "EMP_BUSINESSUNIT_ID";
                rcmb_BusinessUnit.DataBind();
                //rcmb_BusinessUnit.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "-1"));
                if (Control == "AllocationSummary")
                {
                    rcmb_BusinessUnit.Items.Insert(0, new RadComboBoxItem(Convert.ToString(Session["ORG_NAME"]), "-1"));
                }
                else
                {
                    rcmb_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select"));
                }
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "LeaveAllowancesPaid", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    //protected void loadDropdown()
    //{
    //    rcmb_BusinessUnit.Items.Clear();
    //    _obj_SMHR_LoginInfo = new SMHR_LOGININFO();
    //    _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
    //    _obj_SMHR_LoginInfo.LOGIN_ID = Convert.ToInt32(Session["USER_ID"]);
    //    rcmb_toperiod.Items.Clear();
    //   // rcmb_periodelement.Items.Clear();
    //    DataTable dt_BUDetails = BLL.get_Business_Units(_obj_SMHR_LoginInfo);
    //    rcmb_BusinessUnit.DataSource = dt_BUDetails;
    //    rcmb_BusinessUnit.DataTextField = "BUSINESSUNIT_CODE";
    //    rcmb_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
    //    rcmb_BusinessUnit.DataBind();
    //    rcmb_BusinessUnit.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
    //    LoadPeriods();
    // //   LoadPeriodElements();
    //}
    //private void LoadPeriods()
    //{
    //    _obj_smhr_period = new SMHR_PERIOD();
    //    dt_Details = new DataTable();
    //    _obj_smhr_period.OPERATION = operation.Select;
    //    _obj_smhr_period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
    //    dt_Details = BLL.get_PeriodHeaderDetails(_obj_smhr_period);
    //    rcmb_toperiod.DataSource = dt_Details;
    //    rcmb_toperiod.DataValueField = "PERIOD_ID";
    //    rcmb_toperiod.DataTextField = "PERIOD_NAME";
    //    rcmb_toperiod.DataBind();
    //    rcmb_toperiod.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
    //}
    //private void LoadPeriodElements()
    //{
    //    _obj_smhr_payroll = new SMHR_PAYROLL();
    //    _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_toperiod.SelectedValue);
    //    _obj_smhr_payroll.MODE = 11;
    //    dt_Details = new DataTable();
    //    dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll);
    //    //if (dt_Details.Rows.Count != 0)
    //    //{
    //    rcmb_periodelement.DataSource = dt_Details;
    //    rcmb_periodelement.DataValueField = "PRDDTL_ID";
    //    rcmb_periodelement.DataTextField = "PRDDTL_NAME";
    //    rcmb_periodelement.DataBind();
    //    //rcmb_periodelement.SelectedIndex = 0;
    //    rcmb_periodelement.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select","0"));
    //}
    //private void LoadPeriodElements()
    //{
    //    obj_smhr_leave = new SMHR_LEAVEPROCESS();
    //    obj_smhr_leave.PERIODELEMENT = Convert.ToInt32(rcmb_toperiod.SelectedValue);
    //    obj_smhr_leave.MODE = 9;
    //    dt_Details = new DataTable();
    //    dt_Details = BLL.Get_LEAVEDETAILS(obj_smhr_leave);
    //    //if (dt_Details.Rows.Count != 0)
    //    //{
    //    rcmb_periodelement.DataSource = dt_Details;
    //    rcmb_periodelement.DataValueField = "PRDDTL_ID";
    //    rcmb_periodelement.DataTextField = "PRDDTL_NAME";
    //    rcmb_periodelement.DataBind();
    //    rcmb_periodelement.SelectedIndex = 0;
    //    rcmb_periodelement.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select"));
    //}
    private void LoadGrid()
    {
        try
        {
            SMHR_LEAVEPROCESS obj_smhr_leave = new SMHR_LEAVEPROCESS();
            SMHR_LOGININFO    obj_smhr_login = new SMHR_LOGININFO();

            dt_Details = new DataTable();
            DataTable dt_FormData = new DataTable();
            _obj_SMHR_LoginInfo = new SMHR_LOGININFO();
            _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_SMHR_LoginInfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"]);
            DataTable dt_LoginDetails = BLL.get_LoginInfo(_obj_SMHR_LoginInfo);
            obj_smhr_login.OPERATION = operation.Check;
            lblCreatedBy.Text        = dt_LoginDetails.Rows[0]["LOGIN_USERNAME"].ToString();

            //obj_smhr_leave.MODE = 13;
            //obj_smhr_leave.BUID = Convert.ToInt32(Session["Buid"]);
            ////  lblExecutedDate.Text = dt_FormData.Rows[0]["SMHR_LP_CREATED_DATE"].ToString();
            ////lblFromPeriod.Text = Session["From_Period_id"].ToString();
            //obj_smhr_leave.FROMPERIOD = Convert.ToInt32(Session["From_Period_id"]);
            //obj_smhr_leave.TOPERIOD = Convert.ToInt32(Session["To_Period_id"]);
            //obj_smhr_leave.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
            //obj_smhr_leave.CREATEDDATE = Convert.ToDateTime(Session["Executed_Date"]);

            //dt_Details = BLL.Get_LEAVEDETAILS(obj_smhr_leave);
            //    if (dt_Details.Rows.Count > 0)
            //    {
            //        lblBusinessUnit.Text = Convert.ToString(dt_Details.Rows[0]["BUSINESSUNIT_CODE"]);
            //        lblFromPeriod.Text = Convert.ToString(dt_Details.Rows[0]["FROM_PERIOD"]);
            //        lblToPeriod.Text = Convert.ToString(dt_Details.Rows[0]["TO_PERIOD"]);

            //    }
            lblBusinessUnit.Text = Convert.ToString(Session["Buid"].ToString());
            lblFromPeriod.Text   = Convert.ToString(Session["From_Period_id"].ToString());
            lblToPeriod.Text     = Convert.ToString(Session["To_Period_id"]);
            lblPayElements.Text  = Convert.ToString(Session["payitem"]);
            lblExecutedDate.Text = Convert.ToString(Session["Executed_Date"]);

            //    lblBusinessUnit.Text = Session["Buid"].ToString();
            //////  lblExecutedDate.Text = dt_FormData.Rows[0]["SMHR_LP_CREATED_DATE"].ToString();
            //    lblFromPeriod.Text = Session["From_Period_id"].ToString();
            //    lblToPeriod.Text = Session["To_Period_id"].ToString();
            //    lblPayElements.Text = Session["payitem"].ToString();

            obj_smhr_leave.MODE       = 7;
            obj_smhr_leave.BUID       = Convert.ToInt32(Session["Bu_Id"]);
            obj_smhr_leave.TOPERIOD   = Convert.ToInt32(Session["ToPeriod_id"]);
            dt_FormData               = BLL.Get_LEAVEDETAILS(obj_smhr_leave);
            RG_ViewHistory.DataSource = dt_FormData;
            RG_ViewHistory.DataBind();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_LeaveHistory", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Session.Remove("WRITEFACILITY");

            SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

            _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
            _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
            _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("Mapping Vote Codes");//TRAINING APPROVAL");
            DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
            if (dtformdtls.Rows.Count != 0)
            {
                if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                {
                    Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                }
                else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                {
                    Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                }
                else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                {
                    Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                }
            }
            else
            {
                smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                Response.Redirect("~/frm_UnAuthorized.aspx", false);
            }
            if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
            {
                //RG_TrainingApproval.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                btn_submit.Visible = false;
                // btn_Update.Visible = false;
            }
            else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
            {
                smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                Response.Redirect("~/frm_UnAuthorized.aspx", false);
            }
            LoadPeriod();
        }
    }
    /// <summary>
    /// page load methos
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                loadBusinessUnit();
                rgd_AttDtls_Emp.Visible       = false;
                lbl_AttDtls_Training.Visible  = false;
                rcmb_Attdtls_Training.Visible = false;
                lbl_AttDtls_AttDt.Visible     = false;
                rdtp_AttDtls_AttDt.Visible    = false;
                Page.Validate();


                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("TRAINING ATTENDANCE DETAILS");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    rcmb_Attdtls_BU.Enabled = false;
                }
                else
                {
                    rcmb_Attdtls_BU.Enabled = true;
                }
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_trainingattendancedtls", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #22
0
    /// <summary>
    /// Here Page_Load Method...For Load a Page..
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("IDP");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }

                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    RG_Idpform.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                }
                clearfields();

                loadgrid();
                RG_Idpform.DataBind();
                RM_Idpform.SelectedIndex = 0;
                RP_Idpform.Visible       = true;
                RP_Idpform2.Visible      = false;
            }
            Page.Validate();
            //RDP_StartDate.MinDate = DateTime.Now;
            //RDP_EndDate.MinDate = DateTime.Now;
        }

        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");
        }
    }
Example #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (RWM_POSTREPLY1.Windows.Count > 0)
        {
            RWM_POSTREPLY1.Windows.RemoveAt(0);
        }
        if (!IsPostBack)
        {
            Page.Validate();
            // BindExpen
        }
        try
        {
            //code for security privilage
            Session.Remove("WRITEFACILITY");

            SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

            _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
            _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
            _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("COUNTRY");
            DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
            if (dtformdtls.Rows.Count != 0)
            {
                if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                {
                    Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                }
                else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                {
                    Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                }
                else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                {
                    Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                }
            }



            if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
            {
                Rg_MedicalClaim.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                btn_Save.Visible   = false;
                btn_Update.Visible = false;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_AVC", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    private void LoadBusinessUnit()
    {
        try
        {
            obj_smhr_Businessunit              = new SMHR_BUSINESSUNIT();
            obj_smhr_Period                    = new SMHR_PERIOD();
            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);
            rcmb_BusinessUnit.DataSource     = dt_BUDetails;
            rcmb_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
            rcmb_BusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
            rcmb_BusinessUnit.DataBind();
            //rcmb_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select"));
            rcmb_BusinessUnit.Items.Insert(0, new RadComboBoxItem(Convert.ToString(Session["ORG_NAME"])));

            //if (Convert.ToString(Session["SELFSERVICE"]) == "ADMIN")
            //{
            //    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);
            //    rcmb_BusinessUnit.DataSource = dt_BUDetails;
            //    rcmb_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
            //    rcmb_BusinessUnit.DataTextField = "BUSINESSUNIT_CODE";
            //    rcmb_BusinessUnit.DataBind();
            //    rcmb_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select"));
            //    rcmb_BusinessUnit.Items.Insert(1, new RadComboBoxItem("All"));
            //    //int itemCount = rcmb_BusinessUnit.Items.Count;
            //    //rcmb_BusinessUnit.Items.Insert(itemCount+1,new RadComboBoxItem("All"));
            //}
            //else
            //{
            //    _obj_smhr_emp_payitems = new SMHR_EMP_PAYITEMS();
            //    _obj_smhr_emp_payitems.EMP_ID = Convert.ToInt32(Session["EMP_ID"]);
            //    _obj_smhr_emp_payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            //    _obj_smhr_emp_payitems.OPERATION = operation.Self;
            //    DataTable dt_BU = BLL.get_EmpDetails(_obj_smhr_emp_payitems);
            //    rcmb_BusinessUnit.DataSource = dt_BU;
            //    rcmb_BusinessUnit.DataTextField = "BUSINESSUNIT_CODE";
            //    rcmb_BusinessUnit.DataValueField = "EMP_BUSINESSUNIT_ID";
            //    rcmb_BusinessUnit.DataBind();
            //    rcmb_BusinessUnit.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "-1"));
            //    //int itemCount = rcmb_BusinessUnit.Items.Count;
            //    //rcmb_BusinessUnit.Items.Insert(itemCount + 1, new RadComboBoxItem("All"));
            //}
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeData", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    /// <summary>
    /// page load methods
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("TRAINING APPROVAL");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    btn_Approve.Enabled = false;
                    btn_Reject.Enabled  = false;
                }
                else
                {
                    btn_Approve.Enabled = true;
                    btn_Reject.Enabled  = true;
                }

                LoadData();
                rdp_ApprovalDate.SelectedDate = DateTime.Now;
                rdp_ApprovalDate.Enabled      = false;
            }
            //ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "function pageLoad(){ }", true);
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingApproval", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                LoadGrid();
                Rg_TrgFeedback.DataBind();
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("ASSIGN FEEDBACK");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    RG_FeedBack.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    RG_FeedBack.Enabled = false;
                }
                else
                {
                    RG_FeedBack.Enabled = true;
                }
                Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
            }
            Page.Validate();
        }
        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");
        }
    }
Example #27
0
 private void LoadBusinessUint()
 {
     try
     {
         SMHR_LOGININFO _obj_LoginInfo = new SMHR_LOGININFO();
         control = Convert.ToString(Request.QueryString["Control"]);
         if (control != null)
         {
             _obj_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
             _obj_LoginInfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"]);
             rcmb_BusinessUnit.Items.Clear();
             rcmb_BusinessUnit.DataSource     = BLL.get_Business_Units(_obj_LoginInfo);
             rcmb_BusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
             rcmb_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
             rcmb_BusinessUnit.DataBind();
             //rcmb_BusinessUnit.Enabled = false;
             //rcmb_BusinessUnit.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
             SMHR_EMP_PAYITEMS _obj_smhr_emp_payitems = new SMHR_EMP_PAYITEMS();
             _obj_smhr_emp_payitems.OPERATION       = operation.Self;
             _obj_smhr_emp_payitems.EMP_ID          = Convert.ToInt32(Session["EMP_ID"]);
             _obj_smhr_emp_payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
             DataTable DT_SELF = BLL.get_EmpDetails(_obj_smhr_emp_payitems);
             if (DT_SELF.Rows.Count > 0)
             {
                 rcmb_BusinessUnit.SelectedIndex = rcmb_BusinessUnit.FindItemIndexByValue(DT_SELF.Rows[0]["EMP_BUSINESSUNIT_ID"].ToString());
                 LoadEmployee();
                 rcmb_EmployeeName.SelectedIndex = rcmb_EmployeeName.FindItemIndexByValue(DT_SELF.Rows[0]["EMP_ID"].ToString());
             }
             rcmb_BusinessUnit.Enabled = false;
             rcmb_EmployeeName.Enabled = false;
         }
         else
         {
             _obj_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
             _obj_LoginInfo.LOGIN_ID        = Convert.ToInt32(Session["USER_ID"]);
             rcmb_BusinessUnit.Items.Clear();
             rcmb_BusinessUnit.DataSource     = BLL.get_Business_Units(_obj_LoginInfo);
             rcmb_BusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
             rcmb_BusinessUnit.DataValueField = "BUSINESSUNIT_ID";
             rcmb_BusinessUnit.DataBind();
             rcmb_BusinessUnit.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
             rcmb_BusinessUnit.Enabled = true;
             rcmb_EmployeeName.Enabled = true;
             rcmb_EmployeeName.Items.Clear();
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_LoanDeposits", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
Example #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                LoadCombos();
                loadLeaveStruct();
            }


            Session.Remove("WRITEFACILITY");

            SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

            _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
            _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
            _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("LEAVE OPENING BALANCES");
            DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
            if (dtformdtls.Rows.Count != 0)
            {
                if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                {
                    Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                }
                else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                {
                    Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                }
                else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                {
                    Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                }
            }



            if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
            {
                RG_Details.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                RG_Details.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Default", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
            return;
        }
    }
Example #29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            // as the types are static and code is user editable colunm nothing loaded except grid

            if (!IsPostBack)
            {
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("MASTER COURSE");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    rg_Courses.Enabled = false;
                }
                else
                {
                    rg_Courses.Enabled = true;
                }
                loadgrid();
                rg_Courses.DataBind();
                Page.Validate();
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_CourseMaster", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Page.Validate();
            if (!Page.IsPostBack)
            {
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("TASK");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }

                //LoadGoal();

                LoadGrid();
                Rp_TASK_VIEWMAIN.Visible    = true;
                Rp_TASK_VIEWDETAILS.Visible = false;
                //rdtp_DATE.MinDate = DateTime.Now;
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    Rg_Task.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                }
            }
        }

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