//public ActionResult AllocButton(string currentNode) //{ // SA_Resource curResource = JSON.Deserialize<SA_Resource>(currentNode); // return new PartialViewResult // { // ViewName = "AllocateButton", // Model = curResource // }; //} //public ActionResult SaveButtonAllocation(string resourceTypes) //{ // SA_ResourceLinkBLL resourceLinkBLL=new SA_ResourceLinkBLL(); // ChangeRecords<SA_ResourceLink> records = // new StoreDataHandler(resourceTypes).BatchObjectData<SA_ResourceLink>(); // int parentId = 0; // foreach (var resourceLink in records.Updated) // { // resourceLinkBLL.Update(resourceLink); // var source=_bll.GetResource(resourceLink.ResourceId ?? 0, resourceLink.ResourceTypeId); // if (source != null) // { // source.Granted = resourceLink.Granted; // } // parentId = resourceLink.ResourceId??0; // } // resourceLinkBLL.Save(); // _bll.Save(); // RefreshTree(parentId); // return this.Direct(); //} //public ActionResult GetResourceLink(string id) //{ // SA_ResourceTypeBLL resourceTypeBLL=new SA_ResourceTypeBLL(); // SA_ResourceLinkBLL resourceLinkBLL=new SA_ResourceLinkBLL(); // int resourceId = GetResourceId(id); // var resourceTypes = resourceTypeBLL.GetAll().ToList(); // resourceLinkBLL.AddResourceType(resourceId, resourceTypes); // _bll.AddResourceType(resourceId, resourceTypes); // return this.Store(resourceLinkBLL.GetByResourceId(GetResourceId(id))); //} //private static int GetResourceId(string id) //{ // int resourceId; // if (int.TryParse(id, out resourceId)) // { // return resourceId; // } // return 0; //} public ActionResult GetResourceButton(string id) { return(this.Store(_service.GetButtons(ConvertToInt(id)))); }