资源简介
Mvc+Easyui基本使用demo。easyui部分包括页面布局,可伸缩面板,菜单,iframe选项卡,数据表格,linkbutton等的基本使用方法。mvc部分演示了视图调用和json类型数据返回的方法。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Model;
using Models;
using System.Data.Entity;//必须引用
using System.Data;//EntityState.Modified; 这个准备 一定添加命名空间System.Data.Entity和ef4.1
namespace BLL
{
public class ProductBLL
{
public IList GetProductList(int pageIndex int pageSize out int Total)
{
using (MyContext db = new MyContext())
{
Total = (from c in db.Product
orderby c.ID
select c).Count();
var items = (from c in db.Product
orderby c.ID
select c).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
IList ProductInfos = new List();
foreach (var item in items)
{
ProductInfo info = new ProductInfo();
info.ID = item.ID;
info.ProductTypeID = item.ProductTypeID;
info.ProductTypeName = item.ProductType.ProductTypeName;//导航属性的特点
info.Image = item.Image;
info.ProductName = item.ProductName;
info.MarketPrice = item.MarketPrice;
info.NewPrice = item.NewPrice;
info.GetDate = item.GetDate.ToShortDateString();
info.Enable = item.Enable;
ProductInfos.Add(info);
}
return ProductInfos;
}
}
public IList GetProductsBySerach(int pageIndex int pageSize out int Total int typeId int id string name int NewPrice bool? b)
{
using (MyContext db = new MyContext())
{
Total = (from c in db.Product
where ((id != 0) ? c.ID == id : true) && ((typeId != 0) ? c.ProductTypeID == typeId : true) &&
(!string.IsNullOrEmpty(name) ? c.ProductName.Contains(name) : true) &&
((NewPrice != 0) ? c.NewPrice == NewPrice : true) &&
((b == null) ? true : c.Enable == b)//传值为NULL就是全部
orderby c.ProductTypeID
select c).Count();
var items = (from c in db.Product
where ((id != 0) ? c.ID == id : true) && ((typeId != 0) ? c.ProductTypeID == typeId : true) &&
(!string.IsNullOrEmpty(name) ? c.ProductName.Contains(name) : true) &&
((NewPrice != 0) ? c.NewPrice == NewPrice : true) &&
((b == null) ? true : c.Enable == b)//传值为NULL就是全部
orderby c.ProductTypeID//必须在分页前排序
sel
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 783648 2011-04-06 10:33 DLL\Entityfr
文件 320512 2011-01-04 13:48 DLL\Newtonsoft.Json.Net35.dll
文件 13312 2012-10-14 20:34 MyProject\BLL\bin\Debug\BLL.dll
文件 24064 2012-10-14 20:34 MyProject\BLL\bin\Debug\BLL.pdb
文件 5120 2012-10-14 18:13 MyProject\BLL\bin\Debug\DAL.dll
文件 11776 2012-10-14 18:13 MyProject\BLL\bin\Debug\DAL.pdb
文件 783648 2011-04-06 10:33 MyProject\BLL\bin\Debug\Entityfr
文件 9728 2012-10-14 18:13 MyProject\BLL\bin\Debug\Model.dll
文件 11776 2012-10-14 18:13 MyProject\BLL\bin\Debug\Model.pdb
文件 3022 2012-10-09 00:29 MyProject\BLL\BLL.csproj
文件 227 2012-10-14 14:51 MyProject\BLL\BLL.csproj.user
文件 639 2012-10-14 14:51 MyProject\BLL\obj\Debug\BLL.csproj.FileListAbsolute.txt
文件 13312 2012-10-14 20:34 MyProject\BLL\obj\Debug\BLL.dll
文件 24064 2012-10-14 20:34 MyProject\BLL\obj\Debug\BLL.pdb
文件 5966 2012-10-14 21:15 MyProject\BLL\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 13211 2012-10-14 18:13 MyProject\BLL\obj\Debug\ResolveAssemblyReference.cache
文件 5876 2012-10-14 20:34 MyProject\BLL\ProductBLL.cs
文件 5401 2012-10-14 20:14 MyProject\BLL\ProductTypeBLL.cs
文件 1338 2012-09-19 22:51 MyProject\BLL\Properties\AssemblyInfo.cs
文件 5120 2012-10-14 18:13 MyProject\DAL\bin\Debug\DAL.dll
文件 11776 2012-10-14 18:13 MyProject\DAL\bin\Debug\DAL.pdb
文件 783648 2011-04-06 10:33 MyProject\DAL\bin\Debug\Entityfr
文件 9728 2012-10-14 18:13 MyProject\DAL\bin\Debug\Model.dll
文件 11776 2012-10-14 18:13 MyProject\DAL\bin\Debug\Model.pdb
文件 2817 2012-10-14 14:51 MyProject\DAL\DAL.csproj
文件 1071 2012-10-08 00:14 MyProject\DAL\MyContext.cs
文件 503 2012-10-08 00:29 MyProject\DAL\obj\Debug\DAL.csproj.FileListAbsolute.txt
文件 5120 2012-10-14 18:13 MyProject\DAL\obj\Debug\DAL.dll
文件 11776 2012-10-14 18:13 MyProject\DAL\obj\Debug\DAL.pdb
文件 5894 2012-10-14 21:15 MyProject\DAL\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
............此处省略392个文件信息
相关资源
- 基于MVC模式的会员管理系统
- 简单的房屋租赁系统
- .net网站服装销售系统(MVC)
- 基于MVC模式的校园BBS系统的设计与实
- MVC模式编写的音乐网站
- MVC模式实现的计算器
- 扫雷(MVC架构)
- 关于Spring MVC项目maven中通过fileupload上
- 基于web的图书馆运营系统
- 新闻管理系统前台和后台
- MVC做的小说管理系统
- 一个spring项目
- .net mvc3完整案例
- springmvc+mybatis点餐系统(包含完整数据
- springMVC的学习代码
- Shopping+在线购物商城的实现Spring+Spr
- 基于MVC的网上书城系统
- springmvc+Mybatis+axis2+webservice+quartz作业整
- springmvc 实体层自动生成工具
- .net MVC+Bootstrap下使用localResizeIMG上传图
- .NET MVC实现文件上传
- Spring MVC 学习指南(第2版高清中文
- springmvc_2020.rar
- 基于SSM的校社联社团管理系统SpringM
- MVC界面登录实现,没有存数据库
- springmvc+netty实现聊天功能
- .net MVC网上书店源代码完整版
- MVC人力资源管理系统
- spring mvc中启动netty
- jfinalShiroEasyui
评论
共有 条评论