下面这个Demo用的是MVC+Ado.Net、存储过程

实现功能:分页查询,添加、修改功能。模糊查询功能

先来几张效果图:

创建存储过程如下

go
create proc usp_FenYe2
@selId int,
@selName nvarchar,
@pageIndex int,
@pageSize int,
@recordCount int output,
@pageCount int output
as
begin
if @selId!= and (@selName='')
begin
select *from(
select *,rn=ROW_NUMBER() over(order by UserId) from UserMsg where IsDelete= and( UserId=@selId)
)as t where t.rn between ((@pageIndex-)*@pageSize+) and @pageIndex*@pageSize
set @recordCount=(select count(*) from (select *from UserMsg where IsDelete= and( UserId=@selId))as t);
set @pageCount=CEILING((@recordCount*1.0)/@pageSize)
end
else if @selId= and (@selName!='')
begin
select *from(
select *,rn=ROW_NUMBER() over(order by UserId) from UserMsg where IsDelete= and( UserName like '%'+@selName+'%')
)as t where t.rn between ((@pageIndex-)*@pageSize+) and @pageIndex*@pageSize
set @recordCount=(select count(*) from (select * from UserMsg where IsDelete= and( UserName like '%'+@selName+'%'))as t);
set @pageCount=CEILING((@recordCount*1.0)/@pageSize)
end
else if @selId!= and(@selName!='')
begin
select *from(
select *,rn=ROW_NUMBER() over(order by UserId) from UserMsg where IsDelete= and(UserId=@selId or(UserName like '%'+@selName+'%'))
)as t where t.rn between ((@pageIndex-)*@pageSize+) and @pageIndex*@pageSize
set @recordCount=(select count(*) from (select *from UserMsg where IsDelete= and(UserId=@selId or (UserName like '%'+@selName+'%')))as t);
set @pageCount=CEILING((@recordCount*1.0)/@pageSize)
end
else
begin
select *from(
select *,rn=ROW_NUMBER() over(order by UserId) from UserMsg where IsDelete=)as t where t.rn between ((@pageIndex-)*@pageSize+) and @pageIndex*@pageSize
set @recordCount=(select count(*) from UserMsg);
set @pageCount=CEILING((@recordCount*1.0)/@pageSize)
end
end
go

整个项目代码见:https://github.com/shuai7boy/easyUITest

Jquery-EasyUI学习2~的更多相关文章

  1. jQuery EasyUI学习资源汇总

    jQuery EasyUI学习资源汇总 EasyUi – 1.入门 EasyUi – 2.布局Layout + 3.登录界面 EasyUi – 4.datwagrid 学习Jquery EasyUI的 ...

  2. JQuery EasyUI学习框架

    前言 前端技术,新项目的开发拟使用EasyUI框架(基于EasyUI丰富UI组件库),项目负责人的提示EasyUI分配给我这个任务.发展前,我需要这对于一个新手EasyUI框架学习一些基本的入门.记录 ...

  3. jQuery EasyUI学习二

    1.   课程介绍 1.  Datagrid组件(掌握) 2.  Dialog.form组件(掌握) 3. Layout.Tabs;(掌握) Datagrid组件 2.1.  部署运行pss启动无错 ...

  4. JQuery EasyUI学习笔记

    转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6690888.html  简介与准备 jQuery EasyUI 是一个基于 jQuery 的框架,集成了各种用 ...

  5. JQuery EasyUI学习记录(三)

    1.jQuery EasyUI messager使用方式 1.1 alert方法 $(function(){ //1.alert方法---提示框 $.messager.alert("标题&q ...

  6. JQuery EasyUI学习记录(二)

    1.jquery easyUI动态添加选项卡(查看jquery easyUI手册) 1.1 用于动态添加一个选项卡 1.1.1 选中指定的选项卡和判断某个选项卡是否存在 测试代码: <a id= ...

  7. JQuery EasyUI学习记录(一)

    1.主页设计(JQuery EasyUI插件) 下载easyUI开发包: 将easyUI资源文件导入页面中: <link rel="stylesheet" type=&quo ...

  8. jQuery EasyUI学习一

    1.   jQuery EasyUI介绍 1.  创建组件的方式和原理(掌握) 2.  组件三要素(掌握) 3.  Panel.LinkButton.上下文菜单;(掌握) 简介 2.1.  jQuer ...

  9. JQuery EasyUI学习记录(五)

    1.datagrid使用方法(重要) 1.1将静态html渲染为datagrid样式 <!--方式一: 将静态html渲染为datagrid样式 --> <table class=& ...

  10. JQuery EasyUI学习记录(四)

    1.EasyUI中的validatebox使用 提供的校验规则: 1.非空校验required="required" 2.使用validType指定 email: 正则表达式匹配电 ...

随机推荐

  1. 使用.Net自带的GZipStream进行流压缩与解压

    using System.IO; using System.IO.Compression; using System.Text; namespace CS.Utility { /// <summ ...

  2. 类似material design的电影应用源码

    这个源码应用是一款大家比较熟悉的类似material design的电影应用源码,源码Material-Movies,material design风格的电影应用,这个应用的目的其实是为了讲解作者一篇 ...

  3. TFS - 使用微软测试管理器实现跨团队项目的测试用例管理

    在团队项目之间实现测试用例和测试计划的共享,是很多客户关注的问题.尤其在开发产品+服务的团队中,对测试用例的共享要求比较高.下面就如何在Team Foundation Server中如何实现团队项目之 ...

  4. UVA 11800 Determine the Shape --凸包第一题

    题意: 给四个点,判断四边形的形状.可能是正方形,矩形,菱形,平行四边形,梯形或普通四边形. 解法: 开始还在纠结怎么将四个点按序排好,如果直接处理的话,有点麻烦,原来凸包就可搞,直接求个凸包,然后点 ...

  5. NOIP2012借教室[线段树|离线 差分 二分答案]

    题目描述 在大学期间,经常需要租借教室.大到院系举办活动,小到学习小组自习讨论,都需要 向学校申请借教室.教室的大小功能不同,借教室人的身份不同,借教室的手续也不一样. 面对海量租借教室的信息,我们自 ...

  6. NOIP2010引水入城[BFS DFS 贪心]

    题目描述 在一个遥远的国度,一侧是风景秀美的湖泊,另一侧则是漫无边际的沙漠.该国的行政区划十分特殊,刚好构成一个N 行M 列的矩形,如上图所示,其中每个格子都代表一座城市,每座城市都有一个海拔高度. ...

  7. python pyperclip模块的使用

    用途: 复制,粘贴 用法: >>> import pyperclip >>> pyperclip.copy('Hello world!') >>> ...

  8. Svn Patch 中文乱码

    关于Patch svn打patch的介绍:巧用svn create patch(打补丁)方案解决定制版需求 svn创建patch 1.在SVN的提交列表中,右键选择“创建补丁” 2.选择保存位置,保存 ...

  9. Git管理项目实例说明-记录和跟踪项目

    假设一个HTML项目,使用Git来记录和跟踪这个项目,包括以下内容:1)创建版本库.2)添加与修改文件.3)创建新分支.4)打标签并整理版本库.5)克隆版本库. 1.创建版本库 Creating a ...

  10. 由项目中一个hash2int函数引发的思考

    hash2int /** * 计算一个字符串的md5折算成int返回 * @param type $str * @return type */ function hash2int($str) { $m ...