public ActionResult Edit(string currentNode) { SA_Resource curResource = JSON.Deserialize <SA_Resource>(currentNode); return(new PartialViewResult { ViewName = "Edit", Model = curResource }); }
public ActionResult Update(SA_Resource entity) { if (ModelState.IsValid) { entity.Show = GetCheckBoxValue(entity.Show); _service.UpdateResource(entity); _service.Save(); var window = this.GetCmp <Window>("windowSA_Resource"); window.Hide(); this.GetCmp <Store>("storeSA_Resource").Reload(); return(this.Direct()); } return(this.Direct()); }
public ActionResult Insert(SA_Resource entity) { if (ModelState.IsValid) { entity.Show = GetCheckBoxValue(entity.Show); entity.ResourceTypeId = 0; entity.Granted = "true"; _service.AddResource(entity); _service.Save(); RefreshTree(entity.ParentId); //this.GetCmp<Store>("storeSA_Resource").Reload(); return(this.Direct()); } return(this.Direct()); }
public ActionResult CreateLink(string currentNode) { try { SA_Resource curResource = JSON.Deserialize <SA_Resource>(currentNode); return(new PartialViewResult { ViewName = "Create", Model = new SA_Resource { ParentId = curResource.Id, ItemType = ResourceItemType.Link.ToString(), Show = "true" } }); } catch (Exception) { return(new PartialViewResult { ViewName = "Create", Model = new SA_Resource { ParentId = 0, ItemType = ResourceItemType.Link.ToString(), Show = "true" } }); } }