首页 > 其他 > 详细

PagePrams

时间:2018-07-29 20:53:16      阅读:179      评论:0      收藏:0      [点我收藏+]

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!