public ActionResult Post(bool IsNew, Servicios_AlternativosModel varServicios_Alternativos) { try { if (ModelState.IsValid) { if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } _IServicios_AlternativosApiConsumer.SetAuthHeader(_tokenManager.Token); var result = ""; var Servicios_AlternativosInfo = new Servicios_Alternativos { Clave = varServicios_Alternativos.Clave , CJusticia_Alternativa = varServicios_Alternativos.CJusticia_Alternativa , Medios_Alternativos = varServicios_Alternativos.Medios_Alternativos , Motivo = varServicios_Alternativos.Motivo , Derechos = varServicios_Alternativos.Derechos , Procedimiento = varServicios_Alternativos.Procedimiento , Solicita_Medios_Alternativos = varServicios_Alternativos.Solicita_Medios_Alternativos , Se_Canaliza = varServicios_Alternativos.Se_Canaliza , Investigacion_con_Detenido = varServicios_Alternativos.Investigacion_con_Detenido , Investigacion_sin_Detenido = varServicios_Alternativos.Investigacion_sin_Detenido , Turnar_a_Justicia_Alternativa = varServicios_Alternativos.Turnar_a_Justicia_Alternativa , Instancia_Externa = varServicios_Alternativos.Instancia_Externa }; result = !IsNew? _IServicios_AlternativosApiConsumer.Update(Servicios_AlternativosInfo, null, null).Resource.ToString() : _IServicios_AlternativosApiConsumer.Insert(Servicios_AlternativosInfo, 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)); } _IServicios_AlternativosApiConsumer.SetAuthHeader(_tokenManager.Token); Servicios_Alternativos varServicios_Alternativos = null; if (id.ToString() != "0") { string where = ""; } var result = _IServicios_AlternativosApiConsumer.Delete(id, null, null).Resource; return(Json(result, JsonRequestBehavior.AllowGet)); } catch (ServiceException ex) { return(Json(false, JsonRequestBehavior.AllowGet)); } }