protected void Button1_Click1(object sender, EventArgs e) { if (Convert.ToInt32(Request.QueryString["k"]) == 5) { //添加新数据 Daxu.Entity.area areainfo = new Daxu.Entity.area(); areainfo.name = TextBox1.Text.ToString().Trim(); areainfo.fenlei = Request.QueryString["id"].ToString(); Daxu.BLL.areaBll.InsertIArea(areainfo); Response.Redirect("/Admin/area/city/NextLM.aspx?id=502"); } else { //更新数据 Daxu.Entity.area areainfo = new Daxu.Entity.area(); areainfo.name = TextBox1.Text.ToString().Trim(); areainfo.id = Convert.ToInt32(Request.QueryString["id"]); Daxu.BLL.areaBll.UpdateIArea(areainfo); Response.Redirect("/Admin/area/city/NextLM.aspx?id=502"); } }
protected void Button1_Click1(object sender, EventArgs e) { if (HiddenField1.Value == "0") { //添加新数据 Daxu.Entity.area areainfo = new Daxu.Entity.area(); areainfo.name = TextBox1.Text.ToString(); areainfo.fenlei = "0"; Daxu.BLL.areaBll.InsertIArea(areainfo); Response.Redirect("lanmu.aspx"); } else { //更新数据 Daxu.Entity.area areainfo = new Daxu.Entity.area(); areainfo.name = TextBox1.Text.ToString(); areainfo.fenlei = "0"; areainfo.id = Convert.ToInt32(Request.QueryString["id"]); Daxu.BLL.areaBll.UpdateIArea(areainfo); Response.Redirect("lanmu.aspx"); } }