public bool TryDelete(YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder, YellowstonePathology.Business.Interface.ICaseDocument caseDocument, YellowstonePathology.Business.OrderIdParser orderIdParser) { bool result = true; YellowstonePathology.Business.Rules.MethodResult methodResult = caseDocument.DeleteCaseFiles(orderIdParser); if (methodResult.Success == false) { this.DelayPublishAndDistribution(15, "Not able to delete files prior to publishing.", panelSetOrder); this.m_ReportDistributionLogEntryCollection.AddEntry("ERROR", "Publish Next", null, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo, null, null, "Not able to delete files prior to publishing."); System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, "Not able to delete files prior to publishing: " + panelSetOrder.ReportNo); 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); 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."); } }