Пример #1
0
        /// <summary>
        /// Creates a entity model used by the ArticlesController.Add method
        /// </summary>
        /// <returns></returns>
        public static ArticleModel GetArticleModelForAdd()
        {
            var  model     = new ArticleModel();
            Guid userIdKey = ManageUserModelHelper.GetFormsAuthenticationTicket().IdKey();

            model.PageTitle = "Holy Angels System Article";
            model.SubTitle  = "Add New Article";
            model.UserIdKey = userIdKey;

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

            return(model);
        }
Пример #2
0
        /// <summary>
        /// Updates the model for the Manage.UserController.Add post action
        /// </summary>
        /// <returns></returns>
        public static void UpdateUserModelForAdd(this UserModel model)
        {
            Guid userIdKey = ManageUserModelHelper.GetFormsAuthenticationTicket().IdKey();

            model.PageTitle = "Holy Angels Add New System User";
            model.SubTitle  = "New System User";
            model.UserIdKey = userIdKey;

            model.MultiSelectRoleList     = ManageRoleModelHelper.GetMultiSelectedRoles();
            model.MultiSelectMinistryList = ManageMinistryModelHelper.GetMultiSelectedMinistries();

            model.MetaDescription = "";
            model.MetaKeywords    = "";
            model.MetaSubject     = "";
        }
Пример #3
0
        /// <summary>
        /// Creates model for the Manage.UserController.Edit action
        /// </summary>
        /// <param name="idKey"></param>
        /// <returns></returns>
        public static UserModel GetUserModelForEdit(string idKey)
        {
            Guid id    = (Guid.TryParse(idKey, out id)) ? id : Guid.Empty;
            var  model = ManageUserModelHelper.Get(id);

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

            model.PageTitle = "Holy Angels Profile Page";
            model.SubTitle  = (userIdKey == id) ? "My Profile" : "Edit User Profile";
            model.IdKey     = id;
            model.UserIdKey = userIdKey;

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

            return(model);
        }
Пример #4
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);
        }
Пример #5
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);
        }
Пример #6
0
        /// <summary>
        /// Creates a entity model used by the ArticlesController.Edit method
        /// </summary>
        /// <returns></returns>
        public static ArticleModel GetArticleModelForEdit(string id)
        {
            Guid idKey = (Guid.TryParse(id, out idKey)) ? idKey : Guid.Empty;

            var entity = GetArticle(idKey);

            if (entity == null)
            {
                return(null);
            }

            var  model     = entity.GetArticleModel();
            Guid userIdKey = ManageUserModelHelper.GetFormsAuthenticationTicket().IdKey();

            model.PageTitle = "Holy Angels System Article";
            model.SubTitle  = "Edit Article";
            model.UserIdKey = userIdKey;

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

            return(model);
        }
Пример #7
0
        /// <summary>
        /// Creates a quote model used by the QuotesController.Edit method
        /// </summary>
        /// <returns></returns>
        public static QuoteModel GetQuoteModelForEdit(string idKey)
        {
            Guid id = (Guid.TryParse(idKey, out id)) ? id : Guid.Empty;

            var quote = GetQuote(id);

            if (quote == null)
            {
                return(null);
            }

            var  model     = quote.GetQuoteModel();
            Guid userIdKey = ManageUserModelHelper.GetFormsAuthenticationTicket().IdKey();

            model.PageTitle = "Holy Angels System Quote";
            model.SubTitle  = "Edit Quote";
            model.UserIdKey = userIdKey;

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

            return(model);
        }