📄 roomform.aspx
字号:
<%--文件名:RoomForm.aspx--%>
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="RoomForm.aspx.cs" Inherits="System_RoomForm" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table style="width: 556px; height: 161px">
<tr>
<td align="left" style="font-size: 0.8em; width: 1193px; font-family: 宋体; background-color: gainsboro; height: 16px;">
房号:<asp:TextBox ID="TextBox1" runat="server" Width="75px"></asp:TextBox>
类别:<asp:DropDownList ID="DropDownList1" runat="server" Width="98px">
<asp:ListItem>单人间</asp:ListItem>
<asp:ListItem>双人间</asp:ListItem>
<asp:ListItem>三人间</asp:ListItem>
<asp:ListItem>四人间</asp:ListItem>
<asp:ListItem>豪华间</asp:ListItem>
<asp:ListItem>钟点房</asp:ListItem>
<asp:ListItem>棋牌室</asp:ListItem>
<asp:ListItem>会议室</asp:ListItem>
<asp:ListItem>其他项1</asp:ListItem>
<asp:ListItem>其他项2</asp:ListItem>
<asp:ListItem>其他项3</asp:ListItem>
<asp:ListItem>其他项4</asp:ListItem>
<asp:ListItem>其他项5</asp:ListItem>
</asp:DropDownList>
楼层:<asp:TextBox ID="TextBox2" runat="server" Width="45px"></asp:TextBox>
单价:<asp:TextBox ID="TextBox3" runat="server" Width="45px">0</asp:TextBox>
可住人数:<asp:TextBox ID="TextBox4" runat="server" Width="45px">1</asp:TextBox></td>
</tr>
<tr>
<td align="left" style="font-size: 0.8em; width: 1193px; font-family: 宋体; height: 27px; background-color: gainsboro;">
已住人数:<asp:TextBox ID="TextBox5" runat="server" Width="45px">0</asp:TextBox>
说明:<asp:TextBox ID="TextBox6" runat="server" Width="252px">暂无</asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="新增" Width="59px" />
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="修改" Width="59px" /></td>
</tr>
<tr>
<td style="width: 1193px; height: 260px; background-color: gainsboro;">
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyHotelDBConnectionString %>"
DeleteCommand="DELETE FROM [酒店房间] WHERE [房号] = @房号" InsertCommand="INSERT INTO [酒店房间] ([房号], [类别], [楼层], [单价], [可住人数], [已住人数], [说明]) VALUES (@房号, @类别, @楼层, @单价, @可住人数, @已住人数, @说明)"
ProviderName="<%$ ConnectionStrings:MyHotelDBConnectionString.ProviderName %>"
SelectCommand="SELECT [房号], [类别], [楼层], [单价], [可住人数], [已住人数], [说明] FROM [酒店房间]"
UpdateCommand="UPDATE [酒店房间] SET [类别] = @类别, [楼层] = @楼层, [单价] = @单价, [可住人数] = @可住人数, [已住人数] = @已住人数, [说明] = @说明 WHERE [房号] = @房号">
<InsertParameters>
<asp:ControlParameter ControlID="TextBox1" Name="房号" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="DropDownList1" Name="类别" PropertyName="SelectedValue"
Type="String" />
<asp:ControlParameter ControlID="TextBox2" Name="楼层" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox3" Name="单价" PropertyName="Text" Type="Double" />
<asp:ControlParameter ControlID="TextBox4" Name="可住人数" PropertyName="Text" Type="Int32" />
<asp:ControlParameter ControlID="TextBox5" Name="已住人数" PropertyName="Text" Type="Int32" />
<asp:ControlParameter ControlID="TextBox6" Name="说明" PropertyName="Text" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="类别" PropertyName="SelectedValue"
Type="String" />
<asp:ControlParameter ControlID="TextBox2" Name="楼层" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox3" Name="单价" PropertyName="Text" Type="Double" />
<asp:ControlParameter ControlID="TextBox4" Name="可住人数" PropertyName="Text" Type="Int32" />
<asp:ControlParameter ControlID="TextBox5" Name="已住人数" PropertyName="Text" Type="Int32" />
<asp:ControlParameter ControlID="TextBox6" Name="说明" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox1" Name="房号" PropertyName="Text" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="房号" Type="String" />
</DeleteParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None"
BorderWidth="1px" CellPadding="3" DataKeyNames="房号" DataSourceID="SqlDataSource1"
EmptyDataText="没有可显示的数据记录。" Font-Names="宋体" Font-Size="Small" GridLines="Vertical"
Height="171px" Width="552px" OnRowCreated="GridView1_RowCreated" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" PageSize="8">
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<Columns>
<asp:CommandField ButtonType="Button" HeaderText="选择" ShowSelectButton="True" />
<asp:TemplateField HeaderText="删除" ShowHeader="False">
<ItemTemplate>
<asp:Button ID="Button1" runat="server" CausesValidation="False" CommandName="Delete"
Text="删除" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="房号" HeaderText="房号" ReadOnly="True" SortExpression="房号" />
<asp:BoundField DataField="类别" HeaderText="类别" SortExpression="类别" />
<asp:BoundField DataField="楼层" HeaderText="楼层" SortExpression="楼层" />
<asp:BoundField DataField="单价" HeaderText="单价" SortExpression="单价" />
<asp:BoundField DataField="可住人数" HeaderText="可住人数" SortExpression="可住人数" />
<asp:BoundField DataField="已住人数" HeaderText="已住人数" SortExpression="已住人数" />
<asp:BoundField DataField="说明" HeaderText="说明" SortExpression="说明" />
</Columns>
<RowStyle BackColor="#EEEEEE" ForeColor="Black" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />
<AlternatingRowStyle BackColor="Gainsboro" />
</asp:GridView>
</td>
</tr>
</table>
</asp:Content>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -