Jquery-EasyUI學習2~

來源:互聯網
上載者:User

標籤:

下面這個Demo用的是MVC+Ado.Net、預存程序

實現功能:分頁查詢,添加、修改功能。模糊查詢功能

先來幾張:

 

建立預存程序如下

gocreate proc usp_FenYe2@selId int,@selName nvarchar,@pageIndex int,@pageSize int,@recordCount int output,@pageCount int outputas beginif @selId!=0 and (@selName=‘‘)beginselect *from(select *,rn=ROW_NUMBER() over(order by UserId) from UserMsg where IsDelete=1 and( UserId=@selId))as t where t.rn between ((@pageIndex-1)*@pageSize+1) and @pageIndex*@pageSizeset @recordCount=(select count(*) from (select *from UserMsg where IsDelete=1 and( [email protected]))as t);set @pageCount=CEILING((@recordCount*1.0)/@pageSize)endelse if @selId=0 and (@selName!=‘‘)beginselect *from(select *,rn=ROW_NUMBER() over(order by UserId) from UserMsg where IsDelete=1 and( UserName like ‘%‘[email protected]+‘%‘))as t where t.rn between ((@pageIndex-1)*@pageSize+1) and @pageIndex*@pageSizeset @recordCount=(select count(*) from (select * from UserMsg where IsDelete=1 and( UserName like ‘%‘[email protected]+‘%‘))as t);set @pageCount=CEILING((@recordCount*1.0)/@pageSize)endelse if @selId!=0 and(@selName!=‘‘)beginselect *from(select *,rn=ROW_NUMBER() over(order by UserId) from UserMsg where IsDelete=1 and([email protected] or(UserName like ‘%‘[email protected]+‘%‘)))as t where t.rn between ((@pageIndex-1)*@pageSize+1) and @pageIndex*@pageSizeset @recordCount=(select count(*) from (select *from UserMsg where IsDelete=1 and([email protected] or (UserName like ‘%‘[email protected]+‘%‘)))as t);set @pageCount=CEILING((@recordCount*1.0)/@pageSize)endelse beginselect *from(select *,rn=ROW_NUMBER() over(order by UserId) from UserMsg where IsDelete=1)as t where t.rn between ((@pageIndex-1)*@pageSize+1) and @pageIndex*@pageSizeset @recordCount=(select count(*) from UserMsg);set @pageCount=CEILING((@recordCount*1.0)/@pageSize)endendgo
View Code

 

整個項目代碼見:https://github.com/shuai7boy/easyUITest

 

Jquery-EasyUI學習2~

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.