public static bool Update(IDalSession session, IMoneyTransferOrder obj) { bool blnSuccess = session.InsertOrUpdate(obj); if (blnSuccess && obj.Reference == null) { obj.setReference(); blnSuccess = session.InsertOrUpdate(obj); } return blnSuccess; }
public GLDSTD(IMoneyTransferOrder newOrder) { this.Reference = newOrder.Reference; this.CurrencyCode = newOrder.Amount.UnderlyingShortName; this.NarDebet1 = newOrder.NarDebet1; this.NarDebet2 = newOrder.NarDebet2; this.NarDebet3 = newOrder.NarDebet3; this.NarDebet4 = newOrder.NarDebet4; this.DebetAcctNr = newOrder.TransferorJournal.BankAccountNumber; this.NarBenef1 = Util.ConvertToAscii(newOrder.NarBenef1); this.NarBenef2 = Util.ConvertToAscii(newOrder.NarBenef2); this.NarBenef3 = Util.ConvertToAscii(newOrder.NarBenef3); this.NarBenef4 = Util.ConvertToAscii(newOrder.NarBenef4); this.SwiftCorrespondentBank = (newOrder.SwiftAddress != null ? newOrder.SwiftAddress : ""); this.BenefBankAcctNr = newOrder.BenefBankAcctNr; this.GroundForPayment1 = newOrder.TransferDescription1; this.GroundForPayment2 = newOrder.TransferDescription2; this.GroundForPayment3 = Util.ConvertToAscii(newOrder.TransferDescription3); this.GroundForPayment4 = newOrder.TransferDescription4; switch (newOrder.CostIndication) { case IndicationOfCosts.Beneficiary: this.IndicationOfCost = "B"; break; case IndicationOfCosts.Ours: this.IndicationOfCost = "O"; break; case IndicationOfCosts.Shared: this.IndicationOfCost = "S"; break; default: this.IndicationOfCost = "O"; break; } this.Amount = Decimal.Multiply(newOrder.Amount.Quantity, 100m).ToString("###").PadLeft(17, '0'); this.IndicationOfNonRes = "0"; this.NatureOfCP = "0"; this.ProcessDate = newOrder.ProcessDate.ToString("yyyyMMdd"); this.CircuitCode = "B"; this.OptionsContract = "N"; //add the Money Order record to the GLDSTD OriginalMoneyOrder = newOrder; newOrder.GLDSTDRecord = this; newOrder.SetStatus(MoneyTransferOrderStati.FileCreated); }