public ActionResult Post(bool IsNew, Detalle_Vinculacion_JudicializacionModel varDetalle_Vinculacion_Judicializacion) { try { if (ModelState.IsValid) { if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } _IDetalle_Vinculacion_JudicializacionApiConsumer.SetAuthHeader(_tokenManager.Token); var result = ""; var Detalle_Vinculacion_JudicializacionInfo = new Detalle_Vinculacion_Judicializacion { Clave = varDetalle_Vinculacion_Judicializacion.Clave , Relacion = varDetalle_Vinculacion_Judicializacion.Relacion }; result = !IsNew? _IDetalle_Vinculacion_JudicializacionApiConsumer.Update(Detalle_Vinculacion_JudicializacionInfo, null, null).Resource.ToString() : _IDetalle_Vinculacion_JudicializacionApiConsumer.Insert(Detalle_Vinculacion_JudicializacionInfo, null, null).Resource.ToString(); return(Json(result, JsonRequestBehavior.AllowGet)); } return(Json(false, JsonRequestBehavior.AllowGet)); } catch (ServiceException ex) { return(Json(false, JsonRequestBehavior.AllowGet)); } }
public ActionResult Create(int Id = 0, int consult = 0) { int ModuleId = (Session["CurrentModuleId"] != null) ? Convert.ToInt32(Session["CurrentModuleId"]) : 0; var permission = PermissionHelper.GetRoleObjectPermission(SessionHelper.Role, 45638); ViewBag.Permission = permission; var varDetalle_Vinculacion_Judicializacion = new Detalle_Vinculacion_JudicializacionModel(); ViewBag.ObjectId = "45638"; ViewBag.Operation = "New"; ViewBag.IsNew = true; if ((Id.GetType() == typeof(string) && Id.ToString() != "") || ((Id.GetType() == typeof(int) || Id.GetType() == typeof(Int16) || Id.GetType() == typeof(Int32) || Id.GetType() == typeof(Int64) || Id.GetType() == typeof(short)) && Id.ToString() != "0")) { ViewBag.IsNew = false; ViewBag.Operation = "Update"; if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } _IDetalle_Vinculacion_JudicializacionApiConsumer.SetAuthHeader(_tokenManager.Token); var Detalle_Vinculacion_JudicializacionData = _IDetalle_Vinculacion_JudicializacionApiConsumer.GetByKeyComplete(Id).Resource.Detalle_Vinculacion_Judicializacions[0]; if (Detalle_Vinculacion_JudicializacionData == null) { return(HttpNotFound()); } varDetalle_Vinculacion_Judicializacion = new Detalle_Vinculacion_JudicializacionModel { Clave = (int)Detalle_Vinculacion_JudicializacionData.Clave , Relacion = Detalle_Vinculacion_JudicializacionData.Relacion }; } if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } ViewBag.Consult = consult == 1; if (consult == 1) { ViewBag.Operation = "Consult"; } return(View(varDetalle_Vinculacion_Judicializacion)); }
public ActionResult AddDetalle_Vinculacion_Judicializacion(int rowIndex = 0, int functionMode = 0, int id = 0) { int ModuleId = (Session["CurrentModuleId"] != null) ? Convert.ToInt32(Session["CurrentModuleId"]) : 0; ViewBag.currentRowIndex = rowIndex; ViewBag.functionMode = functionMode; ViewBag.Consult = false; var permission = PermissionHelper.GetRoleObjectPermission(SessionHelper.Role, 45638); ViewBag.Permission = permission; if (!_tokenManager.GenerateToken()) { return(null); } _IDetalle_Vinculacion_JudicializacionApiConsumer.SetAuthHeader(_tokenManager.Token); Detalle_Vinculacion_JudicializacionModel varDetalle_Vinculacion_Judicializacion = new Detalle_Vinculacion_JudicializacionModel(); if (id.ToString() != "0") { var Detalle_Vinculacion_JudicializacionsData = _IDetalle_Vinculacion_JudicializacionApiConsumer.ListaSelAll(0, 1000, "Detalle_Vinculacion_Judicializacion.Clave=" + id, "").Resource.Detalle_Vinculacion_Judicializacions; if (Detalle_Vinculacion_JudicializacionsData != null && Detalle_Vinculacion_JudicializacionsData.Count > 0) { var Detalle_Vinculacion_JudicializacionData = Detalle_Vinculacion_JudicializacionsData.First(); varDetalle_Vinculacion_Judicializacion = new Detalle_Vinculacion_JudicializacionModel { Clave = Detalle_Vinculacion_JudicializacionData.Clave , Relacion = Detalle_Vinculacion_JudicializacionData.Relacion }; } } if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } return(PartialView("AddDetalle_Vinculacion_Judicializacion", varDetalle_Vinculacion_Judicializacion)); }