public ActionResult GetPrograms(int pageSize = 10, int pageIndex = 1)
{
string pgm_name = Request.Form["pgm_name"].ToString();
var pageCount = (_db.Prgorams.Count() - 1) / pageSize + 1;
ViewBag.PageCount = pageCount;
ViewBag.PageIndex = pageIndex;
ViewBag.PageSize = pageSize;
var prg = _db.Prgorams
.Where(c => c.pgm_nameContains(pgm_name) = pgm_name )
.OrderByDescending(a => a.pgm_code)
.Skip((pageIndex - 1) * pageSize)
.Take(pageSize)
.ToList();
ViewBag.pgm_name = pgm_name;
return View(prg);
}
@using (Html.BeginForm()) {
<input type='text' id='pgm_name' name='pgm_name' value="@ViewBag.pgm_name" />
<input type="submit" value="查询" />
{
string pgm_name = Request.Form["pgm_name"].ToString();
var pageCount = (_db.Prgorams.Count() - 1) / pageSize + 1;
ViewBag.PageCount = pageCount;
ViewBag.PageIndex = pageIndex;
ViewBag.PageSize = pageSize;
var prg = _db.Prgorams
.Where(c => c.pgm_nameContains(pgm_name) = pgm_name )
.OrderByDescending(a => a.pgm_code)
.Skip((pageIndex - 1) * pageSize)
.Take(pageSize)
.ToList();
ViewBag.pgm_name = pgm_name;
return View(prg);
}
@using (Html.BeginForm()) {
<input type='text' id='pgm_name' name='pgm_name' value="@ViewBag.pgm_name" />
<input type="submit" value="查询" />