public ActionResult Post(bool IsNew, Detalle_Aseguramiento_DocumentosModel varDetalle_Aseguramiento_Documentos) { try { if (ModelState.IsValid) { if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } _IDetalle_Aseguramiento_DocumentosApiConsumer.SetAuthHeader(_tokenManager.Token); var result = ""; var Detalle_Aseguramiento_DocumentosInfo = new Detalle_Aseguramiento_Documentos { Clave = varDetalle_Aseguramiento_Documentos.Clave , Motivo_de_Registro = varDetalle_Aseguramiento_Documentos.Motivo_de_Registro , Tipo = varDetalle_Aseguramiento_Documentos.Tipo , Cantidad = varDetalle_Aseguramiento_Documentos.Cantidad , Observaciones = varDetalle_Aseguramiento_Documentos.Observaciones , Descipcion_de_Documento = varDetalle_Aseguramiento_Documentos.Descipcion_de_Documento }; result = !IsNew? _IDetalle_Aseguramiento_DocumentosApiConsumer.Update(Detalle_Aseguramiento_DocumentosInfo, null, null).Resource.ToString() : _IDetalle_Aseguramiento_DocumentosApiConsumer.Insert(Detalle_Aseguramiento_DocumentosInfo, 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_DocumentosApiConsumer.SetAuthHeader(_tokenManager.Token); Detalle_Aseguramiento_Documentos varDetalle_Aseguramiento_Documentos = null; if (id.ToString() != "0") { string where = ""; } var result = _IDetalle_Aseguramiento_DocumentosApiConsumer.Delete(id, null, null).Resource; return(Json(result, JsonRequestBehavior.AllowGet)); } catch (ServiceException ex) { return(Json(false, JsonRequestBehavior.AllowGet)); } }