温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:Asp.net2.0车票管理系统
当前文件:
ChePiaoGuanLi/WebForm/Gpgl.aspx[7K,2009-6-12 11:35:13],打开代码结构图
ChePiaoGuanLi/WebForm/Gpgl.aspx[7K,2009-6-12 11:35:13],打开代码结构图1<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Gpgl.aspx.cs" Inherits="WebForm_Gpgl" Title="购票管理" %> 2
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 3
<table style="width: 553px; height: 169px"> 4
<tr> 5
<td style="width: 34px"> 6
</td> 7
<td style="width: 269px"> 8
车次编号:<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" 9
DataTextField="车次编号" DataValueField="车次编号" Width="124px" AutoPostBack="True"> 10
</asp:DropDownList> 11
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="查询" /><br /> 12
数量:<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox> 13
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1" 14
ErrorMessage="请输入数字" ValidationExpression="\d+"></asp:RegularExpressionValidator></td> 15
<td style="width: 130px"> 16
<asp:Button ID="Button1" runat="server" Text="购票" OnClick="Button1_Click" /></td> 17
</tr> 18
<tr> 19
<td style="width: 34px; height: 30px"> 20
</td> 21
<td colspan="2" style="height: 30px"> 22
<asp:GridView ID="GridView1" runat="server" CellPadding="4" 23
DataKeyNames="车次编号" DataSourceID="SqlDataSource2" ForeColor="#333333" GridLines="None"> 24
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> 25
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" /> 26
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> 27
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /> 28
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> 29
<AlternatingRowStyle BackColor="White" /> 30
</asp:GridView> 31
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 32
SelectCommand="SELECT unbuy.车次编号, unbuy.票价, @数量 AS 数量, @总价 AS 总价 FROM unbuy WHERE (unbuy.车次编号 = @车次编号)" InsertCommand="INSERT INTO buy(车次编号, 目的地点, 发车地点, 票价, 数量, 发车时间) VALUES (@车次编号, @目的地点, @发车地点, @票价, @数量, @发车时间)" UpdateCommand="UPDATE unbuy SET 数量 = @数量 WHERE (车次编号 = @车次编号)"> 33
<SelectParameters> 34
<asp:ControlParameter ControlID="TextBox1" Name="数量" PropertyName="Text" /> 35
<asp:SessionParameter Name="总价" SessionField="zongjia" /> 36
<asp:ControlParameter ControlID="DropDownList1" Name="车次编号" PropertyName="SelectedValue" /> 37
</SelectParameters> 38
<UpdateParameters> 39
<asp:SessionParameter Name="数量" SessionField="shuliang" /> 40
<asp:ControlParameter ControlID="DropDownList1" Name="车次编号" PropertyName="SelectedValue" /> 41
</UpdateParameters> 42
<InsertParameters> 43
<asp:ControlParameter ControlID="DropDownList1" Name="车次编号" PropertyName="SelectedValue" /> 44
<asp:ControlParameter ControlID="GridView3" Name="目的地点" PropertyName="Rows[0].Cells[2].Text" /> 45
<asp:ControlParameter ControlID="GridView3" Name="发车地点" PropertyName="Rows[0].Cells[1].Text" /> 46
<asp:ControlParameter ControlID="GridView3" Name="票价" PropertyName="Rows[0].Cells[3].Text" /> 47
<asp:ControlParameter ControlID="TextBox1" Name="数量" PropertyName="Text" /> 48
<asp:ControlParameter ControlID="GridView3" Name="发车时间" PropertyName="Rows[0].Cells[5].Text" /> 49
</InsertParameters> 50
</asp:SqlDataSource> 51
<asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label></td> 52
</tr> 53
<tr> 54
<td style="width: 34px"> 55
</td> 56
<td colspan="2"> 57
58
<asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" CellPadding="4" 59
DataKeyNames="车次编号" DataSourceID="SqlDataSource3" ForeColor="#333333" GridLines="None" 60
Width="524px"> 61
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> 62
<Columns> 63
<asp:BoundField DataField="车次编号" HeaderText="车次编号" ReadOnly="True" SortExpression="车次编号" /> 64
<asp:BoundField DataField="发车地点" HeaderText="发车地点" SortExpression="发车地点" /> 65
<asp:BoundField DataField="目的地点" HeaderText="目的地点" SortExpression="目的地点" /> 66
<asp:BoundField DataField="票价" HeaderText="票价" SortExpression="票价" /> 67
<asp:BoundField DataField="数量" HeaderText="数量" SortExpression="数量" /> 68
<asp:BoundField DataField="发车时间" HeaderText="发车时间" SortExpression="发车时间" /> 69
<asp:BoundField DataField="备注" HeaderText="备注" SortExpression="备注" /> 70
</Columns> 71
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" /> 72
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> 73
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /> 74
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> 75
<AlternatingRowStyle BackColor="White" /> 76
</asp:GridView> 77
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 78
SelectCommand="SELECT * FROM [unbuy] WHERE ([车次编号] = @车次编号)"> 79
<SelectParameters> 80
<asp:ControlParameter ControlID="DropDownList1" Name="车次编号" PropertyName="SelectedValue" 81
Type="String" /> 82
</SelectParameters> 83
</asp:SqlDataSource> 84
</td> 85
</tr> 86
<tr> 87
<td style="width: 34px; height: 21px"> 88
</td> 89
<td colspan="2" style="height: 21px"> 90
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" CellPadding="4" 91
DataKeyNames="车次编号" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" 92
Width="524px"> 93
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> 94
<Columns> 95
<asp:BoundField DataField="车次编号" HeaderText="车次编号" ReadOnly="True" SortExpression="车次编号" /> 96
<asp:BoundField DataField="发车地点" HeaderText="发车地点" SortExpression="发车地点" /> 97
<asp:BoundField DataField="目的地点" HeaderText="目的地点" SortExpression="目的地点" /> 98
<asp:BoundField DataField="票价" HeaderText="票价" SortExpression="票价" /> 99
<asp:BoundField DataField="数量" HeaderText="数量" SortExpression="数量" /> 100
<asp:BoundField DataField="发车时间" HeaderText="发车时间" SortExpression="发车时间" /> 101
<asp:BoundField DataField="备注" HeaderText="备注" SortExpression="备注" /> 102
</Columns> 103
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" /> 104
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> 105
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /> 106
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> 107
<AlternatingRowStyle BackColor="White" /> 108
</asp:GridView> 109
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 110
SelectCommand="SELECT * FROM [unbuy]"></asp:SqlDataSource> 111
</td> 112
</tr> 113
</table> 114
</asp:Content> 115
116





