Ejemplo n.º 1
0
        public ActionResult UserInfoIndex(Page <UserInfoModel> model)
        {
            if (model.CurrentPage <= 0)
            {
                model.CurrentPage = 1;
            }

            StringBuilder where = new StringBuilder("select * from Userinfo where 1=1");
            if (model.Item != null)
            {
                if (!string.IsNullOrEmpty(model.Item.UserName))
                {
                    where.AppendFormat(" and UserName like '%{0}%' ", model.Item.UserName.Trim());
                }
            }
            var page = UserInfoModel.Page(model.CurrentPage, MTConfig.ItemsPerPage, where.ToString(), model.Item);

            page.Item = model.Item;
            return(View(page));
        }