jquery+c# 分页列表模块
来源:互联网 发布:复杂网络建模的研究生 编辑:程序博客网 时间:2024/06/03 13:29
aspx 工具条
<div class="well well-small" style="margin-left:10px;width:80%;"> <div id="div_NewButton" class="btn-group"> <button id="btnNew" class="btn" type="button" ><i class="icon-file"></i>新建入库单</button> <button class="btn dropdown-toggle" data-toggle="dropdown" style="height:30px;"> <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a id="a_NewPage" href="#" target="_blank">在新窗口中新建单据</a></li> </ul> </div> <button id="btnSearchDiv" class="btn" type="button" ><i class="icon-filter"></i>单据检索</button> <button id="btnRefresh" class="btn" type="button" ><i class="icon-refresh"></i>刷新列表</button> <ul class="nav nav-pills" style="float:left;margin-right:10px;"> <li class="dropdown active"> <a class="dropdown-toggle" data-toggle="dropdown"href="#"> <span id="span_CheckStatusTitle">显示全部单据</span> <input id="txtCheckStatus" type="text" value="显示全部单据" style="display:none;"/> <b class="caret"></b> </a> <ul id="ul1" class="dropdown-menu"> <li > <a href="javascript:void(0);" onclick="CheckStatus_Click('显示全部单据');"><i class='icon-hand-right'></i>显示全部单据</a> </li> <li class="divider"></li> <li > <a href="javascript:void(0);" onclick="CheckStatus_Click('显示已审单据');"><i class='icon-hand-right'></i>显示已审单据</a> </li> <li class="divider"></li> <li > <a href="javascript:void(0);" onclick="CheckStatus_Click('显示未审单据');"><i class='icon-hand-right'></i>显示未审单据</a> </li> </ul> </li> </ul> <span> <img id="imgAjax" src="../Images/ajax-blue-banner.gif" style="display:none;" /> </span> </div>
<div style="margin:0 10px;"> <table id="listTable" class="table table-bordered table-hover table-striped" > <thead > <tr> <th style="width:100px;">单据编号</th> <th style="width:140px;">日期</th> <th style="width:180px;">供应商</th> <th style="width:140px;">仓库货位</th> <th style="width:140px;">备注</th> <th style="width:80px;">录入</th> <th style="width:80px;">审核</th> </tr> </thead> <tbody id="tbodyList"></tbody> </table> <div class="pagination"> <ul id="ul_Page"> <li><a id="a_Page_First" href="javaScript:void(0);" >首页</a></li> <li><a id="a_Page_Up" href="javaScript:void(0);">上一页</a></li> <li><a id="a_Page_Down" href="javaScript:void(0);">下一页</a></li> <li><a id="a_Page_End" href="javaScript:void(0);">末页</a></li> <li><a id="a_Page_Title">...</a></li> </ul> <span> </span> <div style="display:none;"> <input id="txtPageCount" type="text" value="0"/> <asp:TextBox ID="txtPageNum" runat="server" ></asp:TextBox> </div> </div> </div>
jquery 分页查询
$("#a_Page_First").click(function () { LoadTable("0", "1"); }); $("#a_Page_End").click(function () { LoadTable("0", $("#txtPageCount").val()); }); $("#a_Page_Up").click(function () { var P = $("#txtPageNum").val(); if (P == "" || P == "0" || P == "1") { LoadTable("0", "1"); } else { LoadTable("0", parseInt(P) - 1); } }); $("#a_Page_Down").click(function () { var P = $("#txtPageNum").val(); if (P == "" || P == "0") { LoadTable("0", "1"); } else { if (P == $("#txtPageCount").val()) LoadTable("0", P); else LoadTable("0", parseInt(P) + 1); } });
function LoadTable(bShowPage, PageNum){ $("#imgAjax").css("display", ""); $("#div_alert").css("display", "none"); $.ajax({ type: "POST", url: "BillInList.aspx/LoadTable", dataType: "json", contentType: "application/json;charset=utf-8", timeout: 15000, data: "{" + "bShowPage:\"" + bShowPage + "\"," + "AccountCode:\"" + $("#txtAccountCode").val() + "\"," + "PageNum:\"" + PageNum + "\"," + "EditPage:\"" + $("#txtEditPage").val() + "\"," + "VenGuid:\"" + $("#txtVenGuid").val() + "\"," + "WarehouseGuid:\"" + $("#txtWarehouseGuid").val() + "\"," + "Date1:\"" + $("#txtDate1").val() + "\"," + "Date2:\"" + $("#txtDate2").val() + "\"," + "CheckStatus:\"" + $("#txtCheckStatus").val() + "\"" + "}", success: function (data) { var json = $.parseJSON(data.d); var strResult = unescape(json[0].strResult); var strData = unescape(json[0].strData); var strPageCount = unescape(json[0].strPageCount); if (strResult == "OK") { $("#tbodyList").html(strData); if (bShowPage == "0") { $("#txtPageNum").val(PageNum); $("#a_Page_Title").html("当前第" + PageNum + "页 共" + $("#txtPageCount").val() + "页 每页10条 "); } else { $("#txtPageNum").val(PageNum); $("#txtPageCount").val(strPageCount); $("#a_Page_Title").html("当前第" + PageNum + "页 共" + strPageCount + "页 每页10条 "); } $("#imgAjax").css("display", "none"); } else { $("#imgAjax").css("display", "none"); $("#div_alert").attr("class", "alert alert-error"); $("#div_alert h4").html("失败!"); $("#div_alert label").html(strResult); $("#div_alert").fadeIn("slow", function () { $("#div_alert").delay(1200).fadeOut("slow"); }); } }, error: function (XmlHttpRequest, textStatus, errorThrown) { $("#imgAjax").css("display", "none"); $("#div_alert").attr("class", "alert alert-error"); $("#div_alert h4").html("失败!"); $("#div_alert label").html(textStatus); $("#div_alert").fadeIn("slow", function () { $("#div_alert").delay(1200).fadeOut("slow"); }); } });}
function CheckStatus_Click(CheckStatus) { $("#span_CheckStatusTitle").html(CheckStatus); $("#txtCheckStatus").val(CheckStatus); LoadTable(1, 1);}
c#
[System.Web.Services.WebMethod] public static String LoadTable(string bShowPage, string AccountCode,string PageNum, string EditPage, string VenGuid, string WarehouseGuid, string Date1, string Date2, string CheckStatus) { string strData = ""; string strPageCount = ""; if (PageNum == "") PageNum = "1"; int startIndex = (Convert.ToInt32(PageNum)-1) * 10+1; int endIndex = startIndex + 9; if (!ClsParameter.IsDateTime(Date1)) Date1 = "1900-01-01"; if (!ClsParameter.IsDateTime(Date2)) Date2 = "3000-01-01"; SqlParameter[] paras = new SqlParameter[] { new SqlParameter("@AccountCode",AccountCode), new SqlParameter("@VenGuid",VenGuid), new SqlParameter("@WarehouseGuid",WarehouseGuid), new SqlParameter("@Date1",Date1), new SqlParameter("@Date2",Date2), new SqlParameter("@CheckStatus",CheckStatus), new SqlParameter("@startIndex",startIndex), new SqlParameter("@endIndex",endIndex), new SqlParameter("@docount",1), }; if (bShowPage == "1") { strPageCount = SqlHelper.ExecuteScalar(ClsParameter.ConnectionString, CommandType.StoredProcedure, "sp_Invoicing_Bill_In_List", paras).ToString(); if (strPageCount == "0") { return "[{\"strResult\":\"OK\",\"strData\":\"\",\"strPageCount\":\"0\"}]"; } else { strPageCount = Convert.ToString(Math.Ceiling(Convert.ToDouble(strPageCount) / (double)10)); } } paras[8].Value = 0; using (SqlDataReader myDr = SqlHelper.ExecuteReader(ClsParameter.ConnectionString, CommandType.StoredProcedure, "sp_Invoicing_Bill_In_List", paras)) { while (myDr.Read()) { strData += "<tr id='tr_" + System.Convert.ToString(myDr["BillGuid"]) + "'>" + "<td><a href=\"" + EditPage + ".aspx?BillGuid=" + System.Convert.ToString(myDr["BillGuid"]) + "\" >" + System.Convert.ToString(myDr["BillCode"]) + "</a> " + "<a target='_blank' href=\"" + EditPage + ".aspx?BillGuid=" + System.Convert.ToString(myDr["BillGuid"]) + "\" ><img src='../Images/NewPage.png'></img></a></td>" + "<td>" + System.Convert.ToString(myDr["BillDate"]) + "</td>" + "<td>" + System.Convert.ToString(myDr["VenName"]) + "</td>" + "<td>" + System.Convert.ToString(myDr["WarehouseName"]) + "</td>"+ "<td>" + System.Convert.ToString(myDr["Remark_Price"]) + "</td>" + "<td>" + System.Convert.ToString(myDr["BillUser_Price"]) + "</td>" + "<td id='td_Button_" + iRow.ToString() + "'><button class='btn btn-mini btn-danger' type='button' onclick=\"GoodsOut('" + System.Convert.ToString(myDr["GoodsGuid"]) + "','" + iRow.ToString() + "','0');\">取消缺货</button></td>"
;strData += "</tr>";
} } strData = Microsoft.JScript.GlobalObject.escape(strData); return "[{\"strResult\":\"OK\",\"strData\":\"" + strData + "\",\"strPageCount\":\"" + strPageCount + "\"}]"; }
sql server 存储过程
CREATE procedure sp_Invoicing_Bill_In_List (@AccountCode varchar(50),@VenGuid varchar(50),@WarehouseGuid varchar(50),@Date1 varchar(50),@Date2 varchar(50),@startIndex int,@endIndex int,@docount bit)asset nocount onif(@docount=1)beginselect count(*) from vw_Invoicing_Bill_In where AccountCode = @AccountCode and VenGuid like '%' + @VenGuid +'%' and WarehouseGuid like '%' + @WarehouseGuid +'%' and BillDate between @Date1 and @Date2 and CheckUser_Price !='' endelsebegindeclare @indextable table(id int identity(1,1),nid int)set rowcount @endIndexinsert into @indextable(nid) select AutoID from vw_Invoicing_Bill_In where AccountCode = @AccountCode and VenGuid like '%' + @VenGuid +'%' and WarehouseGuid like '%' + @WarehouseGuid +'%' and BillDate between @Date1 and @Date2 and CheckUser_Price !='' order by BillDate desc,BillCode descselect BillGuid,BillCode,BillDate,VenName,WarehouseName, BillUser_Amount,CheckUser_Amount,BillUser_Price,CheckUser_Price, Remark_Amount,Remark_Price from vw_Invoicing_Bill_In O,@indextable t where O.AutoID=t.nidand t.id between @startIndex and @endIndex order by t.idendset nocount offGO
- jquery+c# 分页列表模块
- jquery使用ajax分页显示列表
- jquery+json实现数据列表分页
- jquery模糊查询 结果列表可以分页
- Jquery EasyUI DataGridView(easyui分页列表)
- 使用Ajax+JQuery构造分页查询列表
- 在c# 的分页获取数据列表
- C#JQuery学习(一)列表的排序+分页
- jquery实现ajax查询后台数据列表,支持分页
- jQuery+json,分页显示数据列表,HTML+CSS,固定表头
- jquery列表页悬浮显示图片 分页显示
- 列表分页
- jquery 分页
- jquery分页
- jquery 分页
- Jquery 分页
- C# 分页
- c#分页
- WordPress 设置评论数到达一定时关闭评论
- B-树
- 数据库优化
- Reporting Service 开发中的知识汇总
- C语言文件操作函数大全
- jquery+c# 分页列表模块
- CloudStack 4.0.2 vRouter导致重启后状态不正常
- 无需第三个变量实现两个数的交换
- 下载进度条的设计
- 循环遍历文件夹
- 第一篇博客
- python函数参数是值传递还是引用传递(以及变量间复制后是否保持一致):取决于对象内容可变不可变
- 3.1.5 Enhancements
- iOS AvPlayer AvAudioPlayer音频的后台播放问题