mvc.net分页查询案例——控制器(HomeController.cs)
来源:互联网 发布:php抽象类和接口的区别 编辑:程序博客网 时间:2024/06/05 10:21
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using HouseSys.Models;using HouseSys.BLL;namespace HouseSys.Controllers.Home{ public class HomeController : Controller { StreetBLL streetBll = new StreetBLL(); HouseTypeBLL typeBll = new HouseTypeBLL(); HouseBLL houseBll = new HouseBLL(); /// <summary> /// 进入首页 /// 获取所有的房屋位置 /// 获取所有的房型 /// </summary> /// <returns></returns> public ActionResult Index(int pageIndex = 1,int pageSize = 5) { List<StreetModel> streetList = streetBll.GetStreets(); List<HouseTypeModel> typeList = typeBll.GetHouseTypes(); SelectList selectStree = new SelectList(streetList,"Id","Name"); SelectList selectType = new SelectList(typeList, "Id", "Name"); int AllCount = 0; List<HouseModel> houseList = houseBll.GetHousesAll(pageIndex,pageSize,out AllCount); ViewData["selectStree"] = selectStree; ViewData["selectType"] = selectType; PagedList<HouseModel> pageList = new PagedList<HouseModel>(houseList,pageIndex,pageSize,AllCount); return View(pageList); } }}
阅读全文
0 0
- mvc.net分页查询案例——控制器(HomeController.cs)
- mvc.net分页查询案例——DLL数据访问层(HouseDLL.cs)
- mvc.net分页查询案例——实体层(HouseModel.cs)
- mvc.net分页查询案例——业务逻辑层BLL(HouseBLL.cs)
- mvc.net分页查询案例——mvc-paper.css
- mvc.net分页查询案例——PagedList
- mvc.net分页查询案例——PagerExtension
- mvc.net分页查询案例——前台页面(Index.aspx)
- (easyui datagrid+mvc+json)之asp.net分页查询
- (easyui datagrid+mvc+json)之asp.net分页查询
- ASP.NET MVC下面的Controller与Fckeditor.Controllers.HomeController同名的解决办法
- ASP.NET MVC案例—拦截器
- ASP.NET MVC案例教程(基于ASP.NET MVC beta)——第三篇:ASP.NET MVC全局观
- ASP.NET MVC案例教程(基于ASP.NET MVC beta)——第七篇:闲话ASP.NET MVC
- ASP.NET MVC案例教程(基于ASP.NET MVC beta)——第三篇:ASP.NET MVC全局观
- ASP.NET MVC案例教程(基于ASP.NET MVC beta)——第三篇:ASP.NET MVC全局观
- ASP.NET MVC案例教程(基于ASP.NET MVC beta)——第七篇:闲话ASP.NET MVC
- ASP.NET MVC案例教程(基于ASP.NET MVC beta)——第三篇:ASP.NET MVC全局观
- c++面试题
- 缓存穿透优化
- mvc.net分页查询案例——实体层(HouseModel.cs)
- mvc.net分页查询案例——业务逻辑层BLL(HouseBLL.cs)
- c++学习笔记-----qsort通用排序函数
- mvc.net分页查询案例——控制器(HomeController.cs)
- mvc.net分页查询案例——前台页面(Index.aspx)
- c++面试题
- c语言ftell和c++的tellg,返回读写偏移
- npm 常用命令详解
- 每天10个Linux命令三
- 对于输入的一个正整数,输出其反转形式 使用c++ class编写
- FUZ2213 圆的切线问题
- 答案选取(基于嵌入表示的相似度量)