Exemple #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            XReadReport rpt = new XReadReport();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
        private void btnXRead_Click(object sender, EventArgs e)
        {
            var       facade   = new Facade();
            ArrayList source   = new ArrayList();
            var       register = facade.Restaurant.Areas.SelectMany(a => a.Registers);
            var       people   = from p in facade.People select new { Id = p.Id, FirstName = p.FirstName, LastName = p.LastName };

            var sales      = facade.Restaurant.Areas.SelectMany(a => a.Registers.SelectMany(r => r.Sales)).ToList();
            var salesTotal = sales.Sum(s => s.SaleTotal);
            var gst        = sales.Sum(s => s.GSTTotal);

            var cashPayments   = sales.SelectMany(s => s.Payments.Where(p => p.PaymentType.Equals(PaymentType.Cash))).ToList();
            var cashTotal      = cashPayments.Sum(p => p.Sale.SaleTotal);
            var eftposPayments = sales.SelectMany(s => s.Payments.Where(p => p.PaymentType.Equals(PaymentType.Eftpos))).ToList();
            var eftposTotal    = eftposPayments.Sum(p => p.Sale.SaleTotal);

            foreach (var s in sales)
            {
                source.Add(new
                {
                    RegisterName   = register.First().Name,
                    SaleNumber     = sales.Count,
                    SaleTotal      = salesTotal,
                    GstTotal       = gst,
                    CashCount      = cashPayments.Count,
                    CashTotal      = cashTotal,
                    EftposCount    = eftposPayments.Count,
                    EftposTotal    = eftposTotal,
                    UserFirstName  = s.UserAccount.ToString(),
                    UserSalesTotal = sales.Sum(sum => sales.Where(u => u.UserId.Equals(sum.UserAccount.Id)).FirstOrDefault().SaleTotal)
                });
            }
            var report = new XReadReport();

            report.SetDataSource(source);

            crystalReportViewer1.ReportSource = report;
            ConnectReporter();
            crystalReportViewer1.RefreshReport();
        }
Exemple #3
0
        private void btnXRead_Click(object sender, EventArgs e)
        {
            var facade = new Facade();
            ArrayList source = new ArrayList();
            var register = facade.Restaurant.Areas.SelectMany(a => a.Registers);
            var people = from p in facade.People select new { Id = p.Id, FirstName = p.FirstName, LastName = p.LastName };

            var sales = facade.Restaurant.Areas.SelectMany(a => a.Registers.SelectMany(r => r.Sales)).ToList();
            var salesTotal = sales.Sum(s => s.SaleTotal);
            var gst = sales.Sum(s => s.GSTTotal);

            var cashPayments = sales.SelectMany(s => s.Payments.Where(p => p.PaymentType.Equals(PaymentType.Cash))).ToList();
            var cashTotal = cashPayments.Sum(p => p.Sale.SaleTotal);
            var eftposPayments = sales.SelectMany(s => s.Payments.Where(p => p.PaymentType.Equals(PaymentType.Eftpos))).ToList();
            var eftposTotal = eftposPayments.Sum(p => p.Sale.SaleTotal);

            foreach (var s in sales)
            {
                source.Add(new
                {
                    RegisterName = register.First().Name,
                    SaleNumber = sales.Count,
                    SaleTotal = salesTotal,
                    GstTotal = gst,
                    CashCount = cashPayments.Count,
                    CashTotal = cashTotal,
                    EftposCount = eftposPayments.Count,
                    EftposTotal = eftposTotal,
                    UserFirstName = s.UserAccount.ToString(),
                    UserSalesTotal = sales.Sum(sum => sales.Where(u => u.UserId.Equals(sum.UserAccount.Id)).FirstOrDefault().SaleTotal)
                });
            }
            var report = new XReadReport();
            report.SetDataSource(source);

            crystalReportViewer1.ReportSource = report;
            ConnectReporter();
            crystalReportViewer1.RefreshReport();
        }
Exemple #4
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     XReadReport rpt = new XReadReport();
     rpt.Site = this.Site;
     return rpt;
 }