BiosealMVCWeb.Controllers.CareersController.Process C# (CSharp) Méthode

Process() public méthode

public Process ( ) : System.Web.Mvc.ActionResult
Résultat System.Web.Mvc.ActionResult
        public ActionResult Process()
        {
            db = new biosealEntities();
            int? pageIndex = Convert.ToInt16(Request.QueryString["pageIndex"]);
            pageIndex = (pageIndex == null ? 0 : pageIndex);
            int pageSize = 8; //设置每页显示条数
            //招聘部分
            var Recruits = db.Recruits.OrderByDescending(i => i.Date).Skip(pageIndex.Value * pageSize).Take(pageSize).ToList();
            ViewBag.Pagination = new Pagination(pageIndex, pageSize, db.Recruits.Count());

            //签约部分
            var Contracts = db.Contracts.OrderByDescending(i => i.Date).Skip(pageIndex.Value * pageSize).Take(pageSize).ToList();
            ViewBag.Pagination1 = new Pagination(pageIndex, pageSize, db.Contracts.Count());
            ViewBag.Contracts = Contracts;
            return View(Recruits);
        }