Пример #1
0
        public static IcbcodeCollection <IcbcodeImage> Find(string terms, string[] block_name, string field = null, long page = 1, long size = Int64.MaxValue, string query = null, dynamic where = null)
        {
            IcbcodeCollection <IcbcodeImage> items = new IcbcodeCollection <IcbcodeImage>(); long totals;

            using (ImageRepository image_repository = new ImageRepository())
            {
                List <dynamic> images = image_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 < images.Count; index++)
                {
                    items.Add(IcbcodeImage.Convert(images[index], index + 1, images.Count));
                }
            }

            return(items);
        }
Пример #2
0
        public IcbcodeCollection <IcbcodeImage> GetImages(string[] fields = null, long page = 1, long size = Int64.MaxValue, string query = null, dynamic where = null)
        {
            IcbcodeCollection <IcbcodeImage> items = new IcbcodeCollection <IcbcodeImage>(); long totals;

            using (ImageRepository image_repository = new ImageRepository())
            {
                List <dynamic> images = image_repository.Get(ID, fields, page, size, out totals, query, where);

                items.TotalPages  = totals;
                items.CurrentPage = page;
                items.PageSize    = size;

                for (int index = 0; index < images.Count; index++)
                {
                    items.Add(IcbcodeImage.Convert(images[index], index + 1, images.Count));
                }
            }

            return(items);
        }