内容发布更新时间 : 2024/12/23 21:07:01星期一 下面是文章的全部内容请认真阅读。
图5.3管理员登陆页面
管理员登陆页面的部分代码为:
public partial class denglu : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) {
if (!this.IsPostBack) }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) {
SqlConnection con = DB.createDB(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; con.Open();
cmd.CommandText = \count(*) from tb_zhuce where name='\+ this.txtworkname.Text + \+ \
Session[\ Session[\
int a = Convert.ToInt32(cmd.ExecuteScalar()); // if (a > 0) {
Response.Redirect(\ } else {
Response.Write(\很遗憾,用户名或密码错误!');\ }
con.Close();
}
5.4 车辆管理页面的设计与实现
随着社会的发展,车辆的数量在现在人们生活中日益增加,作为一个现代化管理的小区,重中之重需要把小区内的车位管理好,车辆管理主界面主要包含以下信息内容,界面视图如图5.4所示:
图5.4车辆管理页面图
车辆管理页面的部分代码为:
protected void Button1_Click(object sender, EventArgs e) {
SqlConnection con = DB.createDB(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; con.Open();
cmd.CommandText = \into tb_homePark values('\+ this.txtCph.Text + \+ this.txtTcch.Text + \+ this.txtEtime.Text + \+ this.txtTcglf.Text + \+ this.txtjsr.Text + \+ this.ddlsjqk.SelectedItem.Text.ToString() + \
cmd.ExecuteNonQuery();
Response.Write(\language=javascript>alert('恭喜您,信息添加成功!');\
con.Close(); this.aa(); }
protected void Button2_Click(object sender, EventArgs e) {
SqlConnection con = DB.createDB(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; con.Open();
cmd.CommandText = \ cmd.ExecuteNonQuery();
Response.Write(\恭喜您,信息删除成功!');\ con.Close(); this.aa(); }
protected void Button4_Click(object sender, EventArgs e) {
SqlConnection con = DB.createDB();
SqlCommand cmd = new SqlCommand(); cmd.Connection = con; con.Open();
cmd.CommandText = \tb_homePark set placeID='\+ this.txtTcch.Text + \+ this.txtCz.Text + \+ this.txtTcdd.Text + \+ this.txtstime.Text + \+ this.txtEtime.Text + \+ this.txtTcglf.Text + \+ this.txtjsr.Text + \+ this.ddlsjqk.SelectedItem.Text + \+ this.txtBz.Text + \ cmd.ExecuteNonQuery();
Response.Write(\language=javascript>alert('恭喜您,信息修改成功!');\
con.Close(); this.aa(); }
int i=Convert.ToInt32(cmd.ExecuteScalar()); if (i > 0) {
this.txtCph.Text = \ this.txtCph.Focus();
Response.Write(\车牌号存在,请在添加一个!');location='javascript:history.go(-1)'\ }
if(i < 1) {
Response.Write(\车牌号不存在,您可以继续填写!');location='javascript:history.go(-1)'\ }
con.Close(); }
protected void gvcl_RowDataBound(object sender, GridViewRowEventArgs e) {
if (e.Row.RowType == DataControlRowType.DataRow) {
e.Row.Attributes.Add(\
\
e.Row.Attributes.Add(\ if (e.Row.Cells[8].Text == \已缴纳\ {
e.Row.Cells[8].Text = \已缴纳\ } }
protected void Calendar2_SelectionChanged(object sender, EventArgs e) {
this.txtstime.Text=this.CalStime.SelectedDate.ToShortDateString(); }
protected void Button2_Click1(object sender, EventArgs e) {
this.CalStime.Visible = true; this.txtstime.Enabled = true; }
protected void Button3_Click1(object sender, EventArgs e) {
this.Calendar2.Visible = true; this.txtEtime.Enabled = true; }
protected void Calendar2_SelectionChanged1(object sender, EventArgs e) {
this.txtEtime.Text = this.CalStime.SelectedDate.ToShortDateString(); }
protected void btnSelect_Click(object sender, EventArgs e) {
Response.Redirect(\ }
protected void gvcl_SelectedIndexChanged1(object sender, EventArgs e) protected void Button4_Click1(object sender, EventArgs e)
{ } }