📄 sankeyuding.aspx
字号:
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<%@ Page Language="c#" CodeBehind="sankeyuding.aspx.cs" AutoEventWireup="false" Inherits="software.sankeyuding" %>
<HTML>
<HEAD>
<title>sankeyuding</title>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<script runat="server">
private void 查询_Click(object sender, System.EventArgs e)
{
SqlConnection Conn=new SqlConnection();
Conn.ConnectionString="server=HWADEE-1G30;database=HTserverData;uid=sa;pwd=''";
Conn.Open();
SqlCommand Comm=new SqlCommand("select * from RoomInfo where RoomType='1' and RoomSta='净'",Conn);
SqlDataReader dr=Comm.ExecuteReader();
dg.DataSource=dr;
dg.DataBind();
Conn.Close();
}
private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
private void dg_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
private void submit_button1(object sender, System.EventArgs e)
{
Response.Redirect("WebForm2.aspx");
}
private void TextBox2_TextChanged(object sender, System.EventArgs e)
{
}
private void Button1_Click(object sender, System.EventArgs e)
{
SqlConnection Conn=new SqlConnection();
Conn.ConnectionString="server=HWADEE-1G30;database=HTserverData;uid=sa;pwd=''";
Conn.Open();
String strSQL="insert into yuyue(CustName, CustID, CustSex ,CustIC,RoomNum,ArrTime,PreM) values ('"
+TextBox1.Text+"','"
+TextBox2.Text+"','"+DropDownList1.SelectedItem.Value+"','"+TextBox3.Text+"','"+TextBox4.Text+"','"+TextBox5.Text+"','"+TextBox6.Text+"')";
SqlCommand Comm=new SqlCommand(strSQL,Conn);
try {
Comm.ExecuteNonQuery();
Message.Text="登记成功!";
}
catch (SqlException) {
Message.Text="登记失败!";
}
Conn.Close();
}
</script>
<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">
</HEAD>
<body MS_POSITIONING="GridLayout" bgColor="#339933" text="#ffffff">
<form id="Form1" method="post" runat="server">
<FONT id="FONT1" face="宋体" runat="server">
<asp:label id="姓名" style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 80px" runat="server"
Height="28px" Width="40px">姓名</asp:label><asp:textbox id="TextBox1" style="Z-INDEX: 102; LEFT: 112px; POSITION: absolute; TOP: 80px" runat="server"
Height="26px" Width="104px"></asp:textbox><asp:button id="查询" OnClick="查询_Click" style="Z-INDEX: 103; LEFT: 480px; POSITION: absolute; TOP: 72px"
runat="server" Height="48px" Width="96px" Text="查询空房"></asp:button><asp:label id="空房信息表" style="Z-INDEX: 104; LEFT: 488px; POSITION: absolute; TOP: 128px" runat="server"
Height="40px" Width="144px"> 空房信息表</asp:label><asp:datagrid id="dg" style="Z-INDEX: 105; LEFT: 480px; POSITION: absolute; TOP: 152px" runat="server"></asp:datagrid><asp:label id="身份证号码" style="Z-INDEX: 106; LEFT: 24px; POSITION: absolute; TOP: 112px" runat="server"
Height="32px" Width="80px">身份证号码</asp:label><asp:textbox id="TextBox2" style="Z-INDEX: 107; LEFT: 112px; POSITION: absolute; TOP: 112px"
runat="server" Height="24px" Width="200px"></asp:textbox><asp:label id="性别" style="Z-INDEX: 108; LEFT: 24px; POSITION: absolute; TOP: 144px" runat="server"
Height="32px" Width="56px">性别</asp:label><asp:dropdownlist id="DropDownList1" style="Z-INDEX: 109; LEFT: 112px; POSITION: absolute; TOP: 144px"
runat="server" Height="24px" Width="56px">
<asp:ListItem Value="男" Selected="True">男</asp:ListItem>
<asp:ListItem Value="女">女</asp:ListItem>
</asp:dropdownlist><asp:label id="IC卡号" style="Z-INDEX: 110; LEFT: 24px; POSITION: absolute; TOP: 176px" runat="server"
Height="24px" Width="56px">IC卡号</asp:label><asp:textbox id="TextBox3" style="Z-INDEX: 111; LEFT: 112px; POSITION: absolute; TOP: 168px"
runat="server" Height="26px" Width="200px"></asp:textbox><asp:label id="房间号" style="Z-INDEX: 112; LEFT: 24px; POSITION: absolute; TOP: 208px" runat="server"
Height="24px" Width="56px">房间号</asp:label><asp:textbox id="TextBox4" style="Z-INDEX: 113; LEFT: 112px; POSITION: absolute; TOP: 200px"
runat="server" Height="32px" Width="80px"></asp:textbox><asp:label id="入住时间" style="Z-INDEX: 114; LEFT: 24px; POSITION: absolute; TOP: 248px" runat="server"
Height="24px" Width="72px">入住时间</asp:label><asp:textbox id="TextBox5" style="Z-INDEX: 115; LEFT: 112px; POSITION: absolute; TOP: 240px"
runat="server" Height="34px" Width="120px"></asp:textbox><asp:label id="已交押金" style="Z-INDEX: 116; LEFT: 24px; POSITION: absolute; TOP: 288px" runat="server"
Height="24px" Width="72px">已交押金</asp:label><asp:textbox id="TextBox6" style="Z-INDEX: 117; LEFT: 112px; POSITION: absolute; TOP: 280px"
runat="server" Height="32px" Width="88px"></asp:textbox><asp:label id="无双酒店预定登记管理系统" style="Z-INDEX: 118; LEFT: 24px; POSITION: absolute; TOP: 16px"
runat="server" Height="40px" Width="592px" Font-Names="Arial" Font-Underline="True" Font-Size="X-Large" Font-Overline="True" Font-Bold="True" ForeColor="Red"
BorderColor="#FF80FF" BackColor="White"> 无 双 酒 店 预 定 登 记 管 理 系 统</asp:label><asp:button id="确定" OnClick="Button1_Click" style="Z-INDEX: 119; LEFT: 248px; POSITION: absolute; TOP: 328px"
runat="server" Height="24px" Width="64px" Text="确定"></asp:button><asp:label id="Message" style="Z-INDEX: 120; LEFT: 24px; POSITION: absolute; TOP: 328px" runat="server"
Height="24px" Width="112px"></asp:label>
<asp:RegularExpressionValidator id="RegularExpressionValidator1" style="Z-INDEX: 121; LEFT: 320px; POSITION: absolute; TOP: 112px"
runat="server" Height="24px" Width="160px" ErrorMessage="身份证号不存在" ControlToValidate="TextBox2" ValidationExpression="[0-9]{0,18}"
Display="Dynamic"></asp:RegularExpressionValidator>
<asp:RegularExpressionValidator id="RegularExpressionValidator3" style="Z-INDEX: 123; LEFT: 320px; POSITION: absolute; TOP: 168px"
runat="server" Height="32px" Width="120px" ErrorMessage="输入错误" ControlToValidate="TextBox3" ValidationExpression="[0-9]{0,3}"
Display="Dynamic"></asp:RegularExpressionValidator>
<asp:RegularExpressionValidator id="RegularExpressionValidator4" style="Z-INDEX: 124; LEFT: 200px; POSITION: absolute; TOP: 208px"
runat="server" Height="24px" Width="120px" ErrorMessage="房间不存在" ControlToValidate="TextBox4" ValidationExpression="[0-9]{3,5}"
Display="Dynamic"></asp:RegularExpressionValidator>
<asp:Label id="Label1" style="Z-INDEX: 125; LEFT: 240px; POSITION: absolute; TOP: 248px" runat="server"
Height="32px" Width="128px">如:2008-08-08</asp:Label>
<asp:RegularExpressionValidator id="RegularExpressionValidator5" style="Z-INDEX: 126; LEFT: 256px; POSITION: absolute; TOP: 288px"
runat="server" Height="32px" Width="120px" ErrorMessage="输入错误" ControlToValidate="TextBox6" ValidationExpression="[0-9]{0,5}"
Display="Dynamic"></asp:RegularExpressionValidator>
<asp:Label id="Label2" style="Z-INDEX: 127; LEFT: 200px; POSITION: absolute; TOP: 280px" runat="server"
Height="24px" Width="24px" Font-Size="Large">元</asp:Label>
<asp:Button id="Button1" OnClick="submit_button1" style="Z-INDEX: 128; LEFT: 544px; POSITION: absolute; TOP: 344px"
runat="server" Width="80px" Height="24px" Text="返回"></asp:Button></FONT></form>
</body>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -