queryflight.aspx
来自「此项目是用asp.net开发的航班查询系统」· ASPX 代码 · 共 161 行
ASPX
161 行
<%@ Page language="c#" Codebehind="QueryFlight.aspx.cs" AutoEventWireup="false" Inherits="AirOfWlb.QueryFlight" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>QueryFlight</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="css/css.css" type="text/css" rel="stylesheet">
<script>
function change(opt)
{
var tb=opt.parentElement.parentElement.parentElement;
if(tb.rows[1].style.display=="none")
{
tb.rows[1].style.display="block";
opt.innerText="-";
}
else
{
tb.rows[1].style.display="none";
opt.innerText="+";
}
}
function showall(opt)
{
var tb=window.document.all.dgFlight;
var divs=tb.getElementsByTagName("div");
for(var i=1;i<divs.length;i++)
{
show(divs[i],opt.innerText);
}
if(opt.innerText=="+")
{
opt.innerText="-";
}
else
{
opt.innerText="+";
}
}
function show(opt,text)
{
var tb=opt.parentElement.parentElement.parentElement;
if(text=="+")
{
tb.rows[1].style.display="block";
opt.innerText="-";
}
else
{
tb.rows[1].style.display="none";
opt.innerText="+";
}
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT id="FONT1" face="宋体" runat="server">
<TABLE id="Table1" height="100%" cellSpacing="1" cellPadding="1" width="100%" align="center"
border="0">
<TR height="15%">
<TD align="center" colSpan="2"><asp:label id="Label6" runat="server">航班查询系统</asp:label></TD>
</TR>
<TR>
<TD vAlign="top" width="20%">
<TABLE id="Table2" cellSpacing="1" cellPadding="1" width="100%" border="1">
<TR>
<TD align="left" colSpan="2"><asp:label id="Label1" runat="server">>>查询机票</asp:label></TD>
</TR>
<TR>
<TD style="WIDTH: 39px"><asp:label id="Label3" runat="server" Width="70px">起飞城市</asp:label></TD>
<TD align="left"><asp:dropdownlist id="ddlDepartureCity" runat="server" Width="120px"></asp:dropdownlist></TD>
</TR>
<TR>
<TD style="WIDTH: 39px"><asp:label id="Label2" runat="server" Width="70px">到达城市</asp:label></TD>
<TD align="left"><asp:dropdownlist id="ddlArrivalCity" runat="server" Width="120px"></asp:dropdownlist><asp:comparevalidator id="CompareValidator1" runat="server" Operator="NotEqual" ControlToCompare="ddlDepartureCity"
ControlToValidate="ddlArrivalCity" ErrorMessage="起飞和到达城市不能一样"></asp:comparevalidator></TD>
</TR>
<TR>
<TD style="WIDTH: 39px"><asp:label id="Label4" runat="server" Width="70px">起飞日期</asp:label></TD>
<TD align="left"><asp:textbox id="txtMinDate" runat="server" Width="120px"></asp:textbox></TD>
</TR>
<TR>
<TD style="WIDTH: 39px"><asp:label id="Label5" runat="server" Width="70px">到达日期</asp:label></TD>
<TD align="left"><asp:textbox id="txtMaxDate" runat="server" Width="120px"></asp:textbox></TD>
</TR>
<TR>
<TD align="center" colSpan="2"><asp:button id="btnSearch" runat="server" Text="查询"></asp:button></TD>
</TR>
</TABLE>
</TD>
<TD id="TD1" vAlign="top" runat="server"><asp:datagrid id="dgFlight" runat="server" Width="100%" AutoGenerateColumns="False">
<Columns>
<asp:TemplateColumn>
<HeaderTemplate>
<TABLE id="Table3" cellSpacing="1" cellPadding="1" width="100%" align="center" border="0">
<TR>
<TD width="3%">
<DIV style="CURSOR: hand" onclick="showall(this);">+</DIV>
<TD width="17%">航班代号</TD>
<TD width="20%">起飞城市</TD>
<TD width="20%">到达城市</TD>
<TD width="20%">起飞时间</TD>
<TD width="20%">到达时间</TD>
</TR>
</TABLE>
</HeaderTemplate>
<ItemTemplate>
<TABLE id="Table5" cellSpacing="1" cellPadding="1" width="100%" align="center" border="0">
<TR style="DISPLAY: block">
<TD width="3%">
<DIV style="CURSOR: hand" onclick="change(this);">+</DIV>
</TD>
<TD width="17%">
<asp:Label id=lblFlightId runat="server" text='<%# DataBinder.Eval(Container.DataItem,"FlightName")%>'>
</asp:Label></TD>
<TD width="20%">
<asp:Label id=lblDepartureCityName runat="server" text='<%# DataBinder.Eval(Container.DataItem,"DepartureCityName")%> '>
</asp:Label></TD>
<TD width="20%">
<asp:Label id=lblArrivalCityName runat="server" text='<%#DataBinder.Eval(Container.DataItem,"ArrivalCityName")%>'>
</asp:Label></TD>
<TD width="20%">
<asp:Label id=lblDepartureTime runat="server" text='<%# DataBinder.Eval(Container.DataItem,"DepartureTime")%> '>
</asp:Label></TD>
<TD width="20%">
<asp:Label id=lblArrivalTime runat="server" text='<%# DataBinder.Eval(Container.DataItem,"ArrivalTime")%>'>
</asp:Label></TD>
</TR>
<TR style="DISPLAY:none">
<TD></TD>
<TD vAlign="top" colSpan="5"><FONT face="宋体">
<asp:DataGrid id="dgCabin" runat="server" Width="100%" AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="CabinName" HeaderText="舱位代码" ItemStyle-Width="17%"></asp:BoundColumn>
<asp:BoundColumn DataField="Type" HeaderText="舱位种类" ItemStyle-Width="20%"></asp:BoundColumn>
<asp:BoundColumn DataField="RemainTickets" HeaderText="剩余票数" ItemStyle-Width="20%"></asp:BoundColumn>
<asp:BoundColumn DataField="Price" HeaderText="价格" ItemStyle-Width="20%"></asp:BoundColumn>
<asp:BoundColumn DataField="Discount" HeaderText="折扣" ItemStyle-Width="20%"></asp:BoundColumn>
</Columns>
</asp:DataGrid></FONT></TD>
</TR>
</TABLE>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid></TD>
</TR>
</TABLE>
</FONT>
</form>
</body>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?