private void ButtonDailyTaskOrderPrint_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListViewDailyTaskOrders.SelectedItems.Count > 0)
            {
                YellowstonePathology.Business.Task.Model.TaskCytologySlideDisposal taskCytologySlideDisposal = new Business.Task.Model.TaskCytologySlideDisposal();
                YellowstonePathology.Business.Task.Model.TaskSurgicalSpecimenDisposal taskSurgicalSpecimenDisposal = new Business.Task.Model.TaskSurgicalSpecimenDisposal();
                YellowstonePathology.Business.Task.Model.TaskPOCReport taskPOCReport = new Business.Task.Model.TaskPOCReport();

                foreach (YellowstonePathology.Business.Task.Model.TaskOrder taskOrder in this.ListViewDailyTaskOrders.SelectedItems)
                {
                    if (taskOrder.TaskId == taskCytologySlideDisposal.TaskId)
                    {
                        YellowstonePathology.Business.Reports.CytologySlideDisposalReport report1 = new YellowstonePathology.Business.Reports.CytologySlideDisposalReport(taskOrder.TaskDate.Value);
                        System.Windows.Controls.PrintDialog printDialog1 = new System.Windows.Controls.PrintDialog();

                        printDialog1.ShowDialog();
                        printDialog1.PrintDocument(report1.DocumentPaginator, "Cytology Slide Disposal");
                    }
                    else if (taskOrder.TaskId == taskSurgicalSpecimenDisposal.TaskId)
                    {
                        YellowstonePathology.Business.Reports.SurgicalSpecimenDisposalReport report2 = new YellowstonePathology.Business.Reports.SurgicalSpecimenDisposalReport(taskOrder.TaskDate.Value);
                        System.Windows.Controls.PrintDialog printDialog2 = new System.Windows.Controls.PrintDialog();
                        printDialog2.ShowDialog();
                        printDialog2.PrintDocument(report2.DocumentPaginator, "Surgical Specimen Disposal Report for: ");
                    }
                    else if (taskOrder.TaskId == taskPOCReport.TaskId)
                    {
                        YellowstonePathology.Business.Reports.POCRetensionReport report = new YellowstonePathology.Business.Reports.POCRetensionReport(taskOrder.TaskDate.Value.AddDays(-6), taskOrder.TaskDate.Value);
                        System.Windows.Controls.PrintDialog printDialog = new System.Windows.Controls.PrintDialog();
                        printDialog.ShowDialog();
                        printDialog.PrintDocument(report.DocumentPaginator, "POC ");
                    }
                }
            }
            else
            {
                MessageBox.Show("Select a task to print.");
            }
        }
Esempio n. 2
0
        private void ButtonDailyTaskOrderPrint_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListViewDailyTaskOrders.SelectedItems.Count > 0)
            {
                YellowstonePathology.Business.Task.Model.TaskCytologySlideDisposal    taskCytologySlideDisposal    = new Business.Task.Model.TaskCytologySlideDisposal();
                YellowstonePathology.Business.Task.Model.TaskSurgicalSpecimenDisposal taskSurgicalSpecimenDisposal = new Business.Task.Model.TaskSurgicalSpecimenDisposal();
                YellowstonePathology.Business.Task.Model.TaskRetrospectiveReview      taskRetrospectiveReview      = new Business.Task.Model.TaskRetrospectiveReview();

                foreach (YellowstonePathology.Business.Task.Model.TaskOrder taskOrder in this.ListViewDailyTaskOrders.SelectedItems)
                {
                    if (taskOrder.TaskId == taskCytologySlideDisposal.TaskId)
                    {
                        YellowstonePathology.Business.Reports.CytologySlideDisposalReport report1 = new YellowstonePathology.Business.Reports.CytologySlideDisposalReport(taskOrder.TaskDate.Value);
                        System.Windows.Controls.PrintDialog printDialog1 = new System.Windows.Controls.PrintDialog();

                        printDialog1.ShowDialog();
                        printDialog1.PrintDocument(report1.Document.DocumentPaginator, "Cytology Slide Disposal");
                    }
                    else if (taskOrder.TaskId == taskSurgicalSpecimenDisposal.TaskId)
                    {
                        YellowstonePathology.Business.Reports.SurgicalSpecimenDisposalReport report2 = new YellowstonePathology.Business.Reports.SurgicalSpecimenDisposalReport(taskOrder.TaskDate.Value);
                        System.Windows.Controls.PrintDialog printDialog2 = new System.Windows.Controls.PrintDialog();
                        printDialog2.ShowDialog();
                        printDialog2.PrintDocument(report2.Document.DocumentPaginator, "Surgical Specimen Disposal Report for: ");
                    }
                    else if (taskOrder.TaskId == taskRetrospectiveReview.TaskId)
                    {
                        YellowstonePathology.Business.Reports.RetrospectiveReviewReport report = new YellowstonePathology.Business.Reports.RetrospectiveReviewReport(taskOrder.TaskDate.Value);
                        System.Windows.Controls.PrintDialog printDialog = new System.Windows.Controls.PrintDialog();
                        printDialog.ShowDialog();
                        printDialog.PrintDocument(report.DocumentPaginator, "Retrospective Review");
                    }
                }
            }
            else
            {
                MessageBox.Show("Select a task to print.");
            }
        }