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 }); }
/// <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)); }
public ActionResult Index(PagedModel<StaticTextViewModel> pageModel) { pageModel.LoadData(RepositoryFactory.Action<IStaticTextData>() .GetAll(DateTime.Now) .OrderByDescending(item => item.PublishDate)); return ViewWithAjax(pageModel); }
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); }
public ActionResult Index(PagedModel <CommentForAdminViewModel> pageModel) { var data = RepositoryFactory.Action <ICommentData>().GetAllForAdmin() .OrderByDescending(comment => comment.CreatedDate); pageModel.LoadData(data); return(ViewWithAjax(pageModel)); }
/// <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; } }
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 })); }
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 }); }
public ActionResult Deleted(PagedModel<StaticTextViewModel> pageModel) { pageModel.LoadData(RepositoryFactory.Action<IStaticTextData>().GetDeleted().OrderByDescending(item => item.PublishDate)); return ViewWithAjax("Index", pageModel); }
/// <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)); }
/// <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; } }
/// <summary> /// URL: Devices/Index /// </summary> public ActionResult Index(PagedModel<Device> pageModel) { pageModel.LoadData(RepositoryFactory.Command<IDeviceCommands>().GetAll()); return ViewWithAjax(pageModel); }
/// <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); }
/// <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); }
public ActionResult Index(PagedModel<Person> pageModel) { pageModel.LoadData(RepositoryFactory.Command<IPersonCommand>().GetAll().OrderByDescending(item => item.FullName)); return View(pageModel); }
/// <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); }
public ActionResult Index(PagedModel<CommentForAdminViewModel> pageModel) { var data = RepositoryFactory.Command<ICommentData>().GetAllForAdmin() .OrderByDescending(comment => comment.CreatedDate); pageModel.LoadData(data); return ViewWithAjax(pageModel); }
public ActionResult Deleted(PagedModel <StaticTextViewModel> pageModel) { pageModel.LoadData(RepositoryFactory.Action <IStaticTextData>().GetDeleted().OrderByDescending(item => item.PublishDate)); return(ViewWithAjax("Index", pageModel)); }