//系统部分代码如下: if (this.txtBJMC.Text.Trim() == "") { Page.ClientScript.RegisterStartupScript(this.GetType(), "info", ""); return; } //根据标志判断是添加还是修改的操作 保存商品信息 if (Request.QueryString["ID"] != null) { Database.Execute("UPDATE [班级] set [班级名称] ='" + txtBJMC.Text + "',[姓名] = '" + txtXM.Text + "',[性别] = '" + drXB.SelectedValue + "',[介绍] = '" + txtJS.Text + "' WHERE 班级代码=" + Request.QueryString["ID"]); } else { if (Database.GetData("select * from 班级 where 辅导员帐号='" + txtFDYZH.Text + "'").Rows.Count > 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "info", ""); return; } Database.Execute("INSERT INTO [班级] ([班级名称] ,[辅导员帐号] ,[密码] ,[姓名] ,[性别] ,[介绍] ) VALUES ('"+txtBJMC.Text +"','"+ txtFDYZH.Text +"','000000','"+ txtXM.Text +"','"+ drXB.SelectedValue +"','"+ txtJS.Text +"')"); } Page.ClientScript.RegisterStartupScript(this.GetType(), "info", ""); }
|