protected void btn_Correct_Click(object sender, EventArgs e)
    {
        try
        {
            if (rtxt_AccountNo.Text.Length != 12)
            {
                BLL.ShowMessage(this, "Account Number Should be 12 Chars Length");
                return;
            }
            _obj_smhr_empbnkdetails                      = new SMHR_EMPBNKDTLS();
            _obj_smhr_empbnkdetails.OPERATION            = operation.Update;
            _obj_smhr_empbnkdetails.EMPBNKDTLS_EMPID     = Convert.ToInt32(rcmb_Employee.SelectedItem.Value);
            _obj_smhr_empbnkdetails.BUSUNITBANK_BANKID   = Convert.ToInt32(rcmb_Bank.SelectedItem.Value);
            _obj_smhr_empbnkdetails.BUSUNITBANK_BRANCHID = Convert.ToInt32(rcmb_Branch.SelectedItem.Value);
            _obj_smhr_empbnkdetails.BUSUNTBANK_ADDRESS   = Convert.ToString(rtxt_Address.Text.Replace("'", "''"));
            _obj_smhr_empbnkdetails.BUSUNTBANK_ACCOUNTNO = Convert.ToString(rtxt_AccountNo.Text);
            _obj_smhr_empbnkdetails.BUSUNTBANK_SWIFT     = Convert.ToString(rtxt_SwiftCode.Text.Replace("'", "''"));
            if (rcmb_Active.SelectedValue == "1")
            {
                _obj_smhr_empbnkdetails.BUSUNTBANK_ISACTIVE = true;
            }
            else
            {
                _obj_smhr_empbnkdetails.BUSUNTBANK_ISACTIVE = false;
            }

            if (chk_Default.Checked)
            {
                _obj_smhr_empbnkdetails.BUSUNTBANK_ISDEFAULT = true;
            }
            else
            {
                _obj_smhr_empbnkdetails.BUSUNTBANK_ISDEFAULT = false;
            }
            _obj_smhr_empbnkdetails.BUSUNTBANK_LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]);
            _obj_smhr_empbnkdetails.BUSUNTBANK_LASTMDFDATE = DateTime.Now;
            _obj_smhr_empbnkdetails.EMPBNKDTLS_ID          = Convert.ToInt32(_lbl_ID);
            _obj_smhr_empbnkdetails.ORGANISATION_ID        = Convert.ToInt32(Session["ORG_ID"]);
            bool status = BLL.set_Identification(_obj_smhr_empbnkdetails);
            if (status == true)
            {
                BLL.ShowMessage(this, "Employee Bank Details Updated Successfully");
                LoadData();
                RG_Identification.DataBind();
                MarkData();
                RMP_Identification.SelectedIndex = 0;
                return;
            }
            else
            {
                BLL.ShowMessage(this, "Error Occured while doing the Process");
                return;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmempidentification", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
 private void LoadData()
 {
     try
     {
         rcb_Type.Items.Clear();
         rcb_Type.Text = string.Empty;
         LoadIdentificationType();
         rcb_Type.SelectedIndex      = 0;
         rdp_ExpiryDate.SelectedDate = null;
         rdp_IssueDate.SelectedDate  = null;
         rtb_Code.Text                      = string.Empty;
         rtxt_IssuedOrg.Text                = string.Empty;
         rtxt_Name.Text                     = string.Empty;
         rcb_Type.Enabled                   = true;
         rtb_Code.Enabled                   = true;
         rtxt_IssuedOrg.Enabled             = true;
         _obj_smhr_identification           = new SMHR_IDENTIFICATION();
         _obj_smhr_identification.OPERATION = operation.Check;
         //if (Convert.ToString(Session["SELF"]) == "SELF_IDENTIFICATION")
         if (Control != null)
         {
             if ((Convert.ToString(Session["SELFSERVICE"]) == "true" && Control.ToUpper() == "SELFIDENTIFICATION") || (Convert.ToString(Session["SELFSERVICE"]) == "" && Control.ToUpper() == "SELFIDENTIFICATION"))
             {
                 _obj_smhr_identification.IDNTMASTER_EMPID = Convert.ToInt32(Session["EMP_ID"]);
             }
         }
         else
         {
             _obj_smhr_identification.IDNTMASTER_EMPID = Convert.ToInt32(rcb_Employee.SelectedItem.Value);
         }
         _obj_smhr_identification.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         DataTable dt = BLL.get_IdentityDetails(_obj_smhr_identification);
         if (dt.Rows.Count != 0)
         {
             lbl_Message.Visible          = false;
             RG_Identification.Visible    = true;
             RG_Identification.DataSource = dt;
             RG_Identification.DataBind();
         }
         else
         {
             lbl_Message.Visible       = true;
             RG_Identification.Visible = false;
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Identification", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
         return;
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                RMP_Identification.SelectedIndex = 0;
                LoadData();
                RG_Identification.DataBind();
                MarkData();
                tr1.Visible = false;
            }
            default1.Visible = false;

            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("IDENTIFICATION");
            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_Identification.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                btn_Add.Visible     = false;
                btn_Correct.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);
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmempidentification", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #4
0
    protected void btn_Correct_Click(object sender, EventArgs e)
    {
        try
        {
            //chk_Default.Attributes.Add("onclick", "return checkboxClick(this)");
            //btn_Correct.Attributes.Add("onclick", "return checkbox();");
            //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "checkbox();", true);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "checkbox();", true);
            _obj_smhr_BusinessUnit                 = new SMHR_BUSINESSUNIT();
            _obj_smhr_BusinessUnit.OPERATION       = operation.Get_BULocalization;
            _obj_smhr_BusinessUnit.BUSINESSUNIT_ID = Convert.ToInt32(rcmb_BusinessUnit.SelectedValue);
            _obj_smhr_BusinessUnit.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dtBuLocalization = BLL.get_BusinessUnit(_obj_smhr_BusinessUnit);
            if (Convert.ToString(lbl_SwiftCode.Text).Trim() == "BSB Number" && rtxt_SwiftCode.Text == string.Empty)
            {
                BLL.ShowMessage(this, "Please Enter " + lbl_SwiftCode.Text);
                return;
            }
            if (dtBuLocalization.Rows.Count > 0)
            {
                if (!(Convert.ToString(dtBuLocalization.Rows[0]["HR_MASTER_CODE"]).ToUpper() == "KENYA"))
                {
                    if (rtxt_AccountNo.Text.Length > 20)
                    {
                        BLL.ShowMessage(this, "Account Number Should be Less Than 20 Chars Length");
                        return;
                    }
                }
                else
                {
                }
            }
            //if (rtxt_AccountNo.Text.Length != 12)
            //{
            //    BLL.ShowMessage(this, "Account Number Should be 12 Chars Length");
            //    return;
            //}

            if (rcmb_Branch.SelectedIndex > 0)
            {
                if (rcmb_Active.SelectedItem.Text == "Active")
                {
                    if (lbl_acc.Text != Convert.ToString(rtxt_AccountNo.Text.Replace("'", "''")))
                    {
                        bool status1 = chkAcctNo();
                        if (status1 == true)
                        {
                            BLL.ShowMessage(this, "Employee Details Exist Already");
                            return;
                        }
                    }
                    //DataTable dt = new DataTable();
                    //_obj_smhr_empbnkdetails.EMPBNKDTLS_ID = Convert.ToInt32(HF_ID.Value);//Convert.ToInt32(_lbl_ID);
                    //_obj_smhr_empbnkdetails.OPERATION = operation.Validate;
                    //dt = BLL.get_BankDetCheck(_obj_smhr_empbnkdetails);
                    //if (Convert.ToInt32(dt.Rows[0][0]) >= 1)
                    //{

                    //    BLL.ShowMessage(this, "Employee Details Exist Already");
                    //    return;
                    //}
                    //_obj_smhr_empbnkdetails.OPERATION = operation.Update;
                }

                _obj_smhr_empbnkdetails = new SMHR_EMPBNKDTLS();
                _obj_smhr_empbnkdetails.EMPBNKDTLS_EMPID     = Convert.ToInt32(rcmb_Employee.SelectedItem.Value);
                _obj_smhr_empbnkdetails.BUSUNITBANK_BANKID   = Convert.ToInt32(rcmb_Bank.SelectedItem.Value);
                _obj_smhr_empbnkdetails.BUSUNITBANK_BRANCHID = Convert.ToInt32(rcmb_Branch.SelectedItem.Value);
                _obj_smhr_empbnkdetails.BUSUNTBANK_ADDRESS   = Convert.ToString(rtxt_Address.Text.Replace("'", "''"));
                _obj_smhr_empbnkdetails.BUSUNTBANK_ACCOUNTNO = Convert.ToString(rtxt_AccountNo.Text);
                _obj_smhr_empbnkdetails.BUSUNTBANK_SWIFT     = Convert.ToString(rtxt_SwiftCode.Text.Replace("'", "''"));
                if (rcmb_Active.SelectedValue == "1")
                {
                    _obj_smhr_empbnkdetails.BUSUNTBANK_ISACTIVE = true;
                }
                else
                {
                    _obj_smhr_empbnkdetails.BUSUNTBANK_ISACTIVE = false;
                }

                if (chk_Default.Checked)
                {
                    _obj_smhr_empbnkdetails.BUSUNTBANK_ISDEFAULT = true;
                }
                else
                {
                    _obj_smhr_empbnkdetails.BUSUNTBANK_ISDEFAULT = false;
                }
                _obj_smhr_empbnkdetails.BUSUNTBANK_LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]);
                _obj_smhr_empbnkdetails.BUSUNTBANK_LASTMDFDATE = DateTime.Now;
                _obj_smhr_empbnkdetails.EMPBNKDTLS_ID          = Convert.ToInt32(HF_ID.Value);//Convert.ToInt32(_lbl_ID);
                _obj_smhr_empbnkdetails.ORGANISATION_ID        = Convert.ToInt32(Session["ORG_ID"]);

                _obj_smhr_empbnkdetails.OPERATION = operation.Update;
                _obj_smhr_empbnkdetails.BUSUNTBANK_LASTMDFDATE = DateTime.Now;
                bool status = BLL.set_Identification(_obj_smhr_empbnkdetails);

                if (status == true)
                {
                    BLL.ShowMessage(this, "Employee Bank Details Updated Successfully");
                    LoadData();
                    MarkData();
                    RG_Identification.DataBind();
                    RMP_Identification.SelectedIndex = 0;
                    return;
                }
                else
                {
                    BLL.ShowMessage(this, "Error Occured while doing the Process");
                    return;
                }
            }
            else
            {
                BLL.ShowMessage(this, "Select Branch Name");
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmempbankdetails", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #5
0
    protected void btn_Add_Click(object sender, EventArgs e)
    {
        try
        {
            if (rcmb_BusinessUnit.SelectedValue == "")
            {
                BLL.ShowMessage(this, "Please Select Business Unit");
                return;
            }
            if (rcmb_Employee.SelectedValue == "")
            {
                BLL.ShowMessage(this, "Please Select Employee");
                return;
            }
            if (rcmb_Bank.SelectedValue == "")
            {
                BLL.ShowMessage(this, "Please Select Bank");
                return;
            }
            if (rcmb_Branch.SelectedValue == "")
            {
                BLL.ShowMessage(this, "Please Select Branch");
                return;
            }

            if (rtxt_AccountNo.Text == "")
            {
                BLL.ShowMessage(this, "Please Provide Account No");
                return;
            }
            //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "checkboxClick(this);", true);
            bool   status1      = chkAcctNo();
            string Localisation = string.Empty;
            if (status1 == false)
            {
                _obj_smhr_BusinessUnit                 = new SMHR_BUSINESSUNIT();
                _obj_smhr_BusinessUnit.OPERATION       = operation.Get_BULocalization;
                _obj_smhr_BusinessUnit.BUSINESSUNIT_ID = Convert.ToInt32(rcmb_BusinessUnit.SelectedValue);
                _obj_smhr_BusinessUnit.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                DataTable dtBuLocalization = BLL.get_BusinessUnit(_obj_smhr_BusinessUnit);
                if (Convert.ToString(lbl_SwiftCode.Text).Trim() == "BSB Number" && rtxt_SwiftCode.Text == string.Empty)
                {
                    BLL.ShowMessage(this, "Please Enter " + lbl_SwiftCode.Text);
                    return;
                }
                if (dtBuLocalization.Rows.Count > 0)
                {
                    if (!(Convert.ToString(dtBuLocalization.Rows[0]["HR_MASTER_CODE"]).ToUpper() == "KENYA"))
                    {
                        if (rtxt_AccountNo.Text.Length > 20)
                        {
                            BLL.ShowMessage(this, "Account Number Should be Less Than 20 Chars Length");
                            return;
                        }
                    }
                    else
                    {
                    }
                }
                //if (rtxt_AccountNo.Text.Length != 12)
                //{
                //    BLL.ShowMessage(this, "Account Number Should be 12 Chars Length");
                //    return;
                //}
                if (rcmb_Branch.SelectedIndex > 0)
                {
                    _obj_smhr_empbnkdetails = new SMHR_EMPBNKDTLS();
                    _obj_smhr_empbnkdetails.EMPBNKDTLS_EMPID     = Convert.ToInt32(rcmb_Employee.SelectedItem.Value);
                    _obj_smhr_empbnkdetails.BUSUNITBANK_BANKID   = Convert.ToInt32(rcmb_Bank.SelectedItem.Value);
                    _obj_smhr_empbnkdetails.BUSUNITBANK_BRANCHID = Convert.ToInt32(rcmb_Branch.SelectedItem.Value);
                    _obj_smhr_empbnkdetails.BUSUNTBANK_ADDRESS   = Convert.ToString(rtxt_Address.Text.Replace("'", "''"));
                    _obj_smhr_empbnkdetails.BUSUNTBANK_ACCOUNTNO = Convert.ToString(rtxt_AccountNo.Text);
                    _obj_smhr_empbnkdetails.BUSUNTBANK_SWIFT     = Convert.ToString(rtxt_SwiftCode.Text.Replace("'", "''"));
                    if (rcmb_Active.SelectedValue == "1")
                    {
                        _obj_smhr_empbnkdetails.BUSUNTBANK_ISACTIVE = true;
                    }
                    else
                    {
                        _obj_smhr_empbnkdetails.BUSUNTBANK_ISACTIVE = false;
                    }

                    if (chk_Default.Checked)
                    {
                        _obj_smhr_empbnkdetails.BUSUNTBANK_ISDEFAULT = true;
                    }
                    else
                    {
                        _obj_smhr_empbnkdetails.BUSUNTBANK_ISDEFAULT = false;
                    }
                    _obj_smhr_empbnkdetails.BUSUNTBANK_CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_empbnkdetails.BUSUNTBANK_CREATEDDATE = DateTime.Now;
                    _obj_smhr_empbnkdetails.ORGANISATION_ID        = Convert.ToInt32(Session["ORG_ID"]);
                    if (Convert.ToString(_obj_smhr_empbnkdetails.BUSUNTBANK_SWIFT) != string.Empty)
                    {
                        _obj_smhr_empbnkdetails.OPERATION = operation.Validate1;
                        DataTable dt_Check = BLL.get_BankDetCheck(_obj_smhr_empbnkdetails);
                        if (dt_Check.Rows.Count > 0)
                        {
                            if (Convert.ToString(dt_Check.Rows[0]["COUNT"]) != "0")
                            {
                                if (Convert.ToString(dtBuLocalization.Rows[0]["HR_MASTER_CODE"]).ToUpper() == "AUSTRALIA")
                                {
                                    BLL.ShowMessage(this, "BSB Code Already Exist for the Employee");
                                }
                                else
                                {
                                    BLL.ShowMessage(this, "Swift Code Already Exist for the Employee");
                                }
                                return;
                            }
                        }
                    }
                    if (rcmb_Active.SelectedItem.Text == "Active")
                    {
                        _obj_smhr_empbnkdetails.OPERATION = operation.Validate;
                        DataTable dt = new DataTable();
                        dt = BLL.get_BankDetCheck(_obj_smhr_empbnkdetails);
                        if (Convert.ToInt32(dt.Rows[0][0]) >= 1)
                        {
                            BLL.ShowMessage(this, "Employee Bank Details Already Exist");
                            return;
                        }
                    }
                    _obj_smhr_empbnkdetails.OPERATION = operation.Insert;
                    bool status = BLL.set_Identification(_obj_smhr_empbnkdetails);
                    if (status == true)
                    {
                        BLL.ShowMessage(this, "Employee Bank Details Saved Successfully");
                        LoadData();
                        MarkData();
                        RG_Identification.DataBind();//Modified By Me Grid Is Loading In Mask data
                        RMP_Identification.SelectedIndex = 0;
                        return;
                    }
                    else
                    {
                        BLL.ShowMessage(this, "Error Occured while doing the Process");
                        return;
                    }
                }
                else
                {
                    BLL.ShowMessage(this, "Select Branch Name");
                }
            }
            else
            {
                BLL.ShowMessage(this, "Account Number is already Defined");
                rtxt_AccountNo.Focus();
                return;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmempbankdetails", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Control = Convert.ToString(Request.QueryString["Control"]);
        try
        {
            if (!Page.IsPostBack)
            {
                //code for security privilage
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();
                if (Control != null)
                {
                    if (Control.ToUpper() == "SELFBANKDETAILS")
                    {
                        _obj_Smhr_LoginInfo.LOGIN_ID        = 12;
                        _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("EMPLOYEE BANK DETAILS");
                    }
                }
                else
                {
                    _obj_Smhr_LoginInfo.LOGIN_ID        = 2;
                    _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("EMPLOYEE BANK DETAILS");
                }
                _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("EMPLOYEE BANK 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
                    }
                }
                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_Identification.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    btn_Correct.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);
                }

                RMP_Identification.SelectedIndex = 0;
                if (Control != null && Convert.ToInt32(Session["EMP_ID"]) == 0)
                {
                    BLL.ShowMessage(this, "You do not have Access on this Screen.");
                }
                LoadData();
                MarkData();
                RG_Identification.DataBind();
                tr1.Visible = false;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmempbankdetails", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }



        //if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
        //{
        //    RG_Identification.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
        //    btn_Add.Visible = false;
        //    btn_Correct.Visible = false;
        //}
        //default1.Visible = false;
    }