Example #1
0
        public static IcbcodeContent Get(string content_url, string domain)
        {
            IcbcodeContent item = null;

            using (ContentRepository content_repository = new ContentRepository())
            {
                item = IcbcodeContent.Convert(content_repository.GetActiveByUrl(content_url.TrimEnd('/'), domain ?? _Domain), 1, 1);
            }

            return(item);
        }
Example #2
0
        public static IcbcodeContent Get(long content_id)
        {
            IcbcodeContent item = null;

            using (ContentRepository content_repository = new ContentRepository())
            {
                item = IcbcodeContent.Convert(content_repository.GetActiveByID(content_id), 1, 1);
            }

            return(item);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }