Default.aspx
上传用户:zhl0745
上传日期:2022-04-11
资源大小:128k
文件大小:3k
源码类别:

行业应用

开发平台:

Java

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5.     <title>火车票查询</title>
  6.     <style type="text/css">
  7.         body
  8.         {
  9.             text-align: center;
  10.         }
  11.         .button
  12.         {
  13.             margin: 0px;
  14.             padding: 0px;
  15.             border: 0px;
  16.             width: 59px;
  17.             height: 17px;
  18.             background-image: url(  "images/BtnQuery.gif" );
  19.         }
  20.         .text
  21.         {
  22.          border:1px #6CF solid;
  23.         }
  24.         hr
  25.         {
  26.          color:#cccccc;
  27.             width: 200px;
  28.         }
  29.         .divContainer
  30.         {
  31.          border:2px #cccccc solid;
  32.          width: 200px; 
  33.          text-align: left;
  34.         }
  35.     </style>
  36.     <script type="text/javascript" language="javascript" src="jquery-1.3.2-vsdoc2.js"></script>
  37.     <!-- 51aspx  -->
  38.     <script type="text/javascript" language="javascript">
  39.     //5-1-a-s-p-x
  40.         $(document).ready(function(){
  41.             $("#btnOK").click(setResult);
  42.         });
  43.         function setResult(){
  44.             var no = $("#txtNo").val();
  45.             var start = $("#txtStart").val();
  46.             var end = $("#txtEnd").val();
  47.             var type = $("#slTicketType").val(); 
  48.             $.post("/MyTicketSaleWeb/WebService.asmx/GetResult",{"num":no,"start":start,"end":end,"type":type},function(doc){  
  49.                 $(doc).find("TicketModel ").each(function(){
  50.                     var count = $(this).find("TicketCount").text();
  51.                     if(count == "0" || count == ""){
  52.                         $("#spTickctCount").text("没有可销售的票");
  53.                         return;
  54.                     } 
  55.                     $("#spTickctCount").text(count);
  56.                     $("#spUnitPrice").text($(this).find("UnitPrice").text());
  57.                     $("#spStartTime").text($(this).find("StartTime").text());
  58.                 });
  59.             });
  60.         }
  61.     </script>
  62. </head>
  63. <body>
  64.     <form id="form1" runat="server">
  65.     <div class="divContainer">
  66.         输入车次:<br />
  67.         <input id="txtNo" class="text"/>
  68.         <br />
  69.         出发地:<br />
  70.         <input id="txtStart" class="text"/><br />
  71.         到达地:<br />
  72.         <input id="txtEnd" class="text"/><br />
  73.         票类型:<br />
  74.         <select id="slTicketType" class="text">
  75.             <option value="1">硬座</option>
  76.             <option value="2">硬卧</option>
  77.             <option value="3">软卧</option>
  78.         </select><br />
  79.         供学习用,非模糊查询<br />
  80.         <input type="button" id="btnOK" class="button" />
  81.         <br />
  82.         <hr /> 
  83.         剩余票数:<span id="spTickctCount"></span>
  84.         <br />
  85.         <br />
  86.         票&nbsp; 单&nbsp; 价:<span id="spUnitPrice"></span>
  87.         <br />
  88.         <br />
  89.         发车时间:<span id="spStartTime"></span>
  90.     </div>
  91.     </form>
  92. </body>
  93. </html>