Ejemplo n.º 1
0
        public void BindgvReport()
        {
            PaySlipBl         objPaySlipBl = new PaySlipBl();
            ApplicationResult objResult    = new ApplicationResult();

            objResult = objPaySlipBl.Select_EmployeeDetail_ForPaySlipPrint(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]), Convert.ToInt32(hfEmployeeMID.Value), Convert.ToInt32(ddlMonth.SelectedValue), Convert.ToInt32(ddlYear.SelectedValue), 0);
            if (objResult != null)
            {
                dlPaySlip.DataSource       = null;
                dlPaySlip1.DataSource      = null;
                dlPaySlipOffice.DataSource = null;

                dlPaySlip.DataSource       = objResult.resultDT;
                dlPaySlip1.DataSource      = objResult.resultDT;
                dlPaySlipOffice.DataSource = objResult.resultDT;
                dlPaySlip.DataBind();
                dlPaySlip1.DataBind();
                dlPaySlipOffice.DataBind();
                if (objResult.resultDT.Rows.Count > 0)
                {
                    dlPaySlip.Visible              = true;
                    dlPaySlip1.Visible             = true;
                    dlPaySlipOffice.DataSource     = null;
                    divReport.Visible              = true;
                    pnlEmployeePayrollInfo.Visible = false;
                    btnPrintDetail.Visible         = true;
                }
                else
                {
                    ClearAll();
                    ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('No Record Found.');", true);
                }
            }
        }
Ejemplo n.º 2
0
        protected void dlPaySlipOffice_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            try
            {
                if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
                {
                    PaySlipBl         objPaySlipBl = new PaySlipBl();
                    ApplicationResult objResult    = new ApplicationResult();

                    GridView gvEarning = new GridView();
                    gvEarning = (GridView)e.Item.FindControl("gvEarning12");
                    GridView gvDeduction = new GridView();
                    gvDeduction = (GridView)e.Item.FindControl("gvDeduction12");
                    GridView gvLeave = new GridView();
                    gvLeave = (GridView)e.Item.FindControl("gvLeave12");
                    Label lblMonth = (Label)e.Item.FindControl("lblMonth12");
                    lblMonth.Text = ddlMonth.SelectedItem.ToString() + " " + ddlYear.SelectedItem.ToString();
                    Label           lblAmountInWords = (Label)e.Item.FindControl("lblAmountInWords12");
                    CommonFunctions objFuction       = new CommonFunctions();
                    string          strAmount        = objFuction.ConvertInWords(Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "NetSalary").ToString()));
                    lblAmountInWords.Text = Convert.ToString(strAmount);
                    objResult             = objPaySlipBl.Select_EmployeeDetail_ForPaySlipPrint(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]), Convert.ToInt32(hfEmployeeMID.Value), Convert.ToInt32(ddlMonth.SelectedValue), Convert.ToInt32(ddlYear.SelectedValue), 1);
                    if (objResult != null)
                    {
                        gvEarning.DataSource = null;
                        //gvReport.DataSource = null;
                        gvEarning.DataSource = objResult.resultDT;
                        gvEarning.DataBind();
                        if (objResult.resultDT.Rows.Count > 0)
                        {
                            gvEarning.Visible = true;
                        }
                    }
                    objResult = objPaySlipBl.Select_EmployeeDetail_ForPaySlipPrint(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]), Convert.ToInt32(hfEmployeeMID.Value), Convert.ToInt32(ddlMonth.SelectedValue), Convert.ToInt32(ddlYear.SelectedValue), 2);
                    if (objResult != null)
                    {
                        gvDeduction.DataSource = null;
                        //gvReport.DataSource = null;
                        gvDeduction.DataSource = objResult.resultDT;
                        gvDeduction.DataBind();
                        if (objResult.resultDT.Rows.Count > 0)
                        {
                            gvDeduction.Visible = true;
                        }
                    }
                    objResult = objPaySlipBl.Select_EmployeeDetail_ForPaySlipPrint(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]), Convert.ToInt32(hfEmployeeMID.Value), Convert.ToInt32(ddlMonth.SelectedValue), Convert.ToInt32(ddlYear.SelectedValue), 3);
                    if (objResult != null)
                    {
                        gvLeave.DataSource = null;
                        //gvReport.DataSource = null;
                        gvLeave.DataSource = objResult.resultDT;
                        gvLeave.DataBind();
                        if (objResult.resultDT.Rows.Count > 0)
                        {
                            gvLeave.Visible = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
            }
        }