private bool TryPublish(YellowstonePathology.Business.Interface.ICaseDocument caseDocument, Business.Test.AccessionOrder accessionOrder,
                                YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder)
        {
            bool result = true;

            //try
            //{

            //YellowstonePathology.Business.PanelSet.Model.ResultDocumentSourceEnum resultDocumentSource;
            //bool hasEnum = Enum.TryParse<YellowstonePathology.Business.PanelSet.Model.ResultDocumentSourceEnum>(panelSetOrder.ResultDocumentSource, out resultDocumentSource);
            //if(hasEnum == true && resultDocumentSource != YellowstonePathology.Business.PanelSet.Model.ResultDocumentSourceEnum.PublishedDocument)
            //{
            //   caseDocument.Publish();
            //}

            if (panelSetOrder.ResultDocumentSource == YellowstonePathology.Business.PanelSet.Model.ResultDocumentSourceEnum.YPIDatabase.ToString())
            {
                caseDocument.Render();
                caseDocument.Publish();
            }

            this.m_ReportDistributionLogEntryCollection.AddEntry("INFO", "Publish Next", null, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo, null, null, "PanelSetOrder Published");
            //}
            //catch (Exception publishException)
            //{
            //    this.m_ReportDistributionLogEntryCollection.AddEntry("ERROR", "Publish Next", null, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo, null, null, publishException.Message);
            //    this.DelayPublishAndDistribution(15, publishException.Message, panelSetOrder);
            //    result = false;
            //}

            return(result);
        }
Пример #2
0
        public void View(Business.Test.AccessionOrder accessionOrder, Business.Test.PanelSetOrder panelSetOrder)
        {
            YellowstonePathology.Business.PanelSet.Model.PanelSet panelSet = YellowstonePathology.Business.PanelSet.Model.PanelSetCollection.GetAll().GetPanelSet(panelSetOrder.PanelSetId);
            YellowstonePathology.Business.Interface.ICaseDocument doc      = YellowstonePathology.Business.Document.DocumentFactory.GetDocument(accessionOrder, panelSetOrder, Business.Document.ReportSaveModeEnum.Draft);
            doc.Render();
            YellowstonePathology.Business.OrderIdParser orderIdParser = new Business.OrderIdParser(panelSetOrder.ReportNo);

            string fileName = string.Empty;

            if (panelSet.ResultDocumentSource == Business.PanelSet.Model.ResultDocumentSourceEnum.PublishedDocument ||
                panelSet.ResultDocumentSource == Business.PanelSet.Model.ResultDocumentSourceEnum.RetiredTestDocument)
            {
                fileName = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNameXPS(orderIdParser);
            }
            else
            {
                fileName = YellowstonePathology.Business.Document.CaseDocument.GetDraftDocumentFilePath(orderIdParser);
            }

            switch (doc.NativeDocumentFormat)
            {
            case Business.Document.NativeDocumentFormatEnum.Word:
                YellowstonePathology.Business.Document.CaseDocument.OpenWordDocumentWithWordViewer(fileName);
                break;

            case Business.Document.NativeDocumentFormatEnum.XPS:
                YellowstonePathology.UI.XpsDocumentViewer xpsDocumentViewer = new XpsDocumentViewer();
                xpsDocumentViewer.ViewDocument(fileName);
                xpsDocumentViewer.ShowDialog();
                break;
            }
        }
        private void HyperLinkShowDocument_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Interface.ICaseDocument caseDocument = YellowstonePathology.Business.Document.DocumentFactory.GetDocument(this.m_AccessionOrder, this.m_PanelSetOrder, Business.Document.ReportSaveModeEnum.Draft);
            caseDocument.Render();

            YellowstonePathology.Business.Document.CaseDocument.OpenWordDocumentWithWord(caseDocument.SaveFileName);
        }
        private void HyperLinkShowDocument_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Interface.ICaseDocument caseDocument = YellowstonePathology.Business.Document.DocumentFactory.GetDocument(this.m_AccessionOrder, this.m_PanelSetOrder, Business.Document.ReportSaveModeEnum.Draft);
            caseDocument.Render();

            YellowstonePathology.Business.OrderIdParser orderIdParser = new Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
            string fileName = YellowstonePathology.Business.Document.CaseDocument.GetDraftDocumentFilePath(orderIdParser);

            YellowstonePathology.Business.Document.CaseDocument.OpenWordDocumentWithWordViewer(fileName);
        }
Пример #5
0
 private void ContextMenuPublish_Click(object sender, RoutedEventArgs e)
 {
     if (this.m_CytologyUI.AccessionOrder != null)
     {
         YellowstonePathology.Business.Interface.ICaseDocument caseDocument = YellowstonePathology.Business.Document.DocumentFactory.GetDocument(this.m_CytologyUI.AccessionOrder, this.m_CytologyUI.PanelSetOrderCytology, Business.Document.ReportSaveModeEnum.Normal);
         caseDocument.Render();
         caseDocument.Publish();
         MessageBox.Show("The document has been published");
     }
 }
Пример #6
0
        public void ButtonViewDocument_Click(object sender, RoutedEventArgs args)
        {
            Save(false);
            if (this.m_FlowUI.PanelSetOrderLeukemiaLymphoma.PanelSetId != 19 && this.m_FlowUI.PanelSetOrderLeukemiaLymphoma.PanelSetId != 20)
            {
                YellowstonePathology.Business.Interface.ICaseDocument caseDocument = YellowstonePathology.Business.Document.DocumentFactory.GetDocument(this.m_FlowUI.AccessionOrder, this.m_FlowUI.PanelSetOrderLeukemiaLymphoma, Business.Document.ReportSaveModeEnum.Draft);
                caseDocument.Render();

                YellowstonePathology.Business.OrderIdParser orderIdParser = new Business.OrderIdParser(this.m_FlowUI.PanelSetOrderLeukemiaLymphoma.ReportNo);
                string fileName = YellowstonePathology.Business.Document.CaseDocument.GetDraftDocumentFilePath(orderIdParser);
                YellowstonePathology.Business.Document.CaseDocument.OpenWordDocumentWithWordViewer(fileName);
            }
        }
 private void HyperLinkPublish_Click(object sender, RoutedEventArgs e)
 {
     if (this.DoesXPSDocumentExist() == true)
     {
         YellowstonePathology.Business.Interface.ICaseDocument caseDocument = YellowstonePathology.Business.Document.DocumentFactory.GetDocument(this.m_AccessionOrder, this.m_PanelSetOrder, Business.Document.ReportSaveModeEnum.Normal);
         caseDocument.Render();
         caseDocument.Publish();
         MessageBox.Show("The case was successfully published.");
     }
     else
     {
         MessageBox.Show("Cannot publish this case until the XPS document is present.");
     }
 }
Пример #8
0
        private bool TryPublish(YellowstonePathology.Business.Interface.ICaseDocument caseDocument, Business.Test.AccessionOrder accessionOrder,
                                YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder)
        {
            bool result = true;

            //try
            //{
            caseDocument.Render();
            caseDocument.Publish();

            this.m_ReportDistributionLogEntryCollection.AddEntry("INFO", "Publish Next", null, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo, null, null, "PanelSetOrder Published");
            //}

            /*
             * catch (Exception publishException)
             * {
             *  this.m_ReportDistributionLogEntryCollection.AddEntry("ERROR", "Publish Next", null, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo,
             *  null, null, publishException.Message);
             *
             *  System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, publishException.Message);
             *  System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("10.1.2.111");
             *
             *  Uri uri = new Uri("http://tempuri.org/");
             *  System.Net.ICredentials credentials = System.Net.CredentialCache.DefaultCredentials;
             *  System.Net.NetworkCredential credential = credentials.GetCredential(uri, "Basic");
             *
             *  client.Credentials = credential;
             *  client.Send(message);
             *
             *  this.DelayPublishAndDistribution(15, publishException.Message, panelSetOrder);
             *
             *  result = false;
             * }
             */

            return(result);
        }
        private void HyperLinkPublish_Click(object sender, RoutedEventArgs e)
        {
            if (this.m_PanelSetOrder.Final == true)
            {
                YellowstonePathology.Business.Interface.ICaseDocument caseDocument  = YellowstonePathology.Business.Document.DocumentFactory.GetDocument(this.m_AccessionOrder, this.m_PanelSetOrder, Business.Document.ReportSaveModeEnum.Normal);
                YellowstonePathology.Business.OrderIdParser           orderIdParser = new Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
                YellowstonePathology.Business.Rules.MethodResult      methodResult  = caseDocument.DeleteCaseFiles(orderIdParser);

                if (methodResult.Success == true)
                {
                    caseDocument.Render();
                    caseDocument.Publish();
                    MessageBox.Show("The document has been published.");
                }
                else
                {
                    MessageBox.Show(methodResult.Message);
                }
            }
            else
            {
                MessageBox.Show("You cannot publish this case until it's final.");
            }
        }