Example #1
0
    private void LoadGrid()
    {
        try
        {
            _obj_smhr_payroll           = new SMHR_PAYROLL();
            _obj_smhr_payroll.OPERATION = operation.Check;
            _obj_smhr_payroll.MODE      = 2;
            _obj_smhr_payroll.TRANID    = Convert.ToInt32(rcb_Paytran.SelectedItem.Value);
            dt_Details            = new DataTable();
            dt_Details            = BLL.get_Payroll(_obj_smhr_payroll);
            RG_PayTran.DataSource = dt_Details;
            RG_PayTran.DataBind();
            int   i       = 0;
            int   j       = 0;
            Label lbl_Amt = new Label();
            for (i = 0; i < RG_PayTran.Items.Count; i++)
            {
                lbl_Amt = RG_PayTran.Items[i].FindControl("lblAmount") as Label;
                if (lbl_Amt.Text.StartsWith("-"))
                {
                    lbl_Amt.BackColor = System.Drawing.Color.Red;
                    lbl_Amt.ToolTip   = "Negative Balance for this Employee";
                    j = j + 1;
                }
            }
            if (j > 0)
            {
                btn_Approve.Enabled = true;
                btn_Reject.Enabled  = true;
                BLL.ShowMessage(this, "There are employee(s) with negative balance");
            }
            else
            {
                //code for security
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    btn_Approve.Enabled = false;
                    btn_Reject.Enabled  = false;
                }

                else
                {
                    btn_Approve.Enabled = true;
                    btn_Reject.Enabled  = true;
                }
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayrollApproval", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
            return;
        }
    }
 private void LoadDetails()
 {
     try
     {
         _obj_smhr_payreject        = new SMHR_PAYREJECT();
         _obj_smhr_payreject.MODE   = 2;
         _obj_smhr_payreject.TRANID = Convert.ToInt32(Convert.ToString(Request.QueryString["ID"]));
         DataTable dt = BLL.get_payrejectEmpDet(_obj_smhr_payreject);
         RG_PayTran.DataSource = dt;
         RG_PayTran.DataBind();
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayRejectHist", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
 private void LoadGrid()
 {
     try
     {
         _obj_smhr_payroll           = new SMHR_PAYROLL();
         _obj_smhr_payroll.OPERATION = operation.Check;
         _obj_smhr_payroll.MODE      = 2;
         _obj_smhr_payroll.TRANID    = Convert.ToInt32(Convert.ToString(Request.QueryString["ID"]));
         DataTable dt_Details = BLL.get_Payroll(_obj_smhr_payroll);
         RG_PayTran.DataSource = dt_Details;
         RG_PayTran.DataBind();
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_tranDetails", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }