public async Task <IActionResult> UpdateFeeVoucherDetails(FeeVoucherDetailForUpdateDto model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _response = await _repo.UpdateFeeVoucherDetails(model); return(Ok(_response)); }
public async Task <ServiceResponse <object> > UpdateFeeVoucherDetails(FeeVoucherDetailForUpdateDto model) { var ToUpdate = await _context.FeeVoucherDetails.Where(m => m.Id == model.Id).FirstOrDefaultAsync(); if (ToUpdate != null) { ToUpdate.ExtraChargesAmount = model.ExtraChargesAmount; ToUpdate.ExtraChargesDetails = model.ExtraChargesDetails; ToUpdate.BankAccountId = model.BankAccountId; ToUpdate.Month = model.Month; } _context.FeeVoucherDetails.Update(ToUpdate); await _context.SaveChangesAsync(); _serviceResponse.Success = true; _serviceResponse.Message = CustomMessage.Added; return(_serviceResponse); }