// GET: Product public ActionResult Index(ProductModel model) { var pageIndex = Request.QueryString["pageindex"]; int index = 0; int pageSize = 10; Int32.TryParse(pageIndex, out index); if (index == 0) { index = 1; } var UserInfo = NFine.Code.OperatorProvider.Provider.GetCurrent(); if (UserInfo == null) { return(RedirectToAction("Login", "Account")); } ProductModel viewModel = new ProductModel(); if (base.agentInfo != null) { CommLogic.DeepClone <AgentInfoModel>(viewModel, agentInfo); List <Product> list = ProductLogic.GetList().Where(t => t.F_DeleteMark == false || t.F_DeleteMark == null).ToList(); viewModel.productList = new PagerResult <Product>(); viewModel.productList.DataList = list.OrderByDescending(t => t.F_CreatorTime).Skip <Product>((index - 1) * pageSize).Take(pageSize); viewModel.productList.Code = 0; viewModel.productList.Total = list.Count(); viewModel.productList.PageIndex = index; viewModel.productList.PageSize = pageSize; viewModel.productList.RequestUrl = "Index?pageindex=" + index; } return(View(viewModel)); }