private void ButtonPrintList_Click(object sender, RoutedEventArgs e)
        {
            XElement listElement = null;

            if (this.ListViewSearchResults.SelectedItems.Count != 0)
            {
                listElement = new XElement("CytologyScreeningList");
                foreach (YellowstonePathology.Business.Search.CytologyScreeningSearchResult item in this.ListViewSearchResults.SelectedItems)
                {
                    item.ToXml(listElement);
                }
            }
            else if(this.m_CytologyUI.Search.Results.Count != 0)
            {
                listElement = new XElement("CytologyScreeningList");
                foreach (YellowstonePathology.Business.Search.CytologyScreeningSearchResult item in this.m_CytologyUI.Search.Results)
                {
                    item.ToXml(listElement);
                }
            }

            if (listElement != null)
            {
                YellowstonePathology.Business.XPSDocument.Result.Data.CytologyScreeningListReportData cytologyScreeningListReportData = new Business.XPSDocument.Result.Data.CytologyScreeningListReportData(listElement);
                YellowstonePathology.Business.XPSDocument.Result.Xps.CytologyScreeningListReport clientSupplyOrderReport = new Business.XPSDocument.Result.Xps.CytologyScreeningListReport(cytologyScreeningListReportData);
                XpsDocumentViewer xpsDocumentViewer = new XpsDocumentViewer();
                xpsDocumentViewer.LoadDocument(clientSupplyOrderReport.FixedDocument);
                xpsDocumentViewer.ShowDialog();
            }
            else
            {
                MessageBox.Show("Fill the list or select list entries", "Nothing to report.");
            }
        }
Example #2
0
        private void ButtonPrintList_Click(object sender, RoutedEventArgs e)
        {
            XElement listElement = null;

            if (this.ListViewSearchResults.SelectedItems.Count != 0)
            {
                listElement = new XElement("CytologyScreeningList");
                foreach (YellowstonePathology.Business.Search.CytologyScreeningSearchResult item in this.ListViewSearchResults.SelectedItems)
                {
                    item.ToXml(listElement);
                }
            }
            else if (this.m_CytologyUI.Search.Results.Count != 0)
            {
                listElement = new XElement("CytologyScreeningList");
                foreach (YellowstonePathology.Business.Search.CytologyScreeningSearchResult item in this.m_CytologyUI.Search.Results)
                {
                    item.ToXml(listElement);
                }
            }

            if (listElement != null)
            {
                YellowstonePathology.Business.XPSDocument.Result.Data.CytologyScreeningListReportData cytologyScreeningListReportData = new Business.XPSDocument.Result.Data.CytologyScreeningListReportData(listElement);
                YellowstonePathology.Business.XPSDocument.Result.Xps.CytologyScreeningListReport      clientSupplyOrderReport         = new Business.XPSDocument.Result.Xps.CytologyScreeningListReport(cytologyScreeningListReportData);
                XpsDocumentViewer xpsDocumentViewer = new XpsDocumentViewer();
                xpsDocumentViewer.LoadDocument(clientSupplyOrderReport.FixedDocument);
                xpsDocumentViewer.ShowDialog();
            }
            else
            {
                MessageBox.Show("Fill the list or select list entries", "Nothing to report.");
            }
        }