下面这个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. Android中 int,float,Double,String 互相转换

    1 如何将字串 String 转换成整数 int?  A. 有两个方法: 1). int i = Integer.parseInt([String]); 或 i = Integer.parseInt( ...

  2. Kali Linux 秘籍/Web渗透秘籍/无线渗透入门

    Kali Linux 秘籍 原书:Kali Linux Cookbook 译者:飞龙 在线阅读 PDF格式 EPUB格式 MOBI格式 Github Git@OSC 目录: 第一章 安装和启动Kali ...

  3. Linux 下从头再走 GTK+-3.0 (一)

    原本由于项目需求在 Linux 下学习过一段时间的 GTK+2.0 图形开发,时隔一段时间,想真正深入学习一下 GTK . 这次直接从头学习 GTK+-3.0 ,并写下博文便于日后查看,也方便新手入门 ...

  4. linux chmod命令和chown命令

    一.chmod及文件权限 1.了解文件权限 root账户新建一个目录permission,在该目录新建一个文件file,通过ll就可以查看其权限. root@development:~# cd per ...

  5. stanford coursera 机器学习编程作业 exercise 5(正则化线性回归及偏差和方差)

    本文根据水库中蓄水标线(water level) 使用正则化的线性回归模型预 水流量(water flowing out of dam),然后 debug 学习算法 以及 讨论偏差和方差对 该线性回归 ...

  6. Codeforces 549D. Hear Features[贪心 英语]

    D. Haar Features time limit per test 1 second memory limit per test 256 megabytes input standard inp ...

  7. USACO3.1Humble Numbers[...]

    题目背景 对于一给定的素数集合 S = {p1, p2, ..., pK},考虑一个正整数集合,该集合中任一元素的质因数全部属于S.这个正整数集合包括,p1.p1*p2.p1*p1.p1*p2*p3. ...

  8. AC日记——单词翻转 1.7 27

    27:单词翻转 总时间限制:  1000ms 内存限制:  65536kB 描述 输入一个句子(一行),将句子中的每一个单词翻转后输出. 输入 只有一行,为一个字符串,不超过500个字符.单词之间以空 ...

  9. 给ros安装arbotix simulator仿真环境

    首先下载程序包.编译.安装. cd ~/catkin_ws/src git clone https://github.com/pirobot/rbx1.git cd rbx1 git checkout ...

  10. 在ubuntu14.04设置静态ip

    打开网络的配置文件 sudo vim /etc/network/interfaces 选择网卡,我这里是有线网卡eth0,设置静态ip为192.168.1.108 auto eth0 iface et ...