示例#1
0
 protected void GrdReport_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     try
     {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             TotalQty    += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Qty"));
             TotalAmt    += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Amount"));
             TotalNetAmt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "NetAmount"));//TotalTax
             TotalTax    += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TaxAmount"));
             TotalDisc   += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "DiscAmount"));
         }
         if (e.Row.RowType == DataControlRowType.Footer)
         {
             e.Row.Cells[9].Text  = "Total :";
             e.Row.Cells[10].Text = TotalQty.ToString();
             e.Row.Cells[12].Text = TotalAmt.ToString();
             e.Row.Cells[14].Text = TotalTax.ToString();
             e.Row.Cells[16].Text = TotalDisc.ToString();
             e.Row.Cells[17].Text = TotalNetAmt.ToString();
         }
     }
     catch (Exception ex)
     {
     }
 }
示例#2
0
        public async Task ShowPopUpTenderAsync()
        {
            PopUpVisibility = true;

            BetsTotal = TotalAmt.ToString();
            TotalDue  = TotalAmt.ToString();
            //var ChangeAmount = Convert.ToInt32(tender) - Convert.ToInt32(TotalAmt);
            Change = "0";
        }
示例#3
0
        private void rpt3_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            if (StoreName != null)
            {
                xrLabel3.Text = StoreName;
            }

            string _Date = "";

            if (ParamDate.Count == 2)
            {
                _Date = ParamDate[0].date.ToShortDateString() + " to " + ParamDate[1].date.ToShortDateString();
            }
            else
            {
                for (int i = 0; i < ParamDate.Count; i++)
                {
                    _Date += Helpers.ConvertMyDate(ParamDate[i].date) + (i == ParamDate.Count - 1 ? "" : ", ");
                }
            }
            xrLabel2.Text = "Report generated with date range of " + _Date;

            //FindControl("xrLabel21", true).DataBindings.Add("Text", this.DataSource, "Name");
            //FindControl("xrLabel22", true).DataBindings.Add("Text", this.DataSource, "Quantity");
            //FindControl("xrLabel23", true).DataBindings.Add("Text", this.DataSource, "Amount");
            //FindControl("xrLabel24", true).DataBindings.Add("Text", this.DataSource, "Percent", "{0:p}");
            //FindControl("xrLabel25", true).DataBindings.Add("Text", this.DataSource, "Average", "{0:#,##0.00}");

            xrLabel15.DataBindings.Add("Text", this.DataSource, "Name");
            xrLabel16.DataBindings.Add("Text", this.DataSource, "Quantity", "{0:#,##0}");
            xrLabel17.DataBindings.Add("Text", this.DataSource, "Amount", "{0:#,##0.00}");
            xrLabel18.DataBindings.Add("Text", this.DataSource, "Percent", "{0:p}");

            //totals ----------
            XRLabel lblTotalQty = xrLabel10;

            lblTotalQty.Text = TotalQty.ToString("#,##0.00");

            XRLabel lblTotalAmt = xrLabel11;

            lblTotalAmt.Text = TotalAmt.ToString("#,##0.00");

            XRLabel lblTotalPercent = xrLabel14;

            lblTotalPercent.Text = TotalPercent.ToString("#,##0.00");

            //other calculations ----------
            //Discount Total
            XRLabel lblDiscntTotalAmt = xrLabel13;

            lblDiscntTotalAmt.Text = DiscountAmt.ToString("#,##0.00");

            //Net Sales
            XRLabel lblNetSales = xrLabel7;

            lblNetSales.Text = (Convert.ToDouble(lblTotalAmt.Text) - Convert.ToDouble(lblDiscntTotalAmt.Text)).ToString("#,##0.00");
        }
示例#4
0
        public void calculate()
        {
            try
            {
                if (tender != "")
                {
                    BetsTotal = TotalAmt.ToString();
                    TotalDue  = TotalAmt.ToString();
                    var ChangeAmount = Convert.ToInt32(TotalAmt) - Convert.ToInt32(tender);
                    Change = (System.Math.Abs(ChangeAmount)).ToString();
                }

                else
                {
                    Change = "0";
                }
            }
            catch { }
        }
示例#5
0
        private void rpt2_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            if (StoreName != null)
            {
                xrLabel3.Text = StoreName;
            }

            string _Date = "";

            if (ParamDate.Count == 2)
            {
                _Date = ParamDate[0].date.ToShortDateString() + " to " + ParamDate[1].date.ToShortDateString();
            }
            else
            {
                for (int i = 0; i < ParamDate.Count; i++)
                {
                    _Date += Helpers.ConvertMyDate(ParamDate[i].date) + (i == ParamDate.Count - 1 ? "" : ", ");
                }
            }
            xrLabel2.Text = "Report generated with date range of " + _Date;

            //FindControl("xrLabel21", true).DataBindings.Add("Text", this.DataSource, "Name");
            //FindControl("xrLabel22", true).DataBindings.Add("Text", this.DataSource, "Quantity");
            //FindControl("xrLabel23", true).DataBindings.Add("Text", this.DataSource, "Amount");
            //FindControl("xrLabel24", true).DataBindings.Add("Text", this.DataSource, "Percent", "{0:p}");
            //FindControl("xrLabel25", true).DataBindings.Add("Text", this.DataSource, "Average", "{0:#,##0.00}");

            xrLabel15.DataBindings.Add("Text", this.DataSource, "Name");
            xrLabel5.DataBindings.Add("Text", this.DataSource, "Orders", "{0:#,##0}");
            xrLabel6.DataBindings.Add("Text", this.DataSource, "Amount", "{0:#,##0.00}");
            xrLabel7.DataBindings.Add("Text", this.DataSource, "AverageSalesRepresentation");

            xrLabel11.Text = TotalAmt.ToString("#,##0.00");
            xrLabel13.Text = BestHour;
        }
示例#6
0
 private async Task CalculateTenderAsync()
 {
     Tender = TotalAmt.ToString();
 }