public static void Create(EndingStatementBalanceEditModel model, EndingStatementBalance entity, string userId) { entity.Id = model.Id; entity.BankAccountId = model.BankAccountId; entity.EndingBalanceAmount = model.EndingBalanceAmount; entity.EndingBalanceDate = model.EndingBalanceDate; }
public async Task EditAsync(EndingStatementBalanceEditModel model) { EndingStatementBalance endingStatementBalance = new EndingStatementBalance(); EndingStatementBalanceFactory.Create(model, endingStatementBalance, _userId); _repository.Edit(endingStatementBalance); await _unitOfWork.SaveChangesAsync(); }
public async Task <IActionResult> Edit([FromBody] EndingStatementBalanceEditModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorList())); } try { await _manager.EditAsync(model); } catch (Exception ex) { return(BadRequest(ex.Message)); } return(Ok()); }