示例#1
0
        public AccountTransaction PostAccountTransaction(AccountTransaction accountTransaction)
        {
            var item = AccountTransactions.FirstOrDefault(c => c.AccountTransactionId == accountTransaction.AccountTransactionId);

            if (item != null)
            {
                item = accountTransaction;
                return(item);
            }
            else
            {
                accountTransaction.AccountTransactionId = GenerateAccontTransactionId();
                AccountTransactions.Add(accountTransaction);
                return(accountTransaction);
            }
        }
示例#2
0
 public StockTransaction GetStockTransaction(int stockTransactionId)
 {
     if (StockTransactions.Any(c => c.StockTransactionId == stockTransactionId))
     {
         var result = StockTransactions.First(c => c.StockTransactionId == stockTransactionId);
         if (result.AccountTransaction == null)
         {
             result.AccountTransaction = AccountTransactions.FirstOrDefault(c => c.AccountTransactionId == result.AccountTransactionId);
         }
         if (result.Stock == null)
         {
             result.Stock = GetStock(result.StockCode);
         }
         return(result);
     }
     return(null);
 }
示例#3
0
        public void DeleteAccountTransaction(int no)
        {
            using (var core = new StandardBusinessLayer(this))
            {
                core.Connect();

                AccountTransaction transaction = AccountTransactions.FirstOrDefault(t => t.No == no);

                if (transaction != null)
                {
                    Verification verification = Verifications.FirstOrDefault(v => v.No == transaction.VerificationNo);

                    core.DeleteAccountTransaction(no);
                    AccountTransactions.Remove(transaction);

                    FillVerification(verification);
                }
            }
        }
示例#4
0
 public AccountTransaction GetAccountTransaction(int no)
 {
     return(AccountTransactions.FirstOrDefault(t => t.No == no));
 }