📄 jizhang.aspx
字号:
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<%@ Page language="c#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<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">
<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='"+TextBox1.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: 232px; POSITION: absolute; TOP: 80px" runat="server"
Height="32px" Width="88px">记帐系统</asp:label><asp:textbox id="TextBox2" style="Z-INDEX: 105; LEFT: 200px; POSITION: absolute; TOP: 184px"
runat="server" Height="32px" Width="120px"></asp:textbox><asp:textbox id="TextBox1" style="Z-INDEX: 102; LEFT: 200px; POSITION: absolute; TOP: 136px"
runat="server" Height="32px" Width="120px"></asp:textbox><asp:label id="Label2" style="Z-INDEX: 103; LEFT: 112px; POSITION: absolute; TOP: 144px" runat="server"
Height="24px" Width="80px">IC卡号</asp:label><asp:label id="Label3" style="Z-INDEX: 104; LEFT: 112px; POSITION: absolute; TOP: 184px" runat="server"
Height="32px" Width="72px">金额</asp:label><asp:button id="submit" style="Z-INDEX: 106; LEFT: 352px; POSITION: absolute; TOP: 184px" onclick="submit_Click"
runat="server" Height="40px" Width="96px" Text="提交"></asp:button></FONT>
<asp:button id="Button1" style="Z-INDEX: 108; LEFT: 456px; POSITION: absolute; TOP: 344px" onclick="submit_button1"
runat="server" Width="72px" Text="返回"></asp:button><asp:Label id="Message" runat="server" style="Z-INDEX: 107; LEFT: 344px; POSITION: absolute; TOP: 144px" /><asp:datagrid id="dg" runat="server" style="Z-INDEX: 109; LEFT: 272px; POSITION: absolute; TOP: 248px"></asp:datagrid>
<asp:Button id="submit1" OnClick="submit1_Click" style="Z-INDEX: 110; LEFT: 128px; POSITION: absolute; TOP: 248px"
runat="server" Width="112px" Height="48px" Text="帐务查询"></asp:Button>
</form>
</body>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -