Ejemplo n.º 1
0
        //
        // GET: /Platform/SysKeyword/

        /// <summary>
        ///
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="ordering"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public ActionResult Index(string keyword, string ordering, int pageIndex = 1)
        {
            var model = _sysKeywordService.GetAll().Select(m => new { m.Keyword, m.Type, m.Count, m.CreatedDate, m.UserCreatedBy, m.Id }).Search(keyword);

            if (!string.IsNullOrEmpty(ordering))
            {
                model = model.OrderBy(ordering, null);
            }

            return(View(model.ToPagedList(pageIndex)));
        }
Ejemplo n.º 2
0
        //
        // GET: /Platform/SysKeyword/

        /// <summary>
        ///
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="ordering"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public ActionResult Index(string keyword, string ordering, int pageIndex = 1, bool export = false, bool search = false)
        {
            var model = _sysKeywordService.GetAll().Select(m => new { m.Keyword, m.Type, m.Count, m.CreatedDate, m.UserCreatedBy, m.Id }).Search(keyword);

            if (search)
            {
                model = model.Search(Request.QueryString);
            }
            if (!string.IsNullOrEmpty(ordering))
            {
                model = model.OrderBy(ordering, null);
            }
            if (export)
            {
                return(model.ToExcelFile());
            }
            return(View(model.PageResult(pageIndex)));
        }