📄 selectroominfo.aspx
字号:
<%@ Page Language="C#" Debug="true"MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="SelectRoomInfo.aspx.cs" Inherits="SelectRoom" Title="无标题页" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style21
{
width: 100%;
}
.style28
{
width: 96px;
}
.style31
{
width: 110px;
}
.style34
{
width: 87px;
}
.style35
{
width: 88px;
}
.style36
{
width: 100px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:MultiView ID="MultiView3" runat="server" ActiveViewIndex="0">
<asp:View ID="View5" runat="server">
<table align="center" class="style21">
<tr>
<td align="right" class="style34">
房间类型:</td>
<td align="left" class="style28">
<asp:DropDownList ID="ddl" runat="server" DataSourceID="SqlDataSource2"
DataTextField="TypeName" DataValueField="TypeName">
</asp:DropDownList>
</td>
<td align="right" class="style35">
房间编号:</td>
<td align="left" class="style36">
<asp:TextBox ID="txtnumber" runat="server" Width="81px"></asp:TextBox>
</td>
<td class="style31">
<asp:LinkButton ID="LinkButton13" runat="server" ForeColor="Blue"
onclick="LinkButton13_Click">查询数据</asp:LinkButton>
</td>
<td class="style31">
<asp:LinkButton ID="LinkButton14" runat="server" ForeColor="Blue"
onclick="LinkButton14_Click">显示所有</asp:LinkButton>
</td>
</tr>
<tr>
<td align="right" class="style34">
</td>
<td align="left" class="style28">
</td>
<td align="right" class="style35">
</td>
<td align="left" class="style36">
</td>
<td class="style31">
</td>
<td>
</td>
</tr>
<tr>
<td colspan="6">
<asp:MultiView ID="MultiView4" runat="server">
<br />
<asp:View ID="View7" runat="server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" CellPadding="4" DataKeyNames="RoomID"
ForeColor="#333333" GridLines="None"
onpageindexchanging="GridView1_PageIndexChanging1"
onrowdatabound="GridView1_RowDataBound" onrowdeleting="GridView1_RowDeleting"
onselectedindexchanged="GridView1_SelectedIndexChanged1" PageSize="5"
SelectedIndex="0" Width="573px">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:BoundField DataField="RoomID" HeaderText="编号" Visible="False" />
<asp:BoundField DataField="Number" HeaderText="房间编号" SortExpression="Number" />
<asp:BoundField DataField="TypeName" HeaderText="房间类型"
SortExpression="TypeName" />
<asp:BoundField DataField="BedNumber" HeaderText="床位数"
SortExpression="BedNumber" />
<asp:BoundField DataField="State" HeaderText="客房状态" SortExpression="State" />
<asp:BoundField DataField="GuestNumber" HeaderText="入住人数"
SortExpression="GuestNumber" />
<asp:BoundField DataField="Description" HeaderText="客房描述"
SortExpression="Description" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Select"
ForeColor="Blue" Text="编辑"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton2" runat="server" CommandName="Delete"
ForeColor="Blue" onclientclick="return confirm('是否删除?');">删除</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton11" runat="server" CommandName="select"
ForeColor="Blue">详细</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<EmptyDataTemplate>
<asp:Label ID="Label1" runat="server" Text="没有查询到数据!"></asp:Label>
</EmptyDataTemplate>
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</asp:View>
<br />
<asp:View ID="View8" runat="server">
<asp:GridView ID="GridView2" runat="server" AllowPaging="True"
AutoGenerateColumns="False" CellPadding="4" DataKeyNames="RoomID"
ForeColor="#333333" GridLines="None"
onpageindexchanging="GridView2_PageIndexChanging"
onrowdatabound="GridView2_RowDataBound" onrowdeleting="GridView2_RowDeleting"
onselectedindexchanged="GridView2_SelectedIndexChanged" PageSize="5"
SelectedIndex="0" Width="573px">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:BoundField DataField="RoomID" HeaderText="编号" Visible="False" />
<asp:BoundField DataField="Number" HeaderText="房间编号" SortExpression="Number" />
<asp:BoundField DataField="TypeName" HeaderText="房间类型"
SortExpression="TypeName" />
<asp:BoundField DataField="BedNumber" HeaderText="床位数"
SortExpression="BedNumber" />
<asp:BoundField DataField="State" HeaderText="客房状态" SortExpression="State" />
<asp:BoundField DataField="GuestNumber" HeaderText="入住人数"
SortExpression="GuestNumber" />
<asp:BoundField DataField="Description" HeaderText="客房描述"
SortExpression="Description" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton3" runat="server" CommandName="Select"
ForeColor="Blue" Text="编辑"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton4" runat="server" CommandName="Delete"
ForeColor="Blue" onclientclick="return confirm('是否删除?');">删除</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton12" runat="server" CommandName="select"
ForeColor="Blue">详细</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<EmptyDataTemplate>
<asp:Label ID="Label2" runat="server" Text="没有查询到数据!"></asp:Label>
</EmptyDataTemplate>
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</asp:View>
</asp:MultiView>
</td>
</tr>
</table>
</asp:View>
</asp:MultiView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="Data Source=.\Sql2005;Initial Catalog=Hotel;User ID=sa;pwd=sa"
SelectCommand="SELECT [TypeName] FROM [RoomType]"></asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -