示例#1
0
        public void New(int issuerEntityID, int receiverEntityID, decimal amount, int currencyID)
        {
            using (var ctx = new accountingEntities())
            using (var ts = new TransactionScope())
            {
                base.TRANSFER = new transfer()
                {
                    issuerEntityID = issuerEntityID,
                    receiverEntityID = receiverEntityID,
                    amount = amount,
                    currencyID = currencyID,
                    transferTypeID = (int)TRANSFERTYPE
                };
                ctx.transfers.AddObject(TRANSFER);

                EXTERNALTSFR = new externalTransfer { ID = TRANSFER.ID };
                ctx.externalTransfers.AddObject(EXTERNALTSFR);

                DBTSFR = new debitTransfer { ID = EXTERNALTSFR.ID };
                ctx.debitTransfers.AddObject(DBTSFR);

                ctx.SaveChanges();
                ts.Complete();
            }
        }
示例#2
0
        public void Load(int dbTransferID)
        {
            using (var ctx = new accountingEntities())
            {
                var all= ctx.debitTransfers
                    .Where(x => x.ID == dbTransferID)
                    .SingleOrDefault();

                DBTSFR = all;
                base.EXTERNALTSFR = all.externalTransfer;
                base.TRANSFER = all.externalTransfer.transfer;
            }
        }
 /// <summary>
 /// Create a new debitTransfer object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static debitTransfer CreatedebitTransfer(global::System.Int32 id)
 {
     debitTransfer debitTransfer = new debitTransfer();
     debitTransfer.ID = id;
     return debitTransfer;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the debitTransfers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTodebitTransfers(debitTransfer debitTransfer)
 {
     base.AddObject("debitTransfers", debitTransfer);
 }