private void button1_Click(object sender, EventArgs e)
        {
            var       facade        = new Facade();
            ArrayList source        = new ArrayList();
            var       register      = facade.Restaurant.Areas.SelectMany(a => a.Registers);
            var       sale          = (Controller as SaleViewController).MainTask.Sale as ISale;
            var       saleLineItems = sale.SaleLineItems;

            var categories = facade.Categories;
            var products   = categories.SelectMany(p => p.Products);


            foreach (var sli in saleLineItems)
            {
                source.Add(new
                {
                    RegisterName       = register.First().Name,
                    UserFirstName      = sale.UserAccount.ToString(),
                    SaleId             = sale.Id,
                    ProductDescription = products.Where(p => p.Id.Equals(sli.MenuProduct.ProductId)).FirstOrDefault().Description,
                    Message            = sli.Message,
                    Quantity           = sli.Quantity,
                    ProductPrice       = sli.Total,
                });
            }

            var report = new ProductionDocket();

            report.SetDataSource(source);

            crystalReportViewer1.ReportSource = report;
            ConnectReporter();
            crystalReportViewer1.RefreshReport();
            report.PrintToPrinter(1, false, 1, 1);
        }
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            ProductionDocket rpt = new ProductionDocket();

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            var facade = new Facade();
            ArrayList source = new ArrayList();
            var register = facade.Restaurant.Areas.SelectMany(a => a.Registers);
            var sale = (Controller as SaleViewController).MainTask.Sale as ISale;
            var saleLineItems = sale.SaleLineItems;

            var categories = facade.Categories;
            var products = categories.SelectMany(p => p.Products);

            foreach (var sli in saleLineItems)
            {
                source.Add(new
                {
                    RegisterName = register.First().Name,
                    UserFirstName = sale.UserAccount.ToString(),
                    SaleId = sale.Id,
                    ProductDescription = products.Where(p => p.Id.Equals(sli.MenuProduct.ProductId)).FirstOrDefault().Description,
                    Message = sli.Message,
                    Quantity = sli.Quantity,
                    ProductPrice = sli.Total,
                });
            }

            var report = new ProductionDocket();
            report.SetDataSource(source);

            crystalReportViewer1.ReportSource = report;
            ConnectReporter();
            crystalReportViewer1.RefreshReport();
            report.PrintToPrinter(1, false, 1, 1);
        }
Ejemplo n.º 4
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     ProductionDocket rpt = new ProductionDocket();
     rpt.Site = this.Site;
     return rpt;
 }