public ActionResult Post(bool IsNew, Area_PericialModel varArea_Pericial) { try { //if (ModelState.IsValid) //{ if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } _IArea_PericialApiConsumer.SetAuthHeader(_tokenManager.Token); var result = ""; var Area_PericialInfo = new Area_Pericial { Clave = varArea_Pericial.Clave , Descripcion = varArea_Pericial.Descripcion }; result = !IsNew? _IArea_PericialApiConsumer.Update(Area_PericialInfo, null, null).Resource.ToString() : _IArea_PericialApiConsumer.Insert(Area_PericialInfo, null, null).Resource.ToString(); Session["KeyValueInserted"] = result; 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)); } _IArea_PericialApiConsumer.SetAuthHeader(_tokenManager.Token); Area_Pericial varArea_Pericial = null; if (id.ToString() != "0") { string where = ""; } var result = _IArea_PericialApiConsumer.Delete(id, null, null).Resource; return(Json(result, JsonRequestBehavior.AllowGet)); } catch (ServiceException ex) { return(Json(false, JsonRequestBehavior.AllowGet)); } }