public ActionResult SavePlanta(int id, PlantaxprocesoRequest planta, UserInformation user) { return(this.TryCatch(() => { var esProcurador = user.MiAplicacion.Exists(x => x.NombreRol == "Procurador"); this.procesoService.CanUpdateProceso(id, user.Id, esProcurador); planta.usuario = user.UserName; this.detailProcesoService.SavePlanta(planta, id); var plantas = this.detailProcesoService.ListarPlantas(id); return this.JsonResponse(true, 200, "Planta guardada", new { plantas }); })); }
public void SavePlanta(PlantaxprocesoRequest request, int id_proceso) { var planta = Mapper.Map <PlantaxprocesoRequest, PLANTAXPROCESO>(request); try { planta.AUDITMOD = DateTime.Now; planta.ID_PROCESO = id_proceso; this.plantaxprocesoRepositorio.Insertar(planta); this.unitOfWork.Guardar(); } catch (Exception e) { Abort(500, "Ocurrió un error interno", null, e); } }