コード例 #1
0
        public static IcbcodeCollection <IcbcodeField> Get(long content_id)
        {
            IcbcodeCollection <IcbcodeField> items = new IcbcodeCollection <IcbcodeField>();

            using (FieldRepository field_repository = new FieldRepository())
            {
                List <dynamic> fields = field_repository.GetFilterFields(content_id);

                items.TotalPages  = items.Count;
                items.CurrentPage = 1;
                items.PageSize    = 1;

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

            return(items);
        }
コード例 #2
0
ファイル: IcbcodeTag.cs プロジェクト: dannybeast/garnet
        public static IcbcodeCollection <IcbcodeTag> Get(string field_name, long?domain = null)
        {
            IcbcodeCollection <IcbcodeTag> items = new IcbcodeCollection <IcbcodeTag>();

            using (TagRepository tag_repository = new TagRepository())
            {
                List <dynamic> tags = tag_repository.Get(field_name, domain);

                items.TotalPages  = items.Count;
                items.CurrentPage = 1;
                items.PageSize    = 1;

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

            return(items);
        }
コード例 #3
0
ファイル: IcbcodeImage.cs プロジェクト: dannybeast/garnet
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: IcbcodeContent.cs プロジェクト: dannybeast/garnet
        private static IcbcodeCollection <IcbcodeContent> Get(long[] content_root, string[] block_name, string[] template_name, string order_fields, long page, long size, string query, dynamic where, string domain)
        {
            IcbcodeCollection <IcbcodeContent> items = new IcbcodeCollection <IcbcodeContent>(); long totals;

            using (ContentRepository content_repository = new ContentRepository())
            {
                List <dynamic> contents = content_repository.GetActive(block_name, content_root, template_name, order_fields, page, size, out totals, query, where, domain);

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

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

            return(items);
        }
コード例 #6
0
ファイル: IcbcodeContent.cs プロジェクト: dannybeast/garnet
        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);
        }
コード例 #7
0
ファイル: IcbcodeContent.cs プロジェクト: dannybeast/garnet
        public IcbcodeCollection <IcbcodeContent> Childs(string[] template_name = null, string order_fields = null, long page = 1, long size = Int64.MaxValue, string query = null, dynamic where = null, string domain = null)
        {
            IcbcodeCollection <IcbcodeContent> items = new IcbcodeCollection <IcbcodeContent>(); long totals;

            using (ContentRepository content_repository = new ContentRepository())
            {
                List <dynamic> contents = content_repository.GetActive(null, new long[] { ID }, template_name, order_fields, page, size, out totals, query, where, domain);

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

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

            return(items);
        }
コード例 #8
0
ファイル: IcbcodeContent.cs プロジェクト: dannybeast/garnet
        public IcbcodeFile GetFile(string[] fields = null, string query = null, dynamic where = null)
        {
            IcbcodeCollection <IcbcodeFile> items = GetFiles(fields, 1, 1, query, where);

            return(items.Count == 0 ? null : items.First <IcbcodeFile>());
        }