/// <summary> /// 首页 /// </summary> /// <returns></returns> public ActionResult Index(string name, int?page) { var model = new FolderListModel { Name = name, PageIndex = page.HasValue ? page.Value : 0 }; model.Folders = GetFolders(model); return(View("~/Views/Editor/Folder/index.cshtml", model)); }
public async Task login(string userName, string userPassword) { try { ossClient = new OssClient(userName, userPassword); buckets = new BucketListModel(ossClient); await buckets.refreshBuckets(); folders = new FolderListModel(ossClient); } catch (Exception ex) { throw ex; } }
/// <summary> /// 得到标签 /// </summary> /// <returns></returns> protected virtual IList <FolderEntity> GetFolders(FolderListModel model) { var query = new QueryInfo(); query.SetPageIndex(model.PageIndex).SetPageSize(model.PageSize).Query <FolderEntity>() .Where(it => it.Account.Id == Identity.Id) .Select(it => new object[] { it.Id, it.Name, it.Type, it.Sequence }); if (!string.IsNullOrWhiteSpace(model.Name)) { query.AppendWhere("Name.Contains(@Name)").SetParameter("Name", model.Name); } var infos = this.GetEntities <FolderEntity>(query); model.DataCount = query.DataCount; return(infos); }
public ActionResult Index(long?parent, FetchOptions fetchOptions) { Folder parentFolder = null; if (parent.HasValue) { parentFolder = folderRepository.Load(parent.Value); } var model = new FolderListModel { Items = folderRepository.Find(new FolderFilter { ParentFolderId = parentFolder != null ? parentFolder.Id : (long?)null }, fetchOptions), CurrentFolder = parentFolder, FolderParent = parentFolder != null ? parentFolder.ParentFolder : null }; model.IsRootFolder = parent == null && model.FolderParent == null; return(View("List", model)); }