Ejemplo n.º 1
0
        public ActionResult ManageByRefId(int id, int refgroup)
        {
            var pagedResult = _helper.Find(1, 200, Query <MediaFile> .New().Where(m => m.RefId).Is(id).And(m => m.RefGroupId).Is(refgroup).OrderByDescending(m => m.CreateDate)).ItemAs <PagedList <MediaFile> >();
            var model       = new MediaFilesViewModel();

            model.EntityId    = id;
            model.EntityGroup = refgroup;
            model.Mode        = MediaGalleryViewMode.Entity;
            model.Items       = pagedResult;
            model.UrlEdit     = string.Format("/{0}/edit/{1}", ModuleMap.Instance.GetShortName(refgroup), id);
            model.UrlBack     = string.Format("/{0}/details/{1}", ModuleMap.Instance.GetShortName(refgroup), id);
            model.UrlCreate   = string.Format("/mediafile/createforentity/{0}/?refgroup={1}", id, refgroup);
            model.ControlPath = "ModelList";
            return(View(_viewSettings.PageLocationForManage, model));
        }
Ejemplo n.º 2
0
        public ActionResult ManageByFolder(int id)
        {
            var pagedResult = _helper.Find(1, 200, Query <MediaFile> .New().Where(m => m.ParentId).Is(id).OrderByDescending(m => m.CreateDate)).ItemAs <PagedList <MediaFile> >();
            var model       = new MediaFilesViewModel()
            {
                Mode        = MediaGalleryViewMode.FolderId,
                FolderId    = id,
                Items       = pagedResult,
                UrlCreate   = "/mediafile/createinfolder/" + id,
                UrlBack     = Url.Link("manage", typeof(MediaFolder).Name, null),
                ControlPath = "ModelList"
            };

            return(View(_viewSettings.PageLocationForManage, model));
        }