示例#1
0
        public async Task <jqGridResult> Get(
            bool _search,
            long nd,
            int page,
            int rows,
            string sidx,
            string sord,
            int id,
            string filters)
        {
            try
            {
                string name      = null;
                string extension = null;
                string mimeType  = null;

                if (!String.IsNullOrEmpty(filters))
                {
                    jqGridFilter filter = JsonConvert.DeserializeObject <jqGridFilter>(filters);
                    name      = filter.GetFilterByFieldName(FilesPagedDataTable.Name);
                    extension = filter.GetFilterByFieldName(FilesPagedDataTable.Extension);
                    mimeType  = filter.GetFilterByFieldName(FilesPagedDataTable.MimeType);
                }

                var pagedDataTable = await this.filesRetriever.GetFilesPagedAsync(
                    name,
                    extension,
                    mimeType,
                    sidx,
                    sord,
                    page,
                    rows);

                var result = new jqGridResult(
                    pagedDataTable.TotalPagesCount,
                    pagedDataTable.PageNumber,
                    pagedDataTable.Rows.Count,
                    pagedDataTable,
                    PagedDataTable.Id);

                return(result);
            }
            catch (Exception ex)
            {
                if (base.log.IsErrorEnabled)
                {
                    base.log.Error(ex);
                }

                return(null);
            }
        }
        public async Task <jqGridResult> Get(
            bool _search,
            long nd,
            int page,
            int rows,
            string sidx,
            string sord,
            int id,
            string filters)
        {
            try
            {
                string title      = null;
                string roles      = null;
                string categories = null;

                if (!String.IsNullOrEmpty(filters))
                {
                    jqGridFilter filter = JsonConvert.DeserializeObject <jqGridFilter>(filters);
                    title      = filter.GetFilterByFieldName(ArticlesPagedDataTable.Title);
                    roles      = filter.GetFilterByFieldName(ArticlesPagedDataTable.Roles);
                    categories = filter.GetFilterByFieldName(ArticlesPagedDataTable.Categories);
                }

                var pagedDataTable = await this.articlesRetriever.GetArticlesPagedAsync(
                    title,
                    roles,
                    categories,
                    sidx,
                    sord,
                    page,
                    rows);

                var result = new jqGridResult(
                    pagedDataTable.TotalPagesCount,
                    pagedDataTable.PageNumber,
                    pagedDataTable.Rows.Count,
                    pagedDataTable,
                    PagedDataTable.Id);

                return(result);
            }
            catch (Exception ex)
            {
                if (base.log.IsErrorEnabled)
                {
                    base.log.Error(ex);
                }

                return(null);
            }
        }
示例#3
0
        public async Task <jqGridResult> Get(
            bool _search,
            long nd,
            int page,
            int rows,
            string sidx,
            string sord,
            int id,
            string filters)
        {
            try
            {
                string imageId          = null;
                string previewFileName  = null;
                string originalFileName = null;

                if (!String.IsNullOrEmpty(filters))
                {
                    jqGridFilter filter = JsonConvert.DeserializeObject <jqGridFilter>(filters);
                    imageId          = filter.GetFilterByFieldName(ImagesPagedDataTable.Id);
                    previewFileName  = filter.GetFilterByFieldName(ImagesPagedDataTable.PreviewFileName);
                    originalFileName = filter.GetFilterByFieldName(ImagesPagedDataTable.OriginalFileName);
                }

                var pagedDataTable = await this.imagesRetriever.GetImagesPagedAsync(
                    imageId,
                    previewFileName,
                    originalFileName,
                    sidx,
                    sord,
                    page,
                    rows);

                var result = new jqGridResult(
                    pagedDataTable.TotalPagesCount,
                    pagedDataTable.PageNumber,
                    pagedDataTable.Rows.Count,
                    pagedDataTable,
                    PagedDataTable.Id);

                return(result);
            }
            catch (Exception ex)
            {
                if (base.log.IsErrorEnabled)
                {
                    base.log.Error(ex);
                }

                return(null);
            }
        }
示例#4
0
        public async Task <jqGridResult> Get(
            bool _search,
            long nd,
            int page,
            int rows,
            string sidx,
            string sord,
            int id,
            string filters)
        {
            try
            {
                string email = null;

                if (!String.IsNullOrEmpty(filters))
                {
                    jqGridFilter filter = JsonConvert.DeserializeObject <jqGridFilter>(filters);
                    email = filter.GetFilterByFieldName(UsersPagedDataTable.Email);
                }

                UsersPagedDataTable pagedDataTable = await this.usersRetriever.GetUsersPagedAsync(
                    email,
                    sidx,
                    sord,
                    page,
                    rows);

                var result = new jqGridResult(
                    pagedDataTable.TotalPagesCount,
                    pagedDataTable.PageNumber,
                    pagedDataTable.Rows.Count,
                    pagedDataTable,
                    PagedDataTable.Id);

                return(result);
            }
            catch (Exception ex)
            {
                if (base.log.IsErrorEnabled)
                {
                    base.log.Error(ex);
                }

                return(null);
            }
        }
示例#5
0
        public async Task <jqGridResult> Get(
            bool _search,
            long nd,
            int page,
            int rows,
            string sidx,
            string sord,
            int id,
            string filters)
        {
            try
            {
                string smallFileName    = null;
                string previewFileName  = null;
                string originalFileName = null;
                string articleTitle     = null;
                string title            = null;
                string description      = null;


                if (!String.IsNullOrEmpty(filters))
                {
                    jqGridFilter filter = JsonConvert.DeserializeObject <jqGridFilter>(filters);
                    smallFileName    = filter.GetFilterByFieldName(GalleryPagedDataTable.SmallFileName);
                    previewFileName  = filter.GetFilterByFieldName(GalleryPagedDataTable.PreviewFileName);
                    originalFileName = filter.GetFilterByFieldName(GalleryPagedDataTable.OriginalFileName);
                    articleTitle     = filter.GetFilterByFieldName(GalleryPagedDataTable.ArticleTitle);
                    title            = filter.GetFilterByFieldName(GalleryPagedDataTable.Title);
                    description      = filter.GetFilterByFieldName(GalleryPagedDataTable.Description);
                }

                var pagedDataTable = await this.galleryRetriever.GetGalleryPagedAsync(
                    smallFileName,
                    previewFileName,
                    originalFileName,
                    articleTitle,
                    title,
                    description,
                    sidx,
                    sord,
                    page,
                    rows);

                var result = new jqGridResult(
                    pagedDataTable.TotalPagesCount,
                    pagedDataTable.PageNumber,
                    pagedDataTable.Rows.Count,
                    pagedDataTable,
                    PagedDataTable.Id);

                return(result);
            }
            catch (Exception ex)
            {
                if (base.log.IsErrorEnabled)
                {
                    base.log.Error(ex);
                }

                return(null);
            }
        }