public static IcbcodeCollection <IcbcodeFile> All(string file_group) { IcbcodeCollection <IcbcodeFile> items = new IcbcodeCollection <IcbcodeFile>(); using (FileRepository file_repository = new FileRepository()) { List <dynamic> files = file_repository.Get(file_group); items.TotalPages = 1; items.CurrentPage = 1; items.PageSize = files.Count; for (int index = 0; index < files.Count; index++) { items.Add(IcbcodeFile.Convert(files[index], index + 1, files.Count)); } } return(items); }
public static IcbcodeCollection <IcbcodeFile> Find(string terms, string[] block_name, string field = null, long page = 1, long size = Int64.MaxValue, string query = null, dynamic where = null) { IcbcodeCollection <IcbcodeFile> items = new IcbcodeCollection <IcbcodeFile>(); long totals; using (FileRepository file_repository = new FileRepository()) { List <dynamic> files = file_repository.Search(terms, block_name, string.IsNullOrWhiteSpace(field) ? string.Empty : field, -1, page, size, out totals, query, where); items.TotalPages = totals; items.CurrentPage = page; items.PageSize = size; for (int index = 0; index < files.Count; index++) { items.Add(IcbcodeFile.Convert(files[index], index + 1, files.Count)); } } return(items); }
public IcbcodeCollection <IcbcodeFile> GetFiles(string[] fields = null, long page = 1, long size = Int64.MaxValue, string query = null, dynamic where = null) { IcbcodeCollection <IcbcodeFile> items = new IcbcodeCollection <IcbcodeFile>(); long totals; using (FileRepository file_repository = new FileRepository()) { List <dynamic> files = file_repository.Get(ID, fields, page, size, out totals, query, where); items.TotalPages = totals; items.CurrentPage = page; items.PageSize = size; for (int index = 0; index < files.Count; index++) { items.Add(IcbcodeFile.Convert(files[index], index + 1, files.Count)); } } return(items); }