⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yudingweidao.aspx

📁 这是一个酒店管理系统的C#语言实现.实现了住宿
💻 ASPX
字号:
<%@ Page Language="c#" CodeBehind="yudingweidao.aspx.cs" AutoEventWireup="false" Inherits="software.yudingweidao" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<body text="#ffffff" bgColor="#339933">
	<script runat="server">
private void submit_button1(object sender, System.EventArgs e)
	{
	Response.Redirect("WebForm2.aspx");
	}
 void submit_Click(Object sender,EventArgs e) { 
   SqlConnection Conn;
   Conn=new SqlConnection("server=HWADEE-1G30;database=HTserverData;uid=sa;pwd=''"); 
   Conn.Open();
   string sql="select * from YuYue, RmStatus where RoomSta='预定' and BookTime ='"+mytext.Text+"' and  YuYue.RoomNum=RmStatus.RoomNum ";
   SqlCommand Comm=new SqlCommand(sql,Conn);
   SqlDataReader dr=Comm.ExecuteReader();   
   dg.DataSource=dr;
   dg.DataBind();
  }
   
   void submit1_Click(Object sender,EventArgs e) { 
   SqlConnection Conn;
   Conn=new SqlConnection("server=HWADEE-1G30;database=HTserverData;uid=sa;pwd=''"); 
   Conn.Open();
   string sql="update RmStatus   set RoomSta='空闲' where RoomNum=(select RmStatus.RoomNum from RmStatus,YuYue where RoomSta='预定' and BookTime = '"+mytext.Text+"'and YuYue.RoomNum=RmStatus.RoomNum)";
   SqlCommand Comm=new SqlCommand(sql,Conn);
   Comm.ExecuteNonQuery();
   Response.Write("操作成功!");
}
void submit2_Click(Object sender,EventArgs e) { 
   SqlConnection Conn;
   Conn=new SqlConnection("server=HWADEE-1G30;database=HTserverData;uid=sa;pwd=''"); 
   Conn.Open();
   string sql="delete  from YuYue where BookTime = '"+mytext.Text+"'";
   SqlCommand Comm=new SqlCommand(sql,Conn);
   Comm.ExecuteNonQuery();
    Response.Write("操作成功!");
   }
	</script>
	<form id="Form1" name="myform" runat="server">
		<TABLE height="152" cellSpacing="0" cellPadding="0" width="489" border="0" ms_2d_layout="TRUE">
			<TR vAlign="top">
				<TD width="2" height="23"><FONT face="宋体"></FONT></TD>
				<TD width="205" height="23"><FONT face="宋体">请输入您要查询的日期</FONT></TD>
				<TD width="1" height="23"></TD>
				<TD width="134" height="55" rowSpan="3"></TD>
				<TD width="11" height="55" rowSpan="3"><asp:button id="submit" onclick="submit_Click" runat="server" Text="查询"></asp:button></TD>
				<TD width="41" height="55" rowSpan="3"></TD>
			</TR>
			<TR vAlign="top">
				<TD width="208" colSpan="3" height="8"><FONT face="宋体"></FONT></TD>
			</TR>
			<TR vAlign="top">
				<TD width="2" height="13"></TD>
				<TD height="31" rowSpan="2" width="205"><FONT face="宋体"><asp:textbox id="mytext" runat="server" Width="296px" size="50"></asp:textbox></FONT></TD>
				<TD width="1" height="13"></TD>
			</TR>
			<TR vAlign="top">
				<TD width="2" height="12"></TD>
				<TD width="135" colSpan="2" rowSpan="3"><asp:datagrid id="dg" runat="server"></asp:datagrid></TD>
				<TD colSpan="2" rowSpan="3">
					<P><asp:button id="submit1" onclick="submit1_Click" runat="server" Text="更新"></asp:button></P>
					<FONT face="宋体">
						<P>&nbsp;</P>
					</FONT>
					<P><asp:button id="submit2" onclick="submit2_Click" runat="server" Text="删除"></asp:button></P>
				</TD>
			</TR>
			<TR vAlign="top">
				<TD width="2" height="5"></TD>
				<TD height="5" width="205"><FONT face="宋体"></FONT></TD>
			</TR>
			<TR vAlign="top">
				<TD width="2" height="99"></TD>
				<TD width="205"><br>
				</TD>
			</TR>
			<br>
			<br>
		</TABLE>
		<FONT face="宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<asp:button id="Button1" onclick="submit_button1" runat="server" Width="56px" Text="返回" Height="32px"></asp:button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</FONT>
	</form>
</body>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -