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

📄 jiezhang.aspx

📁 这是一个酒店管理系统的C#语言实现.实现了住宿
💻 ASPX
字号:
<%@ Page language="c#"  %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>WebForm1</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<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();
	SqlCommand Comm=new SqlCommand("update CustCon set Con=Con-'"+TextBox2.Text+"' where CustIC=(select CustIC from CustCon where CustIC='"+TextBox1.Text+"');",Conn);
  
 
   try    {
      Comm.ExecuteNonQuery();
      Message.Text="结帐成功!";
       Message.Style["color"]="red";
 }
   catch (SqlException)   {
      Message.Text="结帐失败!";
      Message.Style["color"]="blue";
   }
	Conn.Close();
}
void submit1_Click(Object sender, EventArgs e) {
	SqlConnection Conn;
	Conn=new SqlConnection("server=HWADEE-1G30;database=HTserverData;uid=sa;pwd=''"); 
	Conn.Open();
	SqlCommand Comm=new SqlCommand("select * from CustCon where CustIC='"+TextBox3.Text+"';",Conn);
    SqlDataReader dr=Comm.ExecuteReader();   
   dg.DataSource=dr;
   dg.DataBind();
   Conn.Close();
  }
		</script>
	</HEAD>
	<body bgColor="#339933" MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<FONT face="宋体">
				<asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 248px; POSITION: absolute; TOP: 24px" runat="server"
					Width="88px" Height="32px">结帐系统</asp:Label>
				<asp:Button id="Button1" OnClick="submit_button1" style="Z-INDEX: 112; LEFT: 488px; POSITION: absolute; TOP: 242px"
					runat="server" Text="返回" Width="57px" Height="30px"></asp:Button>
				<asp:TextBox id="TextBox3" style="Z-INDEX: 111; LEFT: 208px; POSITION: absolute; TOP: 288px"
					runat="server" Height="32px" Width="120px"></asp:TextBox>
				<asp:Label id="Label4" style="Z-INDEX: 110; LEFT: 120px; POSITION: absolute; TOP: 296px" runat="server"
					Height="24px" Width="80px">IC卡号</asp:Label>
				<asp:TextBox id="TextBox2" style="Z-INDEX: 105; LEFT: 208px; POSITION: absolute; TOP: 152px"
					runat="server" Width="120px" Height="32px"></asp:TextBox>
				<asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 208px; POSITION: absolute; TOP: 88px" runat="server"
					Width="120px" Height="32px"></asp:TextBox>
				<asp:Label id="Label2" style="Z-INDEX: 103; LEFT: 112px; POSITION: absolute; TOP: 96px" runat="server"
					Width="80px" Height="24px">IC卡号</asp:Label>
				<asp:Label id="Label3" style="Z-INDEX: 104; LEFT: 120px; POSITION: absolute; TOP: 160px" runat="server"
					Width="72px" Height="32px">金额</asp:Label>
				<asp:Button id="submit" OnClick="submit_Click" style="Z-INDEX: 106; LEFT: 224px; POSITION: absolute; TOP: 216px"
					runat="server" Width="96px" Height="40px" Text="结帐"></asp:Button></FONT>
			<asp:DataGrid id="dg" runat="server" style="Z-INDEX: 108; LEFT: 352px; POSITION: absolute; TOP: 304px" /><asp:Label id="Message" runat="server" style="Z-INDEX: 107; LEFT: 344px; POSITION: absolute; TOP: 96px" />
			<asp:Button id="submit1" OnClick="submit1_Click" style="Z-INDEX: 109; LEFT: 216px; POSITION: absolute; TOP: 344px"
				runat="server" Height="42px" Width="104px" Text="帐务查询"></asp:Button>
		</form>
	</body>
</HTML>

⌨️ 快捷键说明

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