以下是引用片段:
其主要代码实现过程如下: private void Button2_Click(object sender, System.EventArgs e) { if(Request.QueryString["ID"] !=null) { //修改当前的航班信息 DataBase.ExecSql("update hbxx set Hbid='"+ this.TextBox1.Text +"',jx='"+ this.Textbox2.Text +"',cfcs='"+ this.Textbox3.Text +"',ddcs='"+ this.Textbox4.Text +"',cfsj='"+ this.Textbox7.Text +"',ddsj='"+ this.Textbox8.Text +"',gsid="+ this.DropDownList1.SelectedValue +",bc='"+ this.Textbox5.Text +"',pjg="+ this.Textbox9.Text +" where xxid="+ Request.QueryString["ID"]); } else { //添加新的航班信息 DataBase.ExecSql("insert into hbxx(Hbid,jx,cfcs,ddcs,cfsj,ddsj,gsid,bc,pjg) values('"+ this.TextBox1.Text +"','"+ this.Textbox2.Text +"','"+ this.Textbox3.Text +"','"+ this.Textbox4.Text +"','"+ this.Textbox7.Text +"','"+ this.Textbox8.Text +"',"+ this.DropDownList1.SelectedValue +",'"+ this.Textbox5.Text +"',"+ this.Textbox9.Text +")"); } Response.Redirect("HbxxList.aspx"); } |