public ActionResult <FinancialFlowModel> UpdateFinancialFlow( [FromBody] FinancialFlowModel obj ) { if (ModelState.IsValid) { var financial = _service.GetById(obj.Id); if (financial != null) { financial.Update(obj.IdFamily, obj.DateMovement, obj.TypeMovement, obj.TypePayment, obj.Description, obj.ProviderName, obj.IdMemberMovement, obj.UrlPaymentVoucher, obj.ValueMovement, obj.SituationMovement, User.Identity.Name); _service.Update(financial); return(obj); } else { return(NotFound("Registro não encontrado")); } } else { return(BadRequest(ModelState)); } }
public ActionResult <int> AddFinancialFlow( [FromBody] FinancialFlowModel obj ) { if (ModelState.IsValid) { var financial = new FinancialFlow(obj.IdFamily, obj.DateMovement, obj.TypeMovement, obj.TypePayment, obj.Description, obj.ProviderName, obj.IdMemberMovement, obj.UrlPaymentVoucher, obj.ValueMovement, obj.SituationMovement, User.Identity.Name); return(_service.Create(financial)); } else { return(BadRequest(ModelState)); } }