Beispiel #1
0
        public ActionResult Edit(string currentNode)
        {
            SA_Resource curResource = JSON.Deserialize <SA_Resource>(currentNode);

            return(new PartialViewResult
            {
                ViewName = "Edit",
                Model = curResource
            });
        }
Beispiel #2
0
        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());
        }
Beispiel #3
0
        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());
        }
Beispiel #4
0
 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"
             }
         });
     }
 }