public ActionResult Post(bool IsNew, Otras_Identificaciones_Requerido_MASCModel varOtras_Identificaciones_Requerido_MASC) { try { if (ModelState.IsValid) { if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } _IOtras_Identificaciones_Requerido_MASCApiConsumer.SetAuthHeader(_tokenManager.Token); var result = ""; var Otras_Identificaciones_Requerido_MASCInfo = new Otras_Identificaciones_Requerido_MASC { Clave = varOtras_Identificaciones_Requerido_MASC.Clave , Tipo_de_Identificacion = varOtras_Identificaciones_Requerido_MASC.Tipo_de_Identificacion , Descripcion = varOtras_Identificaciones_Requerido_MASC.Descripcion }; result = !IsNew? _IOtras_Identificaciones_Requerido_MASCApiConsumer.Update(Otras_Identificaciones_Requerido_MASCInfo, null, null).Resource.ToString() : _IOtras_Identificaciones_Requerido_MASCApiConsumer.Insert(Otras_Identificaciones_Requerido_MASCInfo, 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)); } _IOtras_Identificaciones_Requerido_MASCApiConsumer.SetAuthHeader(_tokenManager.Token); Otras_Identificaciones_Requerido_MASC varOtras_Identificaciones_Requerido_MASC = null; if (id.ToString() != "0") { string where = ""; } var result = _IOtras_Identificaciones_Requerido_MASCApiConsumer.Delete(id, null, null).Resource; return(Json(result, JsonRequestBehavior.AllowGet)); } catch (ServiceException ex) { return(Json(false, JsonRequestBehavior.AllowGet)); } }