Пример #1
0
        protected void btnpreview_OnClick(object sender, EventArgs e)
        {
            txtiddisplay.Visible = true;

            if (string.IsNullOrWhiteSpace(txtsearch.Text.ToString()))
            {
                //Encodings.MsgBox("! Criteria is Empty !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Criteria is Empty !', 'error');", true);
            }
            else
            {
                Session["STIN"] = txtsearch.Text.ToString();

                var stringstin = Session["STIN"].ToString();


                string strquery = String.Format("SELECT * FROM ViewCertificateInformation WHERE MerchantCode='{0}' AND PayerUtin= '{1}'", sessions.MerchantCode.ToString(), stringstin.ToString());

                if (Encodings.IsValidUser(strquery))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('ViewCertificate.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    //Encodings.MsgBox("! No Record Found for the Selected Range !", this.Page, this);
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', ' No Record Found for the Selected Range !', 'info');", true);
                }
            }
        }
Пример #2
0
        protected void btnpreview_Click(object sender, EventArgs e)
        {
            if ((ddlto.SelectedValue.ToString() == "0") || (ddlyear.SelectedValue.ToString() == "0"))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Criteria is Empty !', 'error');", true);
            }
            else if (Convert.ToInt32(ddlto.SelectedValue.ToString()) < Convert.ToInt32(ddlyear.SelectedValue.ToString()))
            {
                //Response.Write("<script>alert('" + " Year To Can not be less than Year from" + "')</script>");
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Year To Can not be less than Year from!', 'error');", true);
            }
            else
            {
                txtiddisplay.Visible = true;
                Session["yearFrom"]  = ddlyear.SelectedValue.ToString();
                Session["yearTo"]    = ddlto.SelectedValue.ToString();

                if (Encodings.IsValidUser(String.Format("SELECT COUNT( DISTINCT TccNo) Reccount,   COUNT(DISTINCT CASE WHEN IncomeSourceClassifyId = 1 THEN TccNo END) AS DA, COUNT(DISTINCT CASE WHEN IncomeSourceClassifyId = 2 THEN TccNo END) AS PA, COUNT(DISTINCT CASE WHEN IncomeSourceClassifyId = 3 THEN TccNo END) AS PN, COUNT(DISTINCT CASE WHEN IncomeSourceClassifyId = 4 THEN TccNo END) AS ST, COUNT(DISTINCT CASE WHEN IncomeSourceClassifyId = 5 THEN TccNo END ) AS NR, COUNT(DISTINCT CASE WHEN IncomeSourceClassifyId = 6 THEN  TccNo END ) AS UE, COUNT(DISTINCT CASE WHEN IncomeSourceClassifyId = 7 THEN TccNo END) AS DU FROM dbo.ViewTccDetails WHERE YEAR(IssuedDate) BETWEEN {0} AND {1} AND AssessmentYear = YEAR(IssuedDate) - 1 ", ddlyear.SelectedValue, ddlto.SelectedValue)))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('ViewCummulativeSummary.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    //Response.Write("<script>alert('" + " No record for the Selected Year " + "')</script>");
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', ' No Record Found for the Selected Year !', 'info');", true);
                }
            }
        }
        protected void btnpreview_Click(object sender, EventArgs e)
        {
            Session["yearFrom"] = ddlyear.SelectedValue.ToString();
            Session["yearTo"]   = ddlto.SelectedValue.ToString();

            if (Convert.ToInt32(ddlto.SelectedValue.ToString()) < Convert.ToInt32(ddlyear.SelectedValue.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Year To Can not be less than Year from !', 'error');", true);
            }
            else
            {
                txtiddisplay.Visible = true;

                if (Encodings.IsValidUser(String.Format("SELECT a.AssessmentYear, COUNT(DISTINCT a.AssessmentNo) AS Reccount, SUM(a.TaxPayable) TotalPayable, COUNT(DISTINCT CASE  WHEN a.IncomeSourceClassifyId = 1 THEN a.AssessmentNo END ) AS DA, COUNT(DISTINCT CASE WHEN a.IncomeSourceClassifyId = 2 THEN a.AssessmentNo END) AS PA, COUNT(DISTINCT CASE WHEN a.IncomeSourceClassifyId = 3 THEN  a.AssessmentNo END ) AS PN,COUNT(DISTINCT CASE WHEN a.IncomeSourceClassifyId = 4 THEN a.AssessmentNo  END ) AS ST, COUNT(DISTINCT CASE WHEN a.IncomeSourceClassifyId = 5 THEN a.AssessmentNo END ) AS NR, COUNT(DISTINCT CASE WHEN a.IncomeSourceClassifyId = 6 THEN a.AssessmentNo END) AS UE,COUNT(DISTINCT CASE WHEN a.IncomeSourceClassifyId = 7 THEN a.AssessmentNo END) AS DU, COALESCE(SUM( CASE WHEN a.IncomeSourceClassifyId = 1 THEN a.TaxPayable END), 0) DAAmount,COALESCE(SUM(CASE WHEN a.IncomeSourceClassifyId = 2 THEN a.TaxPayable END),0) PAAmount,COALESCE(SUM(CASE WHEN a.IncomeSourceClassifyId = 3 THEN a.TaxPayable END ), 0) PNAmount,COALESCE(SUM( CASE WHEN a.IncomeSourceClassifyId = 4 THEN a.TaxPayable END ),0 ) STAmount, COALESCE(SUM(CASE WHEN a.IncomeSourceClassifyId = 5 THEN a.TaxPayable END),0) NRAmount,COALESCE(SUM( CASE WHEN a.IncomeSourceClassifyId = 6 THEN a.TaxPayable END),0) UEAmount,COALESCE(SUM( CASE WHEN a.IncomeSourceClassifyId = 7 THEN a.TaxPayable END),0) DUAmount FROM ViewAssessmentInfor a WHERE a.AssessmentYear BETWEEN {0} AND {1} GROUP BY AssessmentYear ORDER BY AssessmentYear ASC", ddlyear.SelectedValue, ddlto.SelectedValue)))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('ViewAssessmentYearSummary.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! No record for the Selected Year !', 'error');", true);
                }
            }
        }
Пример #4
0
        protected void btnpreview_OnClick(object sender, EventArgs e)
        {
            txtiddisplay.Visible = true;

            if (string.IsNullOrWhiteSpace(txtstartdate.Text.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Start Date is Empty !', 'error');", true);
            }
            else if (string.IsNullOrWhiteSpace(txtenddate.Text.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date is Empty !', 'error');", true);
            }
            else if (Convert.ToDateTime(txtenddate.Text.ToString()) < Convert.ToDateTime(txtstartdate.Text.ToString()))
            {
                //Encodings.MsgBox("End Date Greater Than Start Date !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date Greater Than Start Date !', 'error');", true);
            }

            else
            {
                Session["Startdate"] = txtstartdate.Text.ToString();

                Session["Enddate"] = txtenddate.Text.ToString();

                Session["startdate1"] = Convert.ToDateTime(txtstartdate.Text.ToString());

                Session["Enddate1"] = Convert.ToDateTime(txtenddate.Text.ToString());


                var startdate = Session["Startdate"].ToString();

                var enddate = Session["Enddate"].ToString();

                var end = Convert.ToDateTime(Session["Enddate1"].ToString()).ToString("dd/MM/yyyy");

                var strat = Convert.ToDateTime(Session["startdate1"].ToString()).ToString("dd/MM/yyyy");


                if (Encodings.IsValidUser(String.Format(
                                              "SELECT RegTypeCode,  COUNT(RegTypeCode) Rec_Count, CASE WHEN RegTypeCode = 'AG' THEN 'Tax Agents' WHEN RegTypeCode = 'DA' THEN 'Self-Employed' WHEN RegTypeCode = 'PA' THEN  'Employed'  ELSE  'Adoch'  END Category FROM dbo.vwPayerInfo  WHERE PayerName IS NOT NULL AND MerchantCode='{0}' AND Datecreated BETWEEN '{1}' AND '{2}' GROUP BY RegTypeCode HAVING COUNT(RegTypeCode) > 0 ORDER BY Category asc",
                                              sessions.MerchantCode.ToString(), startdate, enddate)))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('VwSummary.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', ' No Record Found for the Selected Range !', 'info');", true);
                }
            }
        }
Пример #5
0
        public static string PostPreview(string[] agencylist, DateTime startdate, DateTime enddate)
        {
            string retvalue = String.Empty;

            string strvalue = String.Empty; int j = 0;

            int h = agencylist.Count();

            for (int i = 0; i < agencylist.Length; i++)
            {
                strvalue += String.Format("'{0}'", agencylist[i]);
                if (j + 1 < h)
                {
                    strvalue += ",";
                    ++j;
                }
            }

            HttpContext.Current.Session["Agencylist"] = strvalue;

            HttpContext.Current.Session["Startdate"] = Convert.ToDateTime(startdate);

            HttpContext.Current.Session["startdate1"] = Convert.ToDateTime(startdate);

            HttpContext.Current.Session["Enddate"] = Convert.ToDateTime(enddate);

            HttpContext.Current.Session["Enddate1"] = Convert.ToDateTime(enddate);

            var startdat = string.Format("{0:yyyy-MM-dd}", HttpContext.Current.Session["Startdate"].ToString());

            var enddat = string.Format("{0:yyyy-MM-dd}", HttpContext.Current.Session["Enddate"].ToString());

            var end = Convert.ToDateTime(HttpContext.Current.Session["Enddate1"].ToString()).ToString("yyyy/MM/dd");

            var strat = Convert.ToDateTime(HttpContext.Current.Session["startdate1"].ToString()).ToString("yyyy/MM/dd");

            var strrevenue = HttpContext.Current.Session["Agencylist"].ToString();//Session["Agencylist"].ToString();

            if (Encodings.IsValidUser(String.Format(
                                          "SELECT PayerID, TaxAgentUtin, TaxAgentName,  address,  PaymentRefNumber, Amount, RevenueOfficeID, RevenueOfficeName, RevenueCode,  PaymentDate,AgencyName,BankName FROM vwRemittance WHERE PaymentDate BETWEEN '{0}' AND '{1}' AND TaxAgentUtin IN ({2}) ORDER BY TaxAgentName ASC",
                                          strat, end, strrevenue)))
            {
                retvalue = "1";
            }
            else
            {
                retvalue = "0";
            }

            return(JsonConvert.SerializeObject(retvalue));
        }
Пример #6
0
        public static string PostPreview(DateTime startdate, DateTime enddate,
                                         string[] agencyid)
        {
            string strvalue = String.Empty; int j = 0; string retvalue = String.Empty;

            int h = agencyid.Count();

            for (int i = 0; i < agencyid.Length; i++)
            {
                strvalue += String.Format("'{0}'", agencyid[i]);
                if (j + 1 < h)
                {
                    strvalue += ",";
                    ++j;
                }
            }


            HttpContext.Current.Session["Agencylist"] = strvalue;

            HttpContext.Current.Session["Startdate"] = Convert.ToDateTime(startdate);

            HttpContext.Current.Session["startdate1"] = Convert.ToDateTime(startdate);

            HttpContext.Current.Session["Enddate"] = Convert.ToDateTime(enddate);

            HttpContext.Current.Session["Enddate1"] = Convert.ToDateTime(enddate);

            var strrevenue = HttpContext.Current.Session["Agencylist"].ToString();

            var startdat = string.Format("{0:yyyy-MM-dd}", HttpContext.Current.Session["Startdate"].ToString());

            var enddat = string.Format("{0:yyyy-MM-dd}", HttpContext.Current.Session["Enddate"].ToString());

            var end = Convert.ToDateTime(HttpContext.Current.Session["Enddate1"].ToString()).ToString("yyyy/MM/dd");

            var strat = Convert.ToDateTime(HttpContext.Current.Session["startdate1"].ToString()).ToString("yyyy/MM/dd");

            if (Encodings.IsValidUser(String.Format(
                                          "SELECT AgencyName,AgencyCode,SUM(Amount) Amount,DATEPART(YEAR,PaymentDate) Year FROM vwCollectionRaw WHERE PaymentDate BETWEEN '{0}' AND '{1}' AND AgencyCode IN ({2}) GROUP BY AgencyName,AgencyCode,DATEPART(YEAR,PaymentDate) ORDER BY AgencyName ASC",
                                          strat, end, strrevenue)))
            {
                retvalue = "1";
            }
            else
            {
                retvalue = "0";
            }

            return(JsonConvert.SerializeObject(retvalue));
        }
        protected void btnpreview_Click(object sender, EventArgs e)
        {
            //Session["yearFrom"] = ddlyear.SelectedValue.ToString();

            //Session["yearTo"] = ddlto.SelectedValue.ToString();

            if (string.IsNullOrWhiteSpace(txtstartdate.Text.ToString()) || string.IsNullOrWhiteSpace(txtenddate.Text.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Criteria is Empty !', 'error');", true);
            }
            else if (Convert.ToDateTime(txtenddate.Text.ToString()) < Convert.ToDateTime(txtstartdate.Text.ToString()))
            {
                //Encodings.MsgBox("End Date Greater Than Start Date !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date Greater Than Start Date !', 'error');", true);
            }
            else
            {
                txtiddisplay.Visible = true;
                Session["Startdate"] = txtstartdate.Text.ToString();

                Session["Enddate"] = txtenddate.Text.ToString();

                Session["startdate1"] = Convert.ToDateTime(txtstartdate.Text.ToString());

                Session["Enddate1"] = Convert.ToDateTime(txtenddate.Text.ToString());


                var startdate = Session["Startdate"].ToString();

                var enddate = Session["Enddate"].ToString();

                var end = Convert.ToDateTime(Session["Enddate1"].ToString()).ToString("dd/MM/yyyy");

                var strat = Convert.ToDateTime(Session["startdate1"].ToString()).ToString("dd/MM/yyyy");

                SqlCommand _command; SqlDataAdapter _adp; System.Data.DataSet responses = new System.Data.DataSet();

                string strquery = String.Format("SELECT * FROM ViewAssessmentInfor a WHERE a.AssessmentDate BETWEEN '{0}' AND '{1}' order by  GrossIncome desc", startdate, enddate);

                if (Encodings.IsValidUser(strquery))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('ViewAssessmentdetials.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '!  No record for the Selected Year !', 'error');", true);
                }
            }
        }
Пример #8
0
        public static string PostPreview(DateTime startdate, DateTime enddate, Int32[] officeid)
        {
            int j = 0; string retvalue = String.Empty; string strvalue = String.Empty;

            int h = officeid.Count();

            for (int i = 0; i < officeid.Length; i++)
            {
                strvalue += String.Format("'{0}'", officeid[i]);
                if (j + 1 < h)
                {
                    strvalue += ",";
                    ++j;
                }
            }

            HttpContext.Current.Session["Agencylist"] = strvalue;

            HttpContext.Current.Session["Startdate"] = Convert.ToDateTime(startdate);

            HttpContext.Current.Session["startdate1"] = Convert.ToDateTime(startdate);

            HttpContext.Current.Session["Enddate"] = Convert.ToDateTime(enddate);

            HttpContext.Current.Session["Enddate1"] = Convert.ToDateTime(enddate);

            var startdat = string.Format("{0:yyyy-MM-dd}", HttpContext.Current.Session["Startdate"].ToString());

            var enddat = string.Format("{0:yyyy-MM-dd}", HttpContext.Current.Session["Enddate"].ToString());

            var end = Convert.ToDateTime(HttpContext.Current.Session["Enddate1"].ToString()).ToString("yyyy/MM/dd");

            var strat = Convert.ToDateTime(HttpContext.Current.Session["startdate1"].ToString()).ToString("yyyy/MM/dd");

            var strrevenue = HttpContext.Current.Session["Agencylist"].ToString();

            if (Encodings.IsValidUser(String.Format(
                                          "SELECT BusinessTypeID, BusinessTypeName, SUM(Amount) AS Amount FROM dbo.vwBusinessSectors WHERE PaymentDate BETWEEN '{0}' AND '{1}' AND BusinessTypeID IN ({2}) GROUP BY BusinessTypeID, BusinessTypeName ORDER BY BusinessTypeName ASC",
                                          strat, end, strrevenue)))
            {
                retvalue = "1";
            }
            else
            {
                retvalue = "0";
            }

            return(JsonConvert.SerializeObject(retvalue));
        }
Пример #9
0
        protected void btnpreview_OnClick(object sender, EventArgs e)
        {
            //Encodings.MsgBox("You Need to Enable your Browser Pop-Up at the Top Right Corner to View the report", this.Page, this);

            txtiddisplay.Visible = true;

            if (string.IsNullOrWhiteSpace(txtstartdate.Text.ToString()) || string.IsNullOrWhiteSpace(txtenddate.Text.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Criteria is Empty !', 'error');", true);
            }
            else if (Convert.ToDateTime(txtenddate.Text.ToString()) < Convert.ToDateTime(txtstartdate.Text.ToString()))
            {
                //Encodings.MsgBox("End Date Greater Than Start Date !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date Greater Than Start Date !', 'error');", true);
            }
            else
            {
                Session["Startdate"] = txtstartdate.Text.ToString();

                Session["Enddate"] = txtenddate.Text.ToString();

                Session["startdate1"] = Convert.ToDateTime(txtstartdate.Text.ToString());

                Session["Enddate1"] = Convert.ToDateTime(txtenddate.Text.ToString());


                var startdate = Session["Startdate"].ToString();

                var enddate = Session["Enddate"].ToString();

                var end = Convert.ToDateTime(Session["Enddate1"].ToString()).ToString("dd/MM/yyyy");

                var strat = Convert.ToDateTime(Session["startdate1"].ToString()).ToString("dd/MM/yyyy");

                if (Encodings.IsValidUser(String.Format(
                                              "SELECT * FROM ViewTaxAgent WHERE MerchantCode='{0}' AND Datecreated BETWEEN '{1}' AND '{2}' ORDER BY OrganizationName ASC",
                                              sessions.MerchantCode.ToString(), startdate, enddate)))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('ViewAgent.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    //Encodings.MsgBox("! No Record Found for the Selected Range !", this.Page, this);
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', ' No Record Found for the Selected Range !', 'info');", true);
                }
            }
        }
Пример #10
0
        protected void btnpreview_OnClick(object sender, EventArgs e)
        {
            txtiddisplay.Visible = true;

            if (string.IsNullOrWhiteSpace(txtstartdate.Text.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Start Date is Empty !', 'error');", true);
            }
            else if (string.IsNullOrWhiteSpace(txtenddate.Text.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date is Empty !', 'error');", true);
            }
            else if (Convert.ToDateTime(txtenddate.Text.ToString()) < Convert.ToDateTime(txtstartdate.Text.ToString()))
            {
                //Encodings.MsgBox("End Date Greater Than Start Date !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date Greater Than Start Date !', 'error');", true);
            }
            else
            {
                var gb = Convert.ToDateTime(txtstartdate.Text.ToString());

                Session["startdate1"] = Convert.ToDateTime(txtstartdate.Text.ToString());

                Session["Enddate1"] = Convert.ToDateTime(txtenddate.Text.ToString());

                Session["Startdate"] = txtstartdate.Text.ToString();

                Session["Enddate"] = txtenddate.Text.ToString();

                // var strrevenue = Session["Revenue"].ToString();

                var startdate = Session["Startdate"].ToString();

                var enddate = Session["Enddate"].ToString();

                string strquery = String.Format("SELECT RevenueOfficeID, RevenueOfficeName, SUM(Amount) Amount FROM ViewNormalizedPayment WHERE RevenueOfficeID IS NOT NULL AND PaymentDate BETWEEN '{0}' AND '{1}' GROUP BY   RevenueOfficeID,  RevenueOfficeName ORDER BY RevenueOfficeName ASC", startdate, enddate);

                if (Encodings.IsValidUser(strquery))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('ViewNormalized.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', ' No Record Found for the Selected Range !', 'info');", true);
                }
            }
        }
Пример #11
0
        protected void btnpreview_OnClick(object sender, EventArgs e)
        {
            SqlCommand _command; SqlDataAdapter _adp; System.Data.DataSet responses = new System.Data.DataSet();

            txtiddisplay.Visible = true;
            //test if the date is empty
            if (string.IsNullOrWhiteSpace(txtstartdate.Text.ToString()) || string.IsNullOrWhiteSpace(txtenddate.Text.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Criteria is Empty !', 'error');", true);
            }
            else if (Convert.ToDateTime(txtenddate.Text.ToString()) < Convert.ToDateTime(txtstartdate.Text.ToString()))
            {
                //Encodings.MsgBox("End Date Greater Than Start Date !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date Greater Than Start Date !', 'error');", true);
            }
            else
            {
                Session["Startdate"] = txtstartdate.Text.ToString();

                Session["Enddate"] = txtenddate.Text.ToString();

                Session["startdate1"] = Convert.ToDateTime(txtstartdate.Text.ToString());

                Session["Enddate1"] = Convert.ToDateTime(txtenddate.Text.ToString());


                var startdate = Session["Startdate"].ToString();

                var enddate = Session["Enddate"].ToString();

                var end = Convert.ToDateTime(Session["Enddate1"].ToString()).ToString("dd/MM/yyyy");

                var strat = Convert.ToDateTime(Session["startdate1"].ToString()).ToString("dd/MM/yyyy");

                if (Encodings.IsValidUser(String.Format("SELECT * FROM ViewPaye WHERE MerchantCode='{0}' AND Datecreated BETWEEN '{1}' AND '{2}' ORDER BY OrganizationName ASC", sessions.MerchantCode.ToString(), startdate, enddate)))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('ViewPay.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    //Encodings.MsgBox("! No Record Found for the Selected Range !", this.Page, this);
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', ' No Record Found for the Selected Range !', 'error');", true);
                }
            }
        }
Пример #12
0
        protected void btnpreview_OnClick(object sender, EventArgs e)
        {
            txtiddisplay.Visible = true;

            if (string.IsNullOrWhiteSpace(txtstartdate.Text.ToString()) || string.IsNullOrWhiteSpace(txtenddate.Text.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Criteria is Empty !', 'error');", true);
            }
            else if (Convert.ToDateTime(txtenddate.Text.ToString()) < Convert.ToDateTime(txtstartdate.Text.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date Greater Than Start Date !', 'error');", true);
            }
            else
            {
                Session["Startdate"] = txtstartdate.Text.ToString();

                Session["Enddate"] = txtenddate.Text.ToString();

                Session["startdate1"] = Convert.ToDateTime(txtstartdate.Text.ToString());

                Session["Enddate1"] = Convert.ToDateTime(txtenddate.Text.ToString());

                //var strrevenue = Session["Agencylist"].ToString();

                var startdate = Session["Startdate"].ToString();

                var enddate = Session["Enddate"].ToString();

                var end = Convert.ToDateTime(Session["Enddate1"].ToString()).ToString("dd/MM/yyyy");

                var strat = Convert.ToDateTime(Session["startdate1"].ToString()).ToString("dd/MM/yyyy");

                if (Encodings.IsValidUser(String.Format("SELECT MerchantCode,PayerUtin,PayerID,PayerName,PaymentAmount,Amount,PaymentDate,  RequestedBy,ReceiptDate, ApprovedBy, ApprovedDate,RequestName, ApproveName,PayerType, PayerTypeName FROM dbo.vwPaymentNormalisations WHERE PaymentDate BETWEEN '{0}' AND '{1}' AND MerchantCode= '{2}'",
                                                        startdate, enddate, sessions.MerchantCode.ToString())))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('ViewNormalisation.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', ' No Record Found for the Selected Range !', 'info');", true);
                }
            }
        }
Пример #13
0
        protected void btnpreview_Click(object sender, EventArgs e)
        {
            //int totalCount = gridOffence.Rows.Cast<GridViewRow>()
            //              .Count(r => ((CheckBox)r.FindControl("CheckBox1")).Checked);

            if (string.IsNullOrWhiteSpace(txtstartdate.Text.ToString()) || string.IsNullOrWhiteSpace(txtenddate.Text.ToString()))
            {
                //Encodings.MsgBox("! Criteria is Empty !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Criteria is Empty !', 'error');", true);
            }
            else if (Convert.ToDateTime(txtenddate.Text.ToString()) < Convert.ToDateTime(txtstartdate.Text.ToString()))
            {
                //Encodings.MsgBox("End Date Greater Than Start Date !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date Greater Than Start Date !', 'error');", true);
            }
            else
            {
                //foreach (GridViewRow row in gridOffence.Rows)
                //{
                //    CheckBox chk = (CheckBox)row.FindControl("CheckBox1");

                //    Label lbltin = (Label)row.FindControl("lbltin");

                //    if (chk != null & chk.Checked)
                //    {
                //        strvalue += String.Format("'{0}'", lbltin.Text);

                //        if (j + 1 < totalCount)
                //        {
                //            strvalue += ",";
                //            ++j;
                //        }
                //    }

                //}

                txtiddisplay.Visible = true;

                Session["Startdate"] = txtstartdate.Text.ToString();

                Session["Enddate"] = txtenddate.Text.ToString();

                Session["startdate1"] = Convert.ToDateTime(txtstartdate.Text.ToString());

                Session["Enddate1"] = Convert.ToDateTime(txtenddate.Text.ToString());

                Session["Agencylist"] = strvalue;

                var strrevenue = Session["Agencylist"].ToString();

                var startdate = Session["Startdate"].ToString();

                var enddate = Session["Enddate"].ToString();

                var end = Convert.ToDateTime(Session["Enddate1"].ToString()).ToString("dd/MM/yyyy");

                var strat = Convert.ToDateTime(Session["startdate1"].ToString()).ToString("dd/MM/yyyy");

                if (string.IsNullOrWhiteSpace(strvalue.ToString()))
                {
                    //Encodings.MsgBox("End Date Greater Than Start Date !", this.Page, this);
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Agency List Empty !', 'error');", true); return;
                }
                else
                {
                    if (Encodings.IsValidUser(String.Format(
                                                  "SELECT AgencyName,AgencyCode,SUM(Amount) Amount,DATEPART(YEAR,PaymentDate) Year FROM vwCollectionRaw WHERE PaymentDate BETWEEN '{0}' AND '{1}' AND AgencyCode IN ({2}) GROUP BY AgencyName,AgencyCode,DATEPART(YEAR,PaymentDate) ORDER BY AgencyName ASC",
                                                  startdate, enddate, strrevenue)))
                    {
                        Response.Write("<script>");
                        Response.Write("window.open('ViewYear.aspx' ,'_blank')");
                        Response.Write("</script>");
                    }
                    else
                    {
                        //Encodings.MsgBox("! No Record Found for the Selected Range !", this.Page, this);
                        this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert",
                                                                "swal('Report!', ' No Record Found for the Selected Range !', 'info');", true);
                    }
                }
            }
        }
Пример #14
0
        public static string PostPreview(string Revenuetype, Int32 nums, DateTime startdate, DateTime enddate, Int32[] reveuneofficeid, string RevenueName)
        {
            string strvalue = String.Empty; int j = 0; string retvalue = String.Empty;

            int h = reveuneofficeid.Count();

            for (int i = 0; i < reveuneofficeid.Length; i++)
            {
                strvalue += String.Format("'{0}'", reveuneofficeid[i]);
                if (j + 1 < h)
                {
                    strvalue += ",";
                    ++j;
                }
            }

            HttpContext.Current.Session["nos"] = nums;

            HttpContext.Current.Session["RevenueofficeID"] = strvalue;

            HttpContext.Current.Session["Revenuecode"] = Revenuetype;

            HttpContext.Current.Session["Startdate"] = Convert.ToDateTime(startdate);

            HttpContext.Current.Session["startdate1"] = Convert.ToDateTime(startdate);

            HttpContext.Current.Session["Enddate"] = Convert.ToDateTime(enddate);

            HttpContext.Current.Session["Enddate1"] = Convert.ToDateTime(enddate);

            HttpContext.Current.Session["RevenueName"] = RevenueName;


            var strrevenue = HttpContext.Current.Session["Revenuecode"].ToString();

            var startdat = string.Format("{0:yyyy-MM-dd}", HttpContext.Current.Session["Startdate"].ToString());

            var enddat = string.Format("{0:yyyy-MM-dd}", HttpContext.Current.Session["Enddate"].ToString());

            var end = Convert.ToDateTime(HttpContext.Current.Session["Enddate1"].ToString()).ToString("yyyy/MM/dd");

            var strat = Convert.ToDateTime(HttpContext.Current.Session["startdate1"].ToString()).ToString("yyyy/MM/dd");

            var strrevenueofficeid = HttpContext.Current.Session["RevenueofficeID"].ToString();

            int nos = Convert.ToInt32(HttpContext.Current.Session["nos"].ToString());

            string strquery = String.Format(
                "SELECT  DISTINCT TOP {0} TaxAgentUtin,TaxAgentName,SUM(Amount) Amount,RevenueOfficeID,RevenueOfficeName,RevenueCode,RevenueName,DATEPART(MONTH, PaymentDate) AS MONTH,DATEPART(YEAR, PaymentDate) AS YEAR,CONVERT(VARCHAR, DATEPART(MONTH, PaymentDate)) + '/' + CONVERT(VARCHAR, DATEPART(YEAR, PaymentDate)) AS Period FROM vwCollectionRanking WHERE PaymentDate BETWEEN '{1}' AND '{2}' AND RevenueCode ='{3}' AND RevenueOfficeID IN ({4}) GROUP BY TaxAgentUtin, TaxAgentName, RevenueOfficeID,RevenueOfficeName,RevenueCode, RevenueName,DATEPART(MONTH, PaymentDate), DATEPART(YEAR, PaymentDate) ORDER BY TaxAgentName ASC",
                nos, strat, end, strrevenue, strrevenueofficeid);

            if (Encodings.IsValidUser(strquery))
            {
                retvalue = "1";
            }
            else
            {
                retvalue = "0";
            }

            return(JsonConvert.SerializeObject(retvalue));
        }
Пример #15
0
        protected void btnpreview_OnClick(object sender, EventArgs e)
        {
            txtiddisplay.Visible = true;

            string strvalue = String.Empty; int j = 0;

            if (string.IsNullOrWhiteSpace(txtstartdate.Text.ToString()) || string.IsNullOrWhiteSpace(txtenddate.Text.ToString()))
            {
                //Encodings.MsgBox("! Criteria is Empty !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Criteria is Empty !', 'error');", true);
                return;
            }
            if (Convert.ToDateTime(txtenddate.Text.ToString()) < Convert.ToDateTime(txtstartdate.Text.ToString()))
            {
                //Encodings.MsgBox("End Date Greater Than Start Date !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date Greater Than Start Date !', 'error');", true); return;
            }

            if (string.IsNullOrEmpty(ddlRevenue.SelectedValue.ToString()))
            {
                return;
            }

            if (string.IsNullOrEmpty(txtno.Text.ToString()))
            {
                return;
            }


            Session["nos"] = txtno.Text.ToString();

            Session["Startdate"] = txtstartdate.Text.ToString();

            Session["Enddate"] = txtenddate.Text.ToString();

            Session["Revenuecode"] = ddlRevenue.SelectedValue.ToString();

            Session["RevenueName"] = ddlRevenue.SelectedItem.ToString();

            Session["startdate1"] = Convert.ToDateTime(txtstartdate.Text.ToString());

            Session["Enddate1"] = Convert.ToDateTime(txtenddate.Text.ToString());

            //int totalCount = gridOffence.Rows.Cast<GridViewRow>()
            //    .Count(r => ((CheckBox)r.FindControl("Chkid")).Checked);

            //int totalCount = gridOffence.Rows.Cast<GridViewRow>()
            //    .Count(r => ((CheckBox)r.FindControl("CheckBox1")).Checked);


            //foreach (GridViewRow row in gridOffence.Rows)
            //{
            //    CheckBox chk = (CheckBox)row.FindControl("CheckBox1");

            //    Label lbltin = (Label)row.FindControl("lbloffice");

            //    if (chk != null & chk.Checked)
            //    {
            //        strvalue += String.Format("'{0}'", lbltin.Text);

            //if (j + 1 < totalCount)
            //{
            //    strvalue += ",";
            //    ++j;
            //}
            //    }

            //}
            if (string.IsNullOrWhiteSpace(strvalue.ToString()))
            {
                //Encodings.MsgBox("End Date Greater Than Start Date !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Revenue Office Empty !', 'error');", true); return;
            }
            else
            {
                Session["RevenueofficeID"] = strvalue;

                var strrevenue = Session["Revenuecode"].ToString();

                var startdate = Session["Startdate"].ToString();

                var enddate = Session["Enddate"].ToString();

                var end = Convert.ToDateTime(Session["Enddate1"].ToString()).ToString("dd/MM/yyyy");

                var strat = Convert.ToDateTime(Session["startdate1"].ToString()).ToString("dd/MM/yyyy");

                var strrevenueofficeid = Session["RevenueofficeID"].ToString();

                int nos = Convert.ToInt32(Session["nos"].ToString());

                string strquery = String.Format(
                    "SELECT  DISTINCT TOP {0} TaxAgentUtin,TaxAgentName,SUM(Amount) Amount,RevenueOfficeID,RevenueOfficeName,RevenueCode,RevenueName,DATEPART(MONTH, PaymentDate) AS MONTH,DATEPART(YEAR, PaymentDate) AS YEAR,CONVERT(VARCHAR, DATEPART(MONTH, PaymentDate)) + '/' + CONVERT(VARCHAR, DATEPART(YEAR, PaymentDate)) AS Period FROM vwCollectionRanking WHERE PaymentDate BETWEEN '{1}' AND '{2}' AND RevenueCode ='{3}' AND RevenueOfficeID IN ({4}) GROUP BY TaxAgentUtin, TaxAgentName, RevenueOfficeID,RevenueOfficeName,RevenueCode, RevenueName,DATEPART(MONTH, PaymentDate), DATEPART(YEAR, PaymentDate) ORDER BY TaxAgentName ASC",
                    nos, startdate, enddate, strrevenue, strrevenueofficeid);

                if (Encodings.IsValidUser(strquery))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('ViewCollectionRanking.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert",
                                                            "swal('Report!', ' No Record Found for the Selected Range !', 'info');", true);
                }
            }
        }
Пример #16
0
        protected void btnpreview_OnClick(object sender, EventArgs e)
        {
            txtiddisplay.Visible = true;

            //  Encodings.MsgBox("You Need to Enable your Browser Pop-Up at the Top Right Corner to View the report", this.Page, "Report Not Showing?");

            if (string.IsNullOrEmpty(ddlAgency.SelectedValue.ToString()))
            {
                //Encodings.MsgBox("! Criteria is Empty !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Criteria is Empty !', 'error');", true);
                return;
            }
            else if (string.IsNullOrEmpty(ddlRevenue.SelectedValue.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Criteria is Empty !', 'error');", true); return;
            }
            else if (string.IsNullOrWhiteSpace(txtstartdate.Text.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Start Date is Empty !', 'error');", true);
            }
            else if (string.IsNullOrWhiteSpace(txtenddate.Text.ToString()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date is Empty !', 'error');", true);
            }
            else if (Convert.ToDateTime(txtenddate.Text.ToString()) < Convert.ToDateTime(txtstartdate.Text.ToString()))
            {
                //Encodings.MsgBox("End Date Greater Than Start Date !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date Greater Than Start Date !', 'error');", true);
            }
            else
            {
                Session["Agency"] = ddlAgency.SelectedValue.ToString();

                Session["Revenue"] = ddlRevenue.SelectedValue.ToString();

                Session["RevenueName"] = ddlRevenue.SelectedItem.ToString();

                var gb = Convert.ToDateTime(txtstartdate.Text.ToString());

                Session["startdate1"] = Convert.ToDateTime(txtstartdate.Text.ToString());

                Session["Enddate1"] = Convert.ToDateTime(txtenddate.Text.ToString());

                Session["Startdate"] = txtstartdate.Text.ToString();

                Session["Enddate"] = txtenddate.Text.ToString();

                var strrevenue = Session["Revenue"].ToString();

                var startdate = Session["Startdate"].ToString();

                var enddate = Session["Enddate"].ToString();

                string strquery = String.Format("SELECT * FROM ViewPayment WHERE PaymentDate BETWEEN '{0}' AND '{1}' and RevenueCode ='{2}'  ORDER BY PaymentDate ASC", startdate, enddate, strrevenue);

                if (Encodings.IsValidUser(strquery))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('ViewPayment.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', ' No Record Found for the Selected Range !', 'info');", true);
                }
            }
        }
Пример #17
0
        protected void btnpreview_OnClick(object sender, EventArgs e)
        {
            int totalCount = gridOffence.Rows.Cast <GridViewRow>()
                             .Count(r => ((CheckBox)r.FindControl("CheckBox1")).Checked);

            if (string.IsNullOrWhiteSpace(txtstartdate.Text.ToString()) || string.IsNullOrWhiteSpace(txtenddate.Text.ToString()))
            {
                //Encodings.MsgBox("! Criteria is Empty !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Criteria is Empty !', 'error');", true);
            }
            else if (Convert.ToDateTime(txtenddate.Text.ToString()) < Convert.ToDateTime(txtstartdate.Text.ToString()))
            {
                //Encodings.MsgBox("End Date Greater Than Start Date !", this.Page, this);
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! End Date Greater Than Start Date !', 'error');", true);
            }
            else if (ddlRevenue.Items.Count == 0)
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', '! Select Revenue Type !', 'error');", true);
            }
            else
            {
                var str = ddlRevenue.SelectedItem.ToString();

                foreach (GridViewRow row in gridOffence.Rows)
                {
                    CheckBox chk = (CheckBox)row.FindControl("CheckBox1");

                    Label lbltin = (Label)row.FindControl("lbltin");

                    if (chk != null & chk.Checked)
                    {
                        strvalue += String.Format("{0}", lbltin.Text);

                        if (j + 1 < totalCount)
                        {
                            strvalue += ",";
                            ++j;
                        }
                    }
                }

                txtiddisplay.Visible = true;

                Session["RevenueTypecode"] = ddlRevenue.Text.ToString();

                Session["RevenueTypeName"] = ddlRevenue.SelectedItem.ToString();

                Session["Startdate"] = txtstartdate.Text.ToString();

                Session["Enddate"] = txtenddate.Text.ToString();

                Session["startdate1"] = Convert.ToDateTime(txtstartdate.Text.ToString());

                Session["Enddate1"] = Convert.ToDateTime(txtenddate.Text.ToString());

                Session["RevenueOfficeID"] = strvalue;

                var strrevenue = Session["RevenueOfficeID"].ToString();

                var strrevennuetypecode = Session["RevenueTypecode"].ToString();

                var startdate = Session["Startdate"].ToString();

                var enddate = Session["Enddate"].ToString();

                var end = Convert.ToDateTime(Session["Enddate1"].ToString()).ToString("dd/MM/yyyy");

                var strat = Convert.ToDateTime(Session["startdate1"].ToString()).ToString("dd/MM/yyyy");

                if (Encodings.IsValidUser(String.Format(
                                              "SELECT OrganizationName,TaxAgentTIN,RevenueOfficeID,RevenueOfficeName, Months, SUM(Amount) Amount FROM  vwTrend WHERE PaymentDate BETWEEN '{0}' AND '{1}' AND RevenueOfficeID IN ({2}) AND RevenueCode= '{3}' GROUP BY OrganizationName, TaxAgentTIN, RevenueOfficeID,RevenueOfficeName, Months ORDER BY OrganizationName ASC",
                                              startdate, enddate, strrevenue, strrevennuetypecode)))
                {
                    Response.Write("<script>");
                    Response.Write("window.open('ViewTrend.aspx' ,'_blank')");
                    Response.Write("</script>");
                }
                else
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal('Report!', ' No Record Found for the Selected Range !', 'info');", true);
                }
            }
        }