public void TransmitDocument(AssociatedDoc assDoc) { try { var doc = assDoc ?? GetActiveAssDoc(); if (doc == null) { XtraMessageBox.Show("Error CNF-506 in " + FORM_NAME + ".TransmitDocument: Unable to generate Active Associated Document."); return; } var sumData = GetTradeSummaryDataRec(doc.TradeId); var transmitter = new DocumentTransmitter(mImagesDal, vaulter, xmitRequestDal, TransmitDestination); transmitter.SendToGateway(doc, sumData); UpdateViewWithTransmitInformation(doc, transmitter); } catch (Exception ex) { LogAndDisplayException("An error occurred while transmitting the document." + Environment.NewLine + "Error CNF-463 in " + FORM_NAME + ".TransmitDocument().", ex); } }
public void TransmitDocuments() { IList<AssociatedDoc> failedDocs = new List<AssociatedDoc>(); IList<AssociatedDoc> xmitDocs = new List<AssociatedDoc>(); foreach (var rowHandle in gridViewMatchedDocuments.GetSelectedRows()) { gridViewMatchedDocuments.FocusedRowHandle = rowHandle; var dr = gridViewMatchedDocuments.GetDataRow(rowHandle); if (dr != null) { var doc = CollectionHelper.CreateObjectFromDataRow<AssociatedDoc>(dr); if (doc != null) { var sumData = GetTradeSummaryDataRec(doc.TradeId); var transmitDest = GetCptyFaxNo(sumData); if (transmitDest == null || !transmitDest.IsValid) { failedDocs.Add(doc); } else { var transmitter = new DocumentTransmitter(mImagesDal, vaulter, xmitRequestDal, transmitDest); transmitter.SendToGateway(doc, sumData); xmitDocs.Add(doc); } } } } XtraMessageBox.Show(failedDocs.Count + " documents were not able to be transmitted due to no default fax or email address associated with documents. " + xmitDocs.Count + " documents were actually sent."); gridViewMatchedDocuments.ClearSelection(); foreach (var assDoc in failedDocs) { SelectAssociatedDoc(assDoc); } }
public void TransmitDocument(SummaryData sumData, AssociatedDoc assDoc) { string pageList = null; string fileName = null; try { if (assDoc == null) { throw new NotSupportedException("Error CNF-523: Unable to transmit without an associated document data."); } if (sumData == null) { throw new NotSupportedException("Error CNF-524: Unable to transmit a document without trade summary data."); } var transmitter = new DocumentTransmitter(imagesDal, vaulter, xmitRequestDal); transmitter.SendToGateway(assDoc, sumData); } catch (Exception ex) { LogAndDisplayException("An error occurred while transmitting the document." + Environment.NewLine + "Error CNF-525 in " + FORM_NAME + ".TransmitDocument(): ", ex); } }