📄 addpark.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class admin_Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Convert.ToString(Session["UID"]) == "")
{
Response.Redirect("login.aspx");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
BaseClass bcc = new BaseClass();
string valsql = "select count(*) from basepark where Name='" + TextBox1.Text.Trim() + "'";
int count = (int)bcc.ExecCscalar(valsql);
if (count > 0)
{
Response.Write("<script>alert('已存在停车场:"+TextBox1.Text+"');</script>");
return;
}
string sqlstr = "insert into basepark (Name,amount,Memo)values('" + TextBox1.Text + "'," + TextBox2.Text + ",'" + TextBox6.Text + "')";
//Response.Write(sqlstr);
//Response.End();
if (bcc.ExecSql(sqlstr))
{
Response.Write("<script language=javascript>alert('添加停车场成功!');location='park.aspx'</script>");
}
else
{
Response.Write("<script>alert('添加失败,请重试!');</script>");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -