public ActionResult Post(bool IsNew, Detalle_Aseguramiento_Artefactos_y_ExplosivosModel varDetalle_Aseguramiento_Artefactos_y_Explosivos) { try { if (ModelState.IsValid) { if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } _IDetalle_Aseguramiento_Artefactos_y_ExplosivosApiConsumer.SetAuthHeader(_tokenManager.Token); var result = ""; var Detalle_Aseguramiento_Artefactos_y_ExplosivosInfo = new Detalle_Aseguramiento_Artefactos_y_Explosivos { Clave = varDetalle_Aseguramiento_Artefactos_y_Explosivos.Clave , Motivo_de_Registro = varDetalle_Aseguramiento_Artefactos_y_Explosivos.Motivo_de_Registro , Clasificacion = varDetalle_Aseguramiento_Artefactos_y_Explosivos.Clasificacion , Cantidad = varDetalle_Aseguramiento_Artefactos_y_Explosivos.Cantidad , Lugar_de_Hallazgo = varDetalle_Aseguramiento_Artefactos_y_Explosivos.Lugar_de_Hallazgo , Observaciones = varDetalle_Aseguramiento_Artefactos_y_Explosivos.Observaciones }; result = !IsNew? _IDetalle_Aseguramiento_Artefactos_y_ExplosivosApiConsumer.Update(Detalle_Aseguramiento_Artefactos_y_ExplosivosInfo, null, null).Resource.ToString() : _IDetalle_Aseguramiento_Artefactos_y_ExplosivosApiConsumer.Insert(Detalle_Aseguramiento_Artefactos_y_ExplosivosInfo, 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_Aseguramiento_Artefactos_y_ExplosivosApiConsumer.SetAuthHeader(_tokenManager.Token); Detalle_Aseguramiento_Artefactos_y_Explosivos varDetalle_Aseguramiento_Artefactos_y_Explosivos = null; if (id.ToString() != "0") { string where = ""; } var result = _IDetalle_Aseguramiento_Artefactos_y_ExplosivosApiConsumer.Delete(id, null, null).Resource; return(Json(result, JsonRequestBehavior.AllowGet)); } catch (ServiceException ex) { return(Json(false, JsonRequestBehavior.AllowGet)); } }