Пример #1
0
        internal void PrintDocument(tblDocumentCommon tblDocumentCommon)
        {
            var xDodument = (new List <tblDocumentCommon>(1));

            xDodument.Add(tblDocumentCommon);
            PrintDocuments(xDodument);
        }
Пример #2
0
        public ReportClass GetReport(tblDocumentCommon doc, List <DocumentAdapter> reportSource = null)
        {
            List <DocumentAdapter> xSource = reportSource;

            if (xSource == null)
            {
                DocumentAdapter xPrintAdapter = new DocumentAdapter(doc);
                xSource = new List <DocumentAdapter>(1);
                xSource.Add(xPrintAdapter);
            }
            ReportClass xReport;

            if (doc is tblDocumentService)
            {
                xReport = new DocService();
            }
            else if (doc is tblDocumentProduct)
            {
                xReport = new DocSale();
            }
            else if (doc is tblDocumentSalesReceipt)
            {
                xReport = new SaleReceipt();
            }
            else
            {
                throw new Exception("Не определен шаблон документа");
            }
            xReport.SetDataSource(xSource);
            return(xReport);
        }
Пример #3
0
        private async void actgrdPrint(object sender, RoutedEventArgs e)
        {
            tblDocumentCommon xDoc = FViewDataContext.CurrentDocument; // (tblDocumentCommon)((Button)sender).Tag;
            await FViewDataContext.SaveAllCangesAsync();

            PrintContext.Instance.PrintDocument(FViewDataContext.CurrentDocument);
            await FViewDataContext.SaveAllCangesAsync();
        }
Пример #4
0
        private async void actgrdPreview(object sender, RoutedEventArgs e)
        {
            tblDocumentCommon xDoc = FViewDataContext.CurrentDocument; //(tblDocumentCommon)((Button)sender).Tag;
            await FViewDataContext.SaveAllCangesAsync();

            ReportPreview xReportPreview = new ReportPreview();
            //xReportPreview.Owner = this;
            ReportClass xReport = PrintContext.Instance.GetReport(xDoc);

            try
            {
                xReportPreview.SetReport(xReport);
                xReportPreview.Show();
            }
            finally
            {
                // xReport.Dispose();
            }
        }
Пример #5
0
 public DocumentAdapter(tblDocumentCommon documrnt)
 {
     FDocumrnt = documrnt;
 }