public static EndingStatementBalance Create(EndingStatementBalanceAddModel model, string userId)
        {
            var endingStatementBalance = new EndingStatementBalance
            {
                BankAccountId       = model.BankAccountId,
                EndingBalanceDate   = model.EndingBalanceDate,
                EndingBalanceAmount = model.EndingBalanceAmount
            };

            return(endingStatementBalance);
        }
 public async Task <IActionResult> Add([FromBody] EndingStatementBalanceAddModel model)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState.GetErrorList()));
     }
     try
     {
         await _manager.AddAsync(model);
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
     return(Ok());
 }
示例#3
0
        public async Task AddAsync(EndingStatementBalanceAddModel model)
        {
            await _repository.AddAsync(EndingStatementBalanceFactory.Create(model, _userId));

            await _unitOfWork.SaveChangesAsync();
        }