public ActionResult Post(bool IsNew, Detalle_Condiciones_Proceso_PenalModel varDetalle_Condiciones_Proceso_Penal) { try { if (ModelState.IsValid) { if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } _IDetalle_Condiciones_Proceso_PenalApiConsumer.SetAuthHeader(_tokenManager.Token); var result = ""; var Detalle_Condiciones_Proceso_PenalInfo = new Detalle_Condiciones_Proceso_Penal { Clave = varDetalle_Condiciones_Proceso_Penal.Clave , Medida_Cautelar = varDetalle_Condiciones_Proceso_Penal.Medida_Cautelar }; result = !IsNew? _IDetalle_Condiciones_Proceso_PenalApiConsumer.Update(Detalle_Condiciones_Proceso_PenalInfo, null, null).Resource.ToString() : _IDetalle_Condiciones_Proceso_PenalApiConsumer.Insert(Detalle_Condiciones_Proceso_PenalInfo, null, null).Resource.ToString(); return(Json(result, JsonRequestBehavior.AllowGet)); } return(Json(false, JsonRequestBehavior.AllowGet)); } catch (ServiceException ex) { return(Json(false, JsonRequestBehavior.AllowGet)); } }
public ActionResult Delete(int id) { try { if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } _IDetalle_Condiciones_Proceso_PenalApiConsumer.SetAuthHeader(_tokenManager.Token); Detalle_Condiciones_Proceso_Penal varDetalle_Condiciones_Proceso_Penal = null; if (id.ToString() != "0") { string where = ""; } var result = _IDetalle_Condiciones_Proceso_PenalApiConsumer.Delete(id, null, null).Resource; return(Json(result, JsonRequestBehavior.AllowGet)); } catch (ServiceException ex) { return(Json(false, JsonRequestBehavior.AllowGet)); } }