Exemplo n.º 1
0
        public ActionResult Search(string k, int?p)
        {
            if (string.IsNullOrEmpty(k))
            {
                k = "";
            }
            ;
            int count = 0;

            if (p.HasValue == false)
            {
                p = 1;
            }
            PageTurnModel pageturn = new PageTurnModel()
            {
                ItemSize = 10
            };

            pageturn.PageIndex    = p;
            ViewData["BlogList"]  = articleServer.ToSearchList(pageturn.PageIndex.Value, pageturn.ItemSize, k, 1, out count);
            ViewData["BlogCount"] = count;
            ViewData["BlogPage"]  = pageturn.PageCount;
            ViewData["BlogKey"]   = k;
            return(View());
        }
Exemplo n.º 2
0
        public ActionResult List(int?page)
        {
            int           count    = 0;
            PageTurnModel pageturn = new PageTurnModel()
            {
                ItemSize = 10
            };

            if (page.HasValue)
            {
                pageturn.PageIndex = page.Value;
            }
            else
            {
                pageturn.PageIndex = 1;
            }
            var list = this.articleServer.ToPagedList(pageturn.PageIndex.Value, pageturn.ItemSize, " where IsShow=1 and IsTop=0", "LastTime DESC", out count);

            pageturn.CountSize      = count;
            ViewData["ArticleList"] = list;
            ViewData["PageTurn"]    = pageturn;

            var topList = this.articleServer.ToPagedList(1, 3, " where IsShow=1 and IsTop=1", "LastTime DESC", out count);

            ViewData["TopArticleList"] = topList;
            //
            return(View());
        }
Exemplo n.º 3
0
        public ActionResult List(int?p, int?c)
        {
            int count = 0;

            if (p.HasValue == false)
            {
                p = 1;
            }
            PageTurnModel pageturn = new PageTurnModel()
            {
                ItemSize = 10
            };

            pageturn.PageIndex = p;
            if (c.HasValue)
            {
                ViewData["BlogList"] = articleServer.ToPagedList(pageturn.PageIndex.Value, pageturn.ItemSize, "where ColumnId=" + c, " CreateTime DESC", out count);
            }
            else
            {
                ViewData["BlogList"] = articleServer.ToSearchList(pageturn.PageIndex.Value, pageturn.ItemSize, "", 1, out count);
            }
            pageturn.CountSize        = count;
            ViewData["BlogPageCount"] = pageturn.PageCount;
            ViewData["BlogPage"]      = p.Value;
            return(View());
        }
Exemplo n.º 4
0
        public ActionResult RoleList(int?page)
        {
            PageTurnModel pageturn = new PageTurnModel()
            {
                ItemSize = 100
            };

            if (!page.HasValue)
            {
                page = 1;
                pageturn.PageIndex = page;
                int count = 0;
                var list  = this.roleServer
                            .ToPagedList(pageturn.PageIndex.Value, pageturn.ItemSize, "Role_Id", out count);
                pageturn.CountSize = count;

                ViewData["RoleList"] = list;
                return(View());
            }
            else
            {
                pageturn.PageIndex = page;
                int count = 0;
                var list  = this.roleServer
                            .ToPagedList(pageturn.PageIndex.Value, pageturn.ItemSize, "Role_Id", out count);
                pageturn.CountSize = count;

                return(Json(new RowResultModel {
                    rows = list.Select(t => new { t.Role_Id, t.RoleName }), pagination = pageturn, pass = true
                }));
            }
        }
Exemplo n.º 5
0
        public ActionResult UserList(int?page)
        {
            if (!page.HasValue)
            {
                page = 1;
            }
            PageTurnModel pageturn = new PageTurnModel()
            {
                ItemSize = 10
            };

            pageturn.PageIndex = page;
            int count = 0;
            var list  = this.userServer.ToPagedList(pageturn.PageIndex.Value, pageturn.ItemSize, "User_Id", out count).Select(t => new
            {
                t.User_Id,
                t.Name,
                t.NickName,
                t.Role.RoleName,
                AddTime       = t.AddTime.ToString("yyyy-MM-dd HH:mm:ss"),
                LastLoginTime = t.LastLoginTime.ToString("yyyy-MM-dd HH:mm:ss")
            });

            pageturn.CountSize = count;
            return(Json(new RowResultModel {
                rows = list, pagination = pageturn, pass = true
            }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 6
0
        public ActionResult LogList(int?page)
        {
            if (!page.HasValue)
            {
                page = 1;
            }
            PageTurnModel pageturn = new PageTurnModel()
            {
                ItemSize = 10
            };

            pageturn.PageIndex = page;
            int count = 0;
            var list  = this.logService.ToPagedList(pageturn.PageIndex.Value, pageturn.ItemSize, "Log_Id", out count).Select(t => new
            {
                Log_Id   = t.Log_Id,
                LogInfo  = t.LogInfo,
                UserId   = t.UserId,
                UserName = t.User.Name,
                AddTime  = StringHelper.GetTime(t.CreateTs).ToString("yyyy-MM-dd HH:mm:ss")
            });

            pageturn.CountSize = count;
            return(Json(new RowResultModel {
                rows = list, pagination = pageturn, pass = true
            }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 7
0
        public ActionResult BuyLog(int?page)
        {
            if (page.HasValue == false)
            {
                page = 1;
            }
            int           count    = 0;
            PageTurnModel pageturn = new PageTurnModel()
            {
                ItemSize = 10
            };

            pageturn.PageIndex = 1;
            var list = this.orderService.ToPagedList(
                page.Value,
                pageturn.ItemSize,
                "MemberId=" + base.LoginMember.Member_Id + " and State>2",
                "AddTime DESC",
                out count);

            pageturn.CountSize    = count;
            ViewData["OrderList"] = list;
            ViewData["Pageturn"]  = pageturn;
            return(View());
        }
Exemplo n.º 8
0
        public ActionResult UserIndex()
        {
            int           count    = 0;
            PageTurnModel pageturn = new PageTurnModel()
            {
                ItemSize = 10
            };

            pageturn.PageIndex = 1;
            var list = this.userServer.ToPagedList(pageturn.PageIndex.Value, pageturn.ItemSize, "User_Id", out count);

            pageturn.CountSize   = count;
            ViewData["UserList"] = list;
            ViewData["Pageturn"] = pageturn;
            return(View("UserList"));
        }
Exemplo n.º 9
0
        public ActionResult Index()
        {
            //推荐
            //普通列表
            int           count    = 0;
            PageTurnModel pageturn = new PageTurnModel()
            {
                ItemSize = 8
            };

            pageturn.PageIndex = 1;
            var list = this.itemService.ToPagedList(pageturn.PageIndex.Value, pageturn.ItemSize, " where State=1", "AddTime DESC", out count);

            pageturn.CountSize   = count;
            ViewData["ItemList"] = list;
            var flaglist = this.itemService.ToPagedList(pageturn.PageIndex.Value, 3, " where Flag=1 and State=1", "AddTime DESC", out count);

            ViewData["ItemFlagList"] = flaglist;
            return(View());
        }
Exemplo n.º 10
0
        public ActionResult StoreList(int page)
        {
            PageTurnModel pageturn = new PageTurnModel()
            {
                ItemSize = 10
            };

            pageturn.PageIndex = page;
            int count = 0;
            var list  = this.storeInfoService.ToPagedList(pageturn.PageIndex.Value, pageturn.ItemSize, "Store_Id", out count).Select(t => new
            {
                t.Store_Id,
                t.StoreName,
                t.StoreSwitch,
                LastTime   = t.LastTime.ToString("yyyy-MM-dd HH:mm:ss"),
                CreateTime = t.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
            });

            pageturn.CountSize = count;
            return(Json(new RowResultModel {
                rows = list, pagination = pageturn, pass = true
            }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 11
0
        public ActionResult ItemList(int?page)
        {
            int           count    = 0;
            PageTurnModel pageturn = new PageTurnModel()
            {
                ItemSize = 10
            };

            if (page.HasValue)
            {
                pageturn.PageIndex = page.Value;
            }
            else
            {
                pageturn.PageIndex = 1;
            }
            var list = this.itemService.ToPagedList(pageturn.PageIndex.Value, pageturn.ItemSize, "where State!=4", "AddTime DESC", out count);

            pageturn.CountSize   = count;
            ViewData["ItemList"] = list;
            ViewData["PageTurn"] = pageturn;
            return(View());
        }