Beispiel #1
0
        public ActionResult Index(string query, PagedModel<object> pageModel)
        {
            pageModel.PageItems = 18;
            if (!string.IsNullOrEmpty(query))
            {
                var searchQuery = HttpContext.Request.QueryString["query"];
                using (var session = RepositoryFactory.StartUnitOfWork(IoC.Resolve<SearchContext>()))
                {
                    // test search for user name
                    var searchResult = RepositoryFactory.Command<ISearchCommands>().Search(session, searchQuery);
                    pageModel.LoadData(searchResult);
                }
            }
            else
            {
                pageModel = null;
            }

            return ViewWithAjax(new SearchViewModel()
                                    {
                                        Query = query,
                                        SearchResults = pageModel

                                    });
        }
Beispiel #2
0
 /// <summary>
 /// URL: /Project/Index
 /// </summary>
 /// <returns>Action result.</returns>
 public ActionResult Index(PagedModel <Job> pageModel)
 {
     pageModel.LoadData(RepositoryFactory.Action <JobAction>()
                        .GetProjects()
                        .OrderByDescending(item => item.CreateDate));
     return(ViewWithAjax(pageModel));
 }
Beispiel #3
0
 public ActionResult Index(PagedModel<StaticTextViewModel> pageModel)
 {
     pageModel.LoadData(RepositoryFactory.Action<IStaticTextData>()
         .GetAll(DateTime.Now)
         .OrderByDescending(item => item.PublishDate));
     return ViewWithAjax(pageModel);
 }
Beispiel #4
0
 public ActionResult Index(PagedModel<CelebrityView> pageModel)
 {
     pageModel.PageItems = 10;
     pageModel.PrevAsItem = true;
     pageModel.LoadData(RepositoryFactory.Command<ICelebrityCommands>().GetActive().OrderByDescending(item => item.Priority));
     return ViewWithAjax(pageModel);
 }
Beispiel #5
0
        public ActionResult Index(PagedModel <CommentForAdminViewModel> pageModel)
        {
            var data = RepositoryFactory.Action <ICommentData>().GetAllForAdmin()
                       .OrderByDescending(comment => comment.CreatedDate);

            pageModel.LoadData(data);
            return(ViewWithAjax(pageModel));
        }
Beispiel #6
0
        /// <summary>
        /// Loads the comments.
        /// </summary>
        /// <param name="sort">The sort.</param>
        /// <param name="comments">The comments.</param>
        /// <param name="commentsModel">The comments model.</param>
        /// <param name="staticTextId">The static text id.</param>
        private static void LoadComments(CommentViewTypeEnum sort, out IEnumerable <CommentTreeViewModel> comments, PagedModel <CommentViewModel> commentsModel, Guid staticTextId)
        {
            comments = null;
            switch (sort)
            {
            case CommentViewTypeEnum.Flat:
                commentsModel.LoadData(RepositoryFactory.Action <ICommentData>().GetAllByDate(staticTextId));
                break;

            case CommentViewTypeEnum.FlatDesc:
                commentsModel.LoadData(RepositoryFactory.Action <ICommentData>().GetAllByDateDesc(staticTextId));
                break;

            case CommentViewTypeEnum.Tree:
                comments = RepositoryFactory.Action <ICommentData>().GetCommentTree(staticTextId);
                break;
            }
        }
Beispiel #7
0
        public ActionResult Date(string query, PagedModel <object> pageModel)
        {
            if (!string.IsNullOrEmpty(query))
            {
                using (var session = RepositoryFactory.StartUnitOfWork(IoC.Resolve <SearchContext>()))
                {
                    // test search for user name
                    var searchResult = RepositoryFactory.Action <ISearchAction>().SearchByDate(session, query);
                    pageModel.LoadData(searchResult);
                }
            }
            else
            {
                pageModel = null;
            }

            return(ViewWithAjax("Index", new SearchViewModel()
            {
                Query = query,
                SearchResults = pageModel
            }));
        }
Beispiel #8
0
        public ActionResult Date(string query, PagedModel<object> pageModel)
        {
            if (!string.IsNullOrEmpty(query))
            {
                using (var session = RepositoryFactory.StartUnitOfWork(IoC.Resolve<SearchContext>()))
                {
                    // test search for user name
                    var searchResult = RepositoryFactory.Action<ISearchAction>().SearchByDate(session, query);
                    pageModel.LoadData(searchResult);
                }
            }
            else
            {
                pageModel = null;
            }

            return ViewWithAjax("Index", new SearchViewModel()
            {
                Query = query,
                SearchResults = pageModel

            });
        }
Beispiel #9
0
 public ActionResult Deleted(PagedModel<StaticTextViewModel> pageModel)
 {
     pageModel.LoadData(RepositoryFactory.Action<IStaticTextData>().GetDeleted().OrderByDescending(item => item.PublishDate));
     return ViewWithAjax("Index", pageModel);
 }
Beispiel #10
0
 /// <summary>
 /// URL: RssFeed/Index
 /// </summary>
 /// <returns>Action result.</returns>
 public ActionResult Index(PagedModel <RssFeedViewModel> pageModel)
 {
     pageModel.LoadData(RepositoryFactory.Action <IRssFeedAction>().GetAll().OrderByDescending(item => item.Name));
     return(ViewWithAjax(pageModel));
 }
Beispiel #11
0
 /// <summary>
 /// Loads the comments.
 /// </summary>
 /// <param name="sort">The sort.</param>
 /// <param name="comments">The comments.</param>
 /// <param name="commentsModel">The comments model.</param>
 /// <param name="staticTextId">The static text id.</param>
 private static void LoadComments(CommentViewTypeEnum sort, out IEnumerable<CommentTreeViewModel> comments, PagedModel<CommentViewModel> commentsModel, Guid staticTextId)
 {
     comments = null;
     switch (sort)
     {
         case CommentViewTypeEnum.Flat:
             commentsModel.LoadData(RepositoryFactory.Command<ICommentData>().GetAllByDate(staticTextId));
             break;
         case CommentViewTypeEnum.FlatDesc:
             commentsModel.LoadData(RepositoryFactory.Command<ICommentData>().GetAllByDateDesc(staticTextId));
             break;
         case CommentViewTypeEnum.Tree:
             comments = RepositoryFactory.Command<ICommentData>().GetCommentTree(staticTextId);
             break;
     }
 }
Beispiel #12
0
 /// <summary>
 /// URL: Devices/Index
 /// </summary>
 public ActionResult Index(PagedModel<Device> pageModel)
 {
     pageModel.LoadData(RepositoryFactory.Command<IDeviceCommands>().GetAll());
     return ViewWithAjax(pageModel);
 }
Beispiel #13
0
 /// <summary>
 /// URL: Home/Index
 /// </summary>
 /// <returns>Action result.</returns>
 public ActionResult Index(PagedModel<object> pageModel)
 {
     pageModel.PageItems = 16;
     pageModel.LoadData(RepositoryFactory.Command<ITimeline>().GetAll(DateTime.Now));
     return ViewWithAjax(pageModel);
 }
Beispiel #14
0
 /// <summary>
 /// URL: RssFeed/Index
 /// </summary>
 /// <returns>Action result.</returns>
 public ActionResult Index(PagedModel<RssFeedViewModel> pageModel)
 {
     pageModel.LoadData(RepositoryFactory.Command<IRssFeedCommands>().GetAll().OrderByDescending(item => item.Name));
     return ViewWithAjax(pageModel);
 }
Beispiel #15
0
 public ActionResult Index(PagedModel<Person> pageModel)
 {
     pageModel.LoadData(RepositoryFactory.Command<IPersonCommand>().GetAll().OrderByDescending(item => item.FullName));
     return View(pageModel);
 }
Beispiel #16
0
 /// <summary>
 /// URL: /People/Index
 /// </summary>
 /// <returns>Action result.</returns>
 public ActionResult Index(PagedModel<Job> pageModel)
 {
     pageModel.LoadData(RepositoryFactory.Action<JobAction>()
         .GetPeople()
         .OrderByDescending(item => item.CreateDate));
     return ViewWithAjax(pageModel);
 }
Beispiel #17
0
 public ActionResult Index(PagedModel<CommentForAdminViewModel> pageModel)
 {
     var data = RepositoryFactory.Command<ICommentData>().GetAllForAdmin()
         .OrderByDescending(comment => comment.CreatedDate);
     pageModel.LoadData(data);
     return ViewWithAjax(pageModel);
 }
Beispiel #18
0
 public ActionResult Deleted(PagedModel <StaticTextViewModel> pageModel)
 {
     pageModel.LoadData(RepositoryFactory.Action <IStaticTextData>().GetDeleted().OrderByDescending(item => item.PublishDate));
     return(ViewWithAjax("Index", pageModel));
 }