public ActionResult <ApoyoViewModel> Post(ApoyoInputModel apoyoInput) { Apoyo apoyo = MapearApoyo(apoyoInput); var response = _apoyoService.Guardar(apoyo); if (response.Error) { return(BadRequest(response.Mensaje)); } return(Ok(response.Apoyo)); /*if (persona.modalidad == "Economico") * { * valorTotal = calcularValorTotal(persona, personas) + Convert.ToInt32(persona.Aporte); * persona.TotalAporteEconomico = valorTotal; * } * * if (valorTotal <= 600000000) * { * _personaService.Guardar(persona); * mensaje = "Registrado correctamente"; * } * else * { * mensaje = "Se acabaron los recursos"; * }*/ }
private Apoyo MapearApoyo(ApoyoInputModel apoyoInput) { var apoyo = new Apoyo { Persona = apoyoInput.Persona, Tipoapoyo = apoyoInput.Tipoapoyo, Vrapoyo = apoyoInput.Vrapoyo, }; return(apoyo); }
public ActionResult <ApoyoViewModel> Post(ApoyoInputModel apoyoInput) { Apoyo apoyo = MapearApoyo(apoyoInput); var response = apoyoService.Guardar(apoyo); if (response.Error) { return(BadRequest(response.Mensaje)); } return(Ok(response.Apoyo)); }
public ActionResult <ApoyoViewModel> Post(ApoyoInputModel apyInput) { Apoyo apy = MapearApoyo(apyInput); var response = _apyService.Guardar(apy); if (response == null) { return(BadRequest("No se permiten guardar identificaciones repetidas")); } return(Ok(response)); }
private Apoyo MapearApoyo(ApoyoInputModel apoyoInput) { var apoyo = new Apoyo { modalidad = apoyoInput.modalidad, Aporte = apoyoInput.aporte, fecha = apoyoInput.fecha, }; return(apoyo); }
private Apoyo MapearApoyo(ApoyoInputModel apoyoInput) { var apoyo = new Apoyo { Persona = apoyoInput.Persona, ModalidadApoyo = apoyoInput.ModalidadApoyo, ValorApoyo = apoyoInput.ValorApoyo, FechaEntrega = apoyoInput.FechaEntrega, }; return(apoyo); }
private Apoyo MapearApoyo(ApoyoInputModel apyInput) { var apy = new Apoyo { Persona = apyInput.Persona, Valor = apyInput.Valor, Tipo = apyInput.Tipo, Fecha = apyInput.Fecha }; return(apy); }
private Apoyo MapearApoyo(ApoyoInputModel apoyoInput) { var apoyo = new Apoyo { ApoyoId = apoyoInput.ApoyoId, PersonaId = apoyoInput.PersonaId, Valor = apoyoInput.Valor, Modalidad = apoyoInput.Modalidad, Fecha = apoyoInput.Fecha, }; return(apoyo); }
public ActionResult <ApoyoViewModel> Post(ApoyoInputModel apoyoInput) { Apoyo apoyo = MapearApoyo(apoyoInput); var response = _apoyoService.Guardar(apoyo); if (response.Error) { //------------------------------------------------------------------------------------ //Retornar los mensajes de validación adicionales en el mismo fomato que el ModalState ModelState.AddModelError("Guardar Persona", response.Mensaje); var problemDetails = new ValidationProblemDetails(ModelState) { Status = StatusCodes.Status400BadRequest, }; return(BadRequest(problemDetails)); //------------------------------------------------------------------------------------ //return BadRequest(response.Mensaje); } return(Ok(response.Apoyo)); }