private void DetermineTransmitDestination(AssociatedDoc assDoc) { if (transmitDestination.IsValid) { if (!InboundSettings.IsProductionSystem && !transmitDestination.IsValidNonProdSendToAddress()) { throw new Exception(String.Format( "Unable to send to '{0}' from a non-production system.", transmitDestination.Value) + Environment.NewLine + "Error CNF-423 in " + FORM_NAME + ".DetermineTransmitDestination()."); } return; } using (var rqstForm = new frmAssignFaxNo()) { rqstForm.SetFaxNumbers("", assDoc.XmitValue ?? ""); rqstForm.SetIsAssociatedDoc(true); rqstForm.ShowDialog(); transmitDestination = rqstForm.TransmitDestination; } }
private void ChangeFaxNoSendResend(object sender, ItemClickEventArgs e) { try { //5/20/09 Israel - Menu item and handler created to allow change fax number and resend. //Get fax number data and send to form myTimer.Stop(); int rowHandle = GetGridViewFocusedRowHandle(gridViewSummary); string cptySn = gridViewSummary.GetRowCellDisplayText(rowHandle, "CptySn").ToString(); string cdtyCode = gridViewSummary.GetRowCellDisplayText(rowHandle, "CdtyCode").ToString(); string sttlType = gridViewSummary.GetRowCellDisplayText(rowHandle, "SttlType").ToString(); //Deprecated Israel 6/15/2015 string oldFaxNo = ""; //Israel 9/18/2015 //string[] getCptyFaxNoResult = GetCptyFaxNo(cptySn, cdtyCode, sttlType); string newFaxNo = "none@domain_name.com"; string transMethod = "EMAIL"; //if (getCptyFaxNoResult[0] != null) // transMethod = getCptyFaxNoResult[0]; //if (getCptyFaxNoResult[1] != null) // newFaxNo = getCptyFaxNoResult[1]; GridView view = gridViewConfirm; string savedTransInd = view.GetRowCellDisplayText(view.FocusedRowHandle, "FaxTelexInd").ToString(); string savedFaxNumber = view.GetRowCellDisplayText(view.FocusedRowHandle, "FaxTelexNumber").ToString(); string savedTransMethod = GetFaxMethodFromInd(savedTransInd); frmAssignFaxNo assignFaxNoForm = new frmAssignFaxNo(); assignFaxNoForm.SetFaxNumbers(newFaxNo, savedFaxNumber); if (assignFaxNoForm.ShowDialog(this) == DialogResult.OK) { string liveFaxNumber = assignFaxNoForm.teditFaxTelexNumber.Text; //string liveTransMethod = "FAX"; string liveTransMethod = liveFaxNumber.Contains("@") ? liveTransMethod = "EMAIL" : liveTransMethod = "FAX"; string liveTransInd = GetFaxIndFromMethod(liveTransMethod); Int32 confirmId = Int32.Parse(view.GetRowCellDisplayText(view.FocusedRowHandle, "Id")); Int32 tradeId = Int32.Parse(view.GetRowCellDisplayText(view.FocusedRowHandle, "TradeId")); Int32 rqmtId = Int32.Parse(view.GetRowCellDisplayText(view.FocusedRowHandle, "RqmtId")); //Int32 templateId = Int32.Parse(view.GetRowCellDisplayText(view.FocusedRowHandle, "TemplateId")); string templateName = view.GetRowCellDisplayText(view.FocusedRowHandle, "TemplateName"); string confirmLabel = view.GetRowCellDisplayText(view.FocusedRowHandle, "ConfirmLabel"); string cmt = view.GetRowCellDisplayText(view.FocusedRowHandle, "ConfirmCmt"); string nextStatusCode = view.GetRowCellValue(view.FocusedRowHandle, "NextStatusCode").ToString(); string activeFlag = view.GetRowCellValue(view.FocusedRowHandle, "ActiveFlag").ToString(); if (liveFaxNumber.Length > 2) { using (var ts = new TransactionScope()) { UpdateTradeRqmtConfirmRow(confirmId, tradeId, rqmtId, templateName, liveTransInd, liveFaxNumber, confirmLabel, cmt, nextStatusCode, activeFlag); Vaulter vaulter = new Vaulter(sqlConnectionStr); vaulter.VaultTradeRqmtConfirm(confirmId, null); SendToFaxGateway(confirmId, cptySn, false, "", "SENT", false); ts.Complete(); } } } } catch (Exception ex) { XtraMessageBox.Show("An error occurred while attempting to 'Change Send-To Address & Send/Resend' a Confirm Document." + Environment.NewLine + "Error CNF-156 in " + FORM_NAME + ".ChangeFaxNoSendResend(): " + ex.Message, MAIN_FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { myTimer.Start(); } }