public async Task <IActionResult> Create([FromBody] BusinessAccountRequestModel model) { model.Validate(); var result = await _businessAccountMgr.AddAccount(new BusinessAccountModel { AccountName = model.AccountName, AccountNumber = model.AccountNumber, BusinessId = model.BusinessId, BankId = model.BankId, Comment = model.Comment }); return(Ok(new ResponseModel <bool> { RequestSuccessful = true, ResponseCode = ResponseCodes.Successful, ResponseData = result }));; }
public async Task <IActionResult> Update(long Id, [FromBody] BusinessAccountRequestModel model) { model.Validate(); if (Id == default(long)) { throw new BadRequestException("Invalid request. Business account is required"); } var result = await _businessAccountMgr.Update(new BusinessAccountModel { AccountName = model.AccountName, AccountNumber = model.AccountNumber, BusinessId = model.BusinessId, BankId = model.BankId, Comment = model.Comment, Id = Id }); return(Ok(new ResponseModel <bool> { RequestSuccessful = true, ResponseCode = ResponseCodes.Successful, ResponseData = result })); }