Ejemplo n.º 1
0
        /// <summary>
        /// Creates a paginated entity model used by the ArticlesController.Index method
        /// </summary>
        /// <param name="sort">Sort options</param>
        /// <param name="pageNumber">The page number to return</param>
        /// <param name="start">The start date for querying the articles</param>
        /// <param name="end">The end date for querying the articles</param>
        /// <param name="checkIfApproved">Flag to check if articles approved for viewing</param>
        /// <returns></returns>
        public static PaginationModel <ArticleModel> GetArticleModelForArticles(GridSortOptions sort, int pageNumber = 1, DateTime?start = null, DateTime?end = null, bool checkIfApproved = true)
        {
            var column    = (sort.Column == null) ? Constants.Sort_Column_Title : sort.Column;
            var direction = sort.Direction;

            var model = CommonModelHelper.GetPaginatedModel <ArticleModel>(column, direction);

            model.GetPaginatedArticles(pageNumber, start, end, checkIfApproved);

            Guid userIdKey = ManageUserModelHelper.GetFormsAuthenticationTicket().IdKey();

            model.PageTitle = "Holy Angels System Articles";
            model.UserIdKey = userIdKey;

            model.MetaDescription = "";
            model.MetaKeywords    = "";
            model.MetaSubject     = "";

            return(model);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a paginated entity model used by the MinistriesController.Index method
        /// </summary>
        /// <param name="sort">Sort options</param>
        /// <param name="pageNumber">The page number to return</param>
        /// <returns></returns>
        public static PaginationModel <MinistryModel> GetMinistryModelForMinistries(GridSortOptions sort, int pageNumber = 1)
        {
            var column    = (sort.Column == null) ? Constants.Sort_Column_Name : sort.Column;
            var direction = sort.Direction;

            var model = CommonModelHelper.GetPaginatedModel <MinistryModel>(column, direction);

            model.GetPaginatedMinistries(pageNumber);

            Guid userIdKey = ManageUserModelHelper.GetFormsAuthenticationTicket().IdKey();

            model.PageTitle = "Holy Angels System Ministries";
            model.UserIdKey = userIdKey;

            model.MetaDescription = "";
            model.MetaKeywords    = "";
            model.MetaSubject     = "";

            return(model);
        }