private void AssertAccount(Account accountX, Account accountY)
 {
    Assert.AreEqual(accountX.AccountType,accountY.AccountType);
    Assert.AreEqual(accountX.Balance, accountY.Balance);
    Assert.AreEqual(accountX.CostcentreId, accountY.CostcentreId);
    Assert.AreEqual(accountX.Id, accountY.Id);
 }
Пример #2
0
 protected Guid AddAccount(Guid CostCenteId, int AccType, decimal Balance)
 {
     Account acc = new Account
     {
         CostcentreId = CostCenteId,
         AccountType = AccountType.Cash,
         Balance = Balance
     };
     return _accountRepository.Add(acc);
 }
        public List<AccountTransaction> GetByCostCentre(Guid costCentreId, Account account, DocumentType? documentType)
        {

            List<AccountTransaction> qry = null;
            if (documentType == null)
            {
                qry = _ctx.tblAccountTransaction.Where(n => n.tblAccount.CostCenterId == costCentreId && n.tblAccount.id == account.Id
                                            ).ToList().Select(n => Map(n)).ToList();
            }
            else
            {
                int docType = (int)documentType;
                qry = _ctx.tblAccountTransaction.Where(n => n.tblAccount.CostCenterId == costCentreId && n.tblAccount.id == account.Id)
                                            .ToList().Select(n => Map(n)).ToList();
            }

            return qry;
        }