예제 #1
0
        public void ViewDocument(YellowstonePathology.YpiConnect.Contract.Search.SearchResult searchResult)
        {
            CaseDocument caseDocument = new CaseDocument(searchResult.ReportNo, YellowstonePathology.YpiConnect.Contract.CaseDocumentTypeEnum.XPS);

            YellowstonePathology.YpiConnect.Contract.MethodResult methodResult = caseDocument.Download();
            if (methodResult.Success == true)
            {
                XpsDocumentViewer xpsDocumentViewer = new XpsDocumentViewer();
                xpsDocumentViewer.LoadDocument(caseDocument.XpsDocument);
                xpsDocumentViewer.ShowDialog();
            }
            else
            {
                System.Windows.MessageBox.Show(methodResult.Message);
            }
        }
예제 #2
0
 private void HyperlinkDownload_Click(object sender, RoutedEventArgs e)
 {
     if (this.ListViewSearchResults.SelectedItems.Count != 0)
     {
         if (YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.EnableFileDownload == true &&
             string.IsNullOrEmpty(YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.LocalFileDownloadDirectory) == false)
         {
             if (this.ListViewSearchResults.SelectedItems.Count != 0)
             {
                 Mouse.OverrideCursor = Cursors.Wait;
                 foreach (YellowstonePathology.YpiConnect.Contract.Search.SearchResult searchResult in this.ListViewSearchResults.SelectedItems)
                 {
                     YellowstonePathology.YpiConnect.Contract.CaseDocumentTypeEnum caseDocumentType = (YellowstonePathology.YpiConnect.Contract.CaseDocumentTypeEnum)Enum.Parse(typeof(YellowstonePathology.YpiConnect.Contract.CaseDocumentTypeEnum), YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.DownloadFileType);
                     CaseDocument caseDocument = new CaseDocument(searchResult.ReportNo, caseDocumentType);
                     YellowstonePathology.YpiConnect.Contract.MethodResult methodResult = caseDocument.Save();
                     if (methodResult.Success == false)
                     {
                         string message = "There was an error trying to download the file for " + searchResult.ReportNo +
                                          ".  A message about the error has been sent to YPII support. \n\nWould you like to continue with any other downloads?";
                         MessageBoxResult result = MessageBox.Show(message, "Download Error", MessageBoxButton.YesNo, MessageBoxImage.Question);
                         if (result == MessageBoxResult.No)
                         {
                             break;
                         }
                     }
                 }
                 Mouse.OverrideCursor = null;
                 MessageBox.Show("Download complete.");
             }
         }
         else
         {
             FileDownloadSettingsPage fileDownloadSettingsPage = new FileDownloadSettingsPage();
             ApplicationNavigator.ApplicationContentFrame.NavigationService.Navigate(fileDownloadSettingsPage);
         }
     }
 }
예제 #3
0
 private void HyperlinkPrint_Click(object sender, RoutedEventArgs e)
 {
     if (this.ListViewSearchResults.SelectedItems.Count != 0)
     {
         List <YellowstonePathology.YpiConnect.Contract.MethodResult> methodResultList = new List <Contract.MethodResult>();
         foreach (YellowstonePathology.YpiConnect.Contract.Search.SearchResult searchResult in this.ListViewSearchResults.SelectedItems)
         {
             CaseDocument caseDocument = new CaseDocument(searchResult.ReportNo, Contract.CaseDocumentTypeEnum.XPS);
             YellowstonePathology.YpiConnect.Contract.MethodResult methodResult = caseDocument.Print();
             if (methodResult.Success == false)
             {
                 methodResultList.Add(methodResult);
             }
         }
         if (methodResultList.Count == 0)
         {
             MessageBox.Show("Your Document(s) have been sent to the printer.");
         }
         else
         {
             MessageBox.Show("We were unable to print " + methodResultList.Count.ToString() + " of your documents.");
         }
     }
 }
 private void HyperlinkPrint_Click(object sender, RoutedEventArgs e)
 {
     if (this.ListViewSearchResults.SelectedItems.Count != 0)
     {
         List<YellowstonePathology.YpiConnect.Contract.MethodResult> methodResultList = new List<Contract.MethodResult>();
         foreach (YellowstonePathology.YpiConnect.Contract.Search.SearchResult searchResult in this.ListViewSearchResults.SelectedItems)
         {
             CaseDocument caseDocument = new CaseDocument(searchResult.ReportNo, Contract.CaseDocumentTypeEnum.XPS);
             YellowstonePathology.YpiConnect.Contract.MethodResult methodResult = caseDocument.Print();
             if (methodResult.Success == false)
             {
                 methodResultList.Add(methodResult);
             }
         }
         if (methodResultList.Count == 0)
         {
             MessageBox.Show("Your Document(s) have been sent to the printer.");
         }
         else
         {
             MessageBox.Show("We were unable to print " + methodResultList.Count.ToString() + " of your documents.");
         }
     }
 }
 private void HyperlinkDownload_Click(object sender, RoutedEventArgs e)
 {
     if (this.ListViewSearchResults.SelectedItems.Count != 0)
     {
         if (YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.EnableFileDownload == true &&
             string.IsNullOrEmpty(YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.LocalFileDownloadDirectory) == false)
         {
             if (this.ListViewSearchResults.SelectedItems.Count != 0)
             {
                 Mouse.OverrideCursor = Cursors.Wait;
                 foreach (YellowstonePathology.YpiConnect.Contract.Search.SearchResult searchResult in this.ListViewSearchResults.SelectedItems)
                 {
                     YellowstonePathology.YpiConnect.Contract.CaseDocumentTypeEnum caseDocumentType = (YellowstonePathology.YpiConnect.Contract.CaseDocumentTypeEnum)Enum.Parse(typeof(YellowstonePathology.YpiConnect.Contract.CaseDocumentTypeEnum), YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.DownloadFileType);
                     CaseDocument caseDocument = new CaseDocument(searchResult.ReportNo, caseDocumentType);
                     YellowstonePathology.YpiConnect.Contract.MethodResult methodResult = caseDocument.Save();
                     if (methodResult.Success == false)
                     {
                         string message = "There was an error trying to download the file for " + searchResult.ReportNo +
                             ".  A message about the error has been sent to YPII support. \n\nWould you like to continue with any other downloads?";
                         MessageBoxResult result = MessageBox.Show(message, "Download Error", MessageBoxButton.YesNo, MessageBoxImage.Question);
                         if (result == MessageBoxResult.No)
                         {
                             break;
                         }
                     }
                 }
                 Mouse.OverrideCursor = null;
                 MessageBox.Show("Download complete.");
             }
         }
         else
         {
             FileDownloadSettingsPage fileDownloadSettingsPage = new FileDownloadSettingsPage();
             ApplicationNavigator.ApplicationContentFrame.NavigationService.Navigate(fileDownloadSettingsPage);
         }
     }
 }