protected void Button1_Click(object sender, System.EventArgs e) { string txt_1 = ""; string txt_2 = ""; string txt_3 = ""; string txt_4 = ""; string txt_5 = ""; string downlist1 = ""; string downlist2 = ""; string downlist3 = ""; string downlist4 = ""; txt_1 = TextBox1.Text; txt_2 = TextBox2.Text; txt_3 = TextBox3.Text; txt_4 = TextBox4.Text; txt_5 = TextBox5.Text; downlist1 = DropDownList1.SelectedItem.Text; downlist2 = DropDownList2.SelectedItem.Text; downlist3 = DropDownList3.SelectedItem.Text; downlist4 = DropDownList4.SelectedItem.Text; string sqlcar = "update carmodel set 车辆类型='" + downlist4 + "',会员限制里程数目='" + txt_1 + "',会员租车押金=convert(money,'" + txt_2 + "'),会员超驶收费=convert(money,'" + txt_3 + "')," + downlist1 + "=convert(money,'" + txt_4 + "')," + downlist2 + "=convert(money,'" + txt_5 + "') where 车辆名称='" + downlist3 + "'"; DBClass db = new DBClass(sqlcar); db.returndr(); db.dbClose(); Response.Redirect("vippricemodify.aspx"); }
protected void Button1_Click(object sender, System.EventArgs e) { string txt_1 = TextBox1.Text; string sql = "select * from carinfo where 序号='" + txt_1 + "'"; DBClass db = new DBClass(sql); SqlDataReader dr = db.returndr(); if (dr.Read()) { TextBox2.Text = dr["序号"].ToString(); TextBox3.Text = dr["车牌号"].ToString(); TextBox4.Text = dr["防盗器号"].ToString(); TextBox5.Text = dr["保险号"].ToString(); TextBox6.Text = dr["保险开始时间"].ToString(); TextBox7.Text = dr["保险结束时间"].ToString(); TextBox8.Text = dr["车架号"].ToString(); TextBox9.Text = dr["公里数"].ToString(); TextBox10.Text = dr["发动机号"].ToString(); TextBox11.Text = dr["开始记录时间"].ToString(); TextBox12.Text = dr["记录时间"].ToString(); TextBox13.Text = dr["备注"].ToString(); DropDownList1.SelectedItem.Text = dr["车辆名称"].ToString(); DropDownList2.SelectedItem.Text = dr["车辆类型"].ToString(); DropDownList3.SelectedItem.Text = dr["车辆状态"].ToString(); DropDownList4.SelectedItem.Text = dr["车辆颜色"].ToString(); DropDownList5.SelectedItem.Text = dr["业务部编号"].ToString(); DropDownList6.SelectedItem.Text = dr["保险类型"].ToString(); DropDownList7.SelectedItem.Text = dr["保险公司"].ToString(); DropDownList8.SelectedItem.Text = dr["是否有效"].ToString(); DropDownList9.SelectedItem.Text = dr["油类型"].ToString(); } dr.Close(); db.dbClose(); }
protected void Button3_Click(object sender, System.EventArgs e) { string txt_1 = ""; string txt_3 = ""; string txt_5 = ""; string txt_6 = ""; string txt_7 = ""; string txt_8 = ""; string txt_9 = ""; string txt_10 = ""; string txt_11 = ""; string txt_12 = ""; string txt_13 = ""; string downlist1 = ""; string downlist2 = ""; string downlist3 = ""; string downlist4 = ""; string downlist5 = ""; string downlist6 = ""; string downlist7 = ""; string downlist8 = ""; string downlist9 = ""; txt_1 = TextBox1.Text; txt_3 = TextBox3.Text; txt_5 = TextBox5.Text; txt_6 = TextBox6.Text; txt_7 = TextBox7.Text; txt_8 = TextBox8.Text; txt_9 = TextBox9.Text; txt_10 = TextBox10.Text; txt_11 = TextBox11.Text; txt_12 = TextBox12.Text; txt_13 = TextBox13.Text; downlist1 = DropDownList1.SelectedItem.Text; downlist2 = DropDownList2.SelectedItem.Text; downlist3 = DropDownList3.SelectedItem.Text; downlist4 = DropDownList4.SelectedItem.Text; downlist5 = DropDownList5.SelectedItem.Text; downlist6 = DropDownList6.SelectedItem.Text; downlist7 = DropDownList7.SelectedItem.Text; downlist8 = DropDownList8.SelectedItem.Text; downlist9 = DropDownList9.SelectedItem.Text; if (TextBox1.Text == "") { ErrorMsg.Text = "请填入车牌号! "; return; } string sql = "insert into carinfo(车牌号,车辆名称,公里数,是否有效,记录时间,备注,开始记录时间,发动机号,车架号,防盗器号,保险开始时间,保险结束时间,保险号,车辆类型,车辆颜色,车辆状态,业务部编号,保险类型,保险公司,油类型) values('" + txt_1 + "','" + downlist8 + "','" + txt_3 + "','" + downlist9 + "','" + txt_5 + "','" + txt_6 + "','" + txt_7 + "','" + txt_8 + "','" + txt_9 + "','" + txt_10 + "','" + txt_11 + "','" + txt_12 + "','" + txt_13 + "','" + downlist1 + "','" + downlist2 + "','" + downlist3 + "','" + downlist4 + "','" + downlist5 + "','" + downlist6 + "','" + downlist7 + "')"; DBClass db = new DBClass(sql); db.returndr(); db.dbClose(); Response.Redirect("photo.aspx"); }
protected void Button3_Click(object sender, System.EventArgs e) { string txt2 = TextBox2.Text; string sql = "delete from insurecompany where 保险公司序号='" + txt2 + "'"; DBClass db = new DBClass(sql); db.returndr(); db.dbClose(); Response.Redirect("addinsurecompany.aspx"); }
protected void Button1_Click(object sender, System.EventArgs e) { if (TextBox1.Text == "") { ErrorMsg.Text = "请输入保险公司名称!"; return; } string txt1 = TextBox1.Text; string sql = "insert into insurecompany(保险公司) values('" + txt1 + "')"; DBClass db = new DBClass(sql); db.returndr(); db.dbClose(); Response.Redirect("addinsurecompany.aspx"); }
protected void Button6_Click(object sender, System.EventArgs e) //查看照片 { string sql = "select * from carpicture where 车牌号='" + TextBox2.Text + "'"; DBClass db = new DBClass(sql); SqlDataReader dr = db.returndr(); if (dr.Read()) { TextBox1.Text = dr["照片描述"].ToString(); TextBox2.Text = dr["车牌号"].ToString(); Image1.ImageUrl = dr["车辆照片"].ToString(); Response.BinaryWrite((byte[])dr["车辆照片"]); //跳转,仍在photo中显示 } dr.Close(); db.dbClose(); }
protected void Button1_Click(object sender, System.EventArgs e) { string txt_1 = TextBox1.Text; string query = null; if (DropDownList1.SelectedIndex == 0) { query = "where 序号=" + "'" + txt_1 + "'"; } if (DropDownList1.SelectedIndex == 1) { query = "where 车牌号=" + "'" + txt_1 + "'"; } string sql = "delete from carinfo " + query; DBClass db = new DBClass(sql); db.returndr(); db.dbClose(); Response.Redirect("delete.aspx"); }
protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { string sqlstring = "SELECT * FROM cartype"; DBClass db = new DBClass(sqlstring); DropDownList4.DataSource = db.returndr(); DropDownList4.DataTextField = "车辆类型"; DropDownList4.DataValueField = "车辆类型"; DropDownList4.DataBind(); db.dbClose(); } if (!IsPostBack) { string sqlstring = "SELECT * FROM carname"; DBClass db = new DBClass(sqlstring); DropDownList3.DataSource = db.returndr(); DropDownList3.DataTextField = "车辆名称"; DropDownList3.DataValueField = "车辆名称"; DropDownList3.DataBind(); db.dbClose(); } // 在此处放置用户代码以初始化页面 }
protected void Button3_Click(object sender, System.EventArgs e) { string txt_2 = ""; string txt_3 = ""; string txt_4 = ""; string txt_5 = ""; string txt_6 = ""; string txt_7 = ""; string txt_8 = ""; string txt_9 = ""; string txt_10 = ""; string txt_11 = ""; string txt_12 = ""; string txt_13 = ""; string downlist1 = ""; string downlist2 = ""; string downlist3 = ""; string downlist4 = ""; string downlist5 = ""; string downlist6 = ""; string downlist7 = ""; string downlist8 = ""; string downlist9 = ""; txt_2 = TextBox2.Text; txt_3 = TextBox3.Text; txt_4 = TextBox4.Text; txt_5 = TextBox5.Text; txt_6 = TextBox6.Text; txt_7 = TextBox7.Text; txt_8 = TextBox8.Text; txt_9 = TextBox9.Text; txt_10 = TextBox10.Text; txt_11 = TextBox11.Text; txt_12 = TextBox12.Text; txt_13 = TextBox1.Text; downlist1 = DropDownList1.SelectedItem.Text; downlist2 = DropDownList2.SelectedItem.Text; downlist3 = DropDownList3.SelectedItem.Text; downlist4 = DropDownList4.SelectedItem.Text; downlist5 = DropDownList5.SelectedItem.Text; downlist6 = DropDownList6.SelectedItem.Text; downlist7 = DropDownList7.SelectedItem.Text; downlist8 = DropDownList8.SelectedItem.Text; downlist9 = DropDownList9.SelectedItem.Text; if (TextBox3.Text == "") { ErrorMsg.Text = "请填入车牌号! "; return; } if (TextBox9.Text == "") { ErrorMsg.Text = "请填入公里数!"; return; } string sqlcar = "update carinfo set 车牌号='" + txt_3 + "',车辆名称='" + downlist1 + "',车辆类型='" + downlist2 + "',车辆状态='" + downlist3 + "',车辆颜色='" + downlist4 + "',业务部编号='" + downlist5 + "',防盗器号='" + txt_4 + "',保险号='" + txt_5 + "',保险开始时间='" + txt_6 + "',保险结束时间='" + txt_7 + "',保险类型='" + downlist6 + "',保险公司='" + downlist7 + "',车架号='" + txt_8 + "',公里数='" + txt_9 + "',发动机号='" + txt_10 + "',是否有效='" + downlist8 + "',开始记录时间='" + txt_11 + "',记录时间='" + txt_12 + "',油类型='" + downlist9 + "' where 序号='" + txt_2 + "'"; DBClass db = new DBClass(sqlcar); db.returndr(); db.dbClose(); Response.Redirect("modify.aspx"); }
protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { BindGridToSource(); string sqlstring = "SELECT * FROM carname"; DBClass db = new DBClass(sqlstring); DropDownList1.DataSource = db.returndr(); DropDownList1.DataTextField = "车辆名称"; DropDownList1.DataValueField = "车辆名称"; DropDownList1.DataBind(); db.dbClose(); } if (!IsPostBack) { BindGridToSource(); string sqlstring = "SELECT * FROM cartype"; DBClass db = new DBClass(sqlstring); DropDownList2.DataSource = db.returndr(); DropDownList2.DataTextField = "车辆类型"; DropDownList2.DataValueField = "车辆类型"; DropDownList2.DataBind(); db.dbClose(); } if (!IsPostBack) { BindGridToSource(); string sqlstring = "SELECT * FROM state"; DBClass db = new DBClass(sqlstring); DropDownList3.DataSource = db.returndr(); DropDownList3.DataTextField = "车辆状态"; DropDownList3.DataValueField = "车辆状态"; DropDownList3.DataBind(); db.dbClose(); } if (!IsPostBack) { BindGridToSource(); string sqlstring = "SELECT * FROM carcolor"; DBClass db = new DBClass(sqlstring); DropDownList4.DataSource = db.returndr(); DropDownList4.DataTextField = "车辆颜色名"; DropDownList4.DataValueField = "车辆颜色名"; DropDownList4.DataBind(); db.dbClose(); } if (!IsPostBack) { BindGridToSource(); string sqlstring = "SELECT * FROM subpoint"; DBClass db = new DBClass(sqlstring); DropDownList5.DataSource = db.returndr(); DropDownList5.DataTextField = "业务部编号"; DropDownList5.DataValueField = "业务部编号"; DropDownList5.DataBind(); db.dbClose(); } if (!IsPostBack) { BindGridToSource(); string sqlstring = "SELECT * FROM insuretype"; DBClass db = new DBClass(sqlstring); DropDownList6.DataSource = db.returndr(); DropDownList6.DataTextField = "保险类型"; DropDownList6.DataValueField = "保险类型"; DropDownList6.DataBind(); db.dbClose(); } if (!IsPostBack) { BindGridToSource(); string sqlstring = "SELECT * FROM insurecompany"; DBClass db = new DBClass(sqlstring); DropDownList7.DataSource = db.returndr(); DropDownList7.DataTextField = "保险公司"; DropDownList7.DataValueField = "保险公司"; DropDownList7.DataBind(); db.dbClose(); } if (!IsPostBack) { BindGridToSource(); string sqlstring = "SELECT * FROM oiltype"; DBClass db = new DBClass(sqlstring); DropDownList9.DataSource = db.returndr(); DropDownList9.DataTextField = "油类型"; DropDownList9.DataValueField = "油类型"; DropDownList9.DataBind(); db.dbClose(); } // 在此处放置用户代码以初始化页面 }
protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { string sqlstring = "SELECT * FROM carname"; DBClass db = new DBClass(sqlstring); DropDownList8.DataSource = db.returndr(); DropDownList8.DataTextField = "车辆名称"; DropDownList8.DataValueField = "车辆名称"; DropDownList8.DataBind(); db.dbClose(); } if (!IsPostBack) { string sqlstring = "SELECT * FROM cartype"; DBClass db = new DBClass(sqlstring); DropDownList1.DataSource = db.returndr(); DropDownList1.DataTextField = "车辆类型"; DropDownList1.DataValueField = "车辆类型"; DropDownList1.DataBind(); db.dbClose(); } if (!IsPostBack) { string sqlstring = "SELECT * FROM state"; DBClass db = new DBClass(sqlstring); DropDownList3.DataSource = db.returndr(); DropDownList3.DataTextField = "车辆状态"; DropDownList3.DataValueField = "车辆状态"; DropDownList3.DataBind(); db.dbClose(); } if (!IsPostBack) { string sqlstring = "SELECT * FROM carcolor"; DBClass db = new DBClass(sqlstring); DropDownList2.DataSource = db.returndr(); DropDownList2.DataTextField = "车辆颜色名"; DropDownList2.DataValueField = "车辆颜色名"; DropDownList2.DataBind(); db.dbClose(); } if (!IsPostBack) { string sqlstring = "SELECT * FROM subpoint"; DBClass db = new DBClass(sqlstring); DropDownList4.DataSource = db.returndr(); DropDownList4.DataTextField = "业务部编号"; DropDownList4.DataValueField = "业务部编号"; DropDownList4.DataBind(); db.dbClose(); } if (!IsPostBack) { string sqlstring = "SELECT * FROM insuretype"; DBClass db = new DBClass(sqlstring); DropDownList5.DataSource = db.returndr(); DropDownList5.DataTextField = "保险类型"; DropDownList5.DataValueField = "保险类型"; DropDownList5.DataBind(); db.dbClose(); } if (!IsPostBack) { string sqlstring = "SELECT * FROM insurecompany"; DBClass db = new DBClass(sqlstring); DropDownList6.DataSource = db.returndr(); DropDownList6.DataTextField = "保险公司"; DropDownList6.DataValueField = "保险公司"; DropDownList6.DataBind(); db.dbClose(); } if (!IsPostBack) { string sqlstring = "SELECT * FROM oiltype"; DBClass db = new DBClass(sqlstring); DropDownList7.DataSource = db.returndr(); DropDownList7.DataTextField = "油类型"; DropDownList7.DataValueField = "油类型"; DropDownList7.DataBind(); db.dbClose(); } // 在此处放置用户代码以初始化页面 Button3.Attributes.Add("onclick", "javascript:return confirm('您确认要添加照片么?')"); }