Example #1
0
 public ActionResult InstallActivity(GalleryActivity activity, Folder category)
 {
     var jsResult = new JsInstallResult();
     Item item = GalleryProcessor.InstallActivity(this.StorageContext, Storage.NewSuggestionsContext, this.CurrentUser, category, null, activity);
     if (item != null)
     {
         jsResult.FolderID = item.FolderID;
         jsResult.ItemID = item.ID;
     }
     else
     {
         jsResult.StatusCode = HttpStatusCode.NotFound;
     }
     JsonResult result = new JsonResult();
     result.Data = jsResult;
     return result;
 }
Example #2
0
 public ActionResult InstallCategory(GalleryCategory category)
 {
     var jsResult = new JsInstallResult();
     object o = GalleryProcessor.InstallCategory(this.StorageContext, Storage.NewSuggestionsContext, this.CurrentUser, null, null, category);
     if (o != null)
     {
         Folder folder = o as Folder;
         Item item = o as Item;
         if (folder != null) { jsResult.FolderID = folder.ID; }
         if (item != null) { jsResult.FolderID = item.FolderID; jsResult.ItemID = item.ID; }
     }
     else
     {
         jsResult.StatusCode = HttpStatusCode.NotFound;
     }
     JsonResult result = new JsonResult();
     result.Data = jsResult;
     return result;
 }