protected override void Create() { var letterOfCredit = new LetterOfCredit { PorS = (int) LCPorS.LCPurchase, IssueAmount = Amount, LCNo = LCNo, LCType = LCType, LCStatus = LCStatusId, ApplicantId = ApplicantId, BeneficiaryId = BeneficiaryId, CurrencyId = CurrencyId, LCDays = LCDays, PromptBasis = PromptBasisId, //AdvisingBankId = AdvisingBankId, IssueBankId = IssueBankId, IssueDate = IssueDate, IssueQuantity = IssueQuantity, AcceptanceExpiryDate = AcceptanceExpiryDate, LCExpiryDate = LCExpiryDate, LatestShippmentDate = LatestShippmentDate, ActualAcceptanceDate = ActualAcceptanceDate, PresentAmount = PresentAmount, PresentDate = PresentDate, Comment = Comment, IBORType = IBORType, FinancialStatus = FinanceStatus == 1, IBORValue = IBORValue, Float = Float, Interest = Interest, QuotaId = SelectedQuotaId, PaymentRequestId = PaymentRequestId, }; if (AdvisingBankId.HasValue && AdvisingBankId.Value != 0) { letterOfCredit.AdvisingBankId = AdvisingBankId; } else { letterOfCredit.AdvisingBankId = null; } using ( var letterOfCreditService = SvcClientManager.GetSvcClient<LetterOfCreditServiceClient>(SvcType.LetterOfCreditSvc)) { //IsExisted(); letterOfCreditService.CreateNewLetterOfCredit(letterOfCredit, CurrentUser.Id, Deliveries.ToList(), AddAttachments, IsLCFinished); } }
private void FixupMasterLC(LetterOfCredit previousValue, bool skipKeys = false) { if (IsDeserializing) { return; } if (previousValue != null && previousValue.SlaveLC.Contains(this)) { previousValue.SlaveLC.Remove(this); } if (MasterLC != null) { if (!MasterLC.SlaveLC.Contains(this)) { MasterLC.SlaveLC.Add(this); } RelLCId = MasterLC.Id; } else if (!skipKeys) { RelLCId = null; } if (ChangeTracker.ChangeTrackingEnabled) { if (ChangeTracker.OriginalValues.ContainsKey("MasterLC") && (ChangeTracker.OriginalValues["MasterLC"] == MasterLC)) { ChangeTracker.OriginalValues.Remove("MasterLC"); } else { ChangeTracker.RecordOriginalValue("MasterLC", previousValue); } if (MasterLC != null && !MasterLC.ChangeTracker.ChangeTrackingEnabled) { MasterLC.StartTracking(); } } }