码迷,mamicode.com
首页 > 其他好文 > 详细

PagePrams

时间:2018-07-29 21:15:35      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:public   stun   +=   res   pos   page   ati   http   HERE   

public ActionResult Index()
{
return View(GetStudetPage());
}
[HttpPost]
public ActionResult Index(string StuName, DateTime? StuKTime, DateTime? StuJTime)
{
string where = "1=1";
if (StuName != null)
{
where += "and StuName like ‘%" + StuName + "%‘";

}
if (StuKTime != null)
{

where += " and StuKTime > ‘" + StuKTime + "‘";
}
if (StuJTime != null)
{
where += " and StuJTime <‘" + StuJTime + "‘";
}
Where = where;
return PartialView("_PartialPage1", GetStudetPage());
}
static int PageSize = 3;
static int PageIndex = 1;
static string Where = "";
public List<stuclass> GetStudetPage()
{
PageParams pargePar = new PageParams
{

TableName = "Student",
IndexCol = "StuID",
PageSize = PageSize,
PageIndex = PageIndex - 1,
OrderCol = "StuID asc",
Where = Where,
Columns = "*"
};
Pages<stuclass> pages = bl.GetStudetPage(pargePar);
ViewBag.SumCount = pages.SumCount;
ViewBag.SumPage = pages.SumCount;
ViewBag.PageIndex = PageIndex;
return pages.list;
}

PagePrams

标签:public   stun   +=   res   pos   page   ati   http   HERE   

原文地址:https://www.cnblogs.com/yanyuhao/p/9387553.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!