/// <summary> /// 确定提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { model = GetModel(); if (_Pid != "SysError") { if (!_Pid.Equals(model.area_id)) { bll.UpdateId(model.area_id, _Pid); //先更新编号 } if (bll.Update(model)) { adohelper.ExecuteSqlNonQuery("update T_Base_Area set ishot=" + (this.cbHot.Checked ? "1" : "0") + " where area_id='" + model.area_id + "'"); this.ClientScript.RegisterStartupScript(this.GetType(), "close", "<script>alert('修改成功');layer_close_refresh();</script>"); } } else { model.area_id = IdCreator.CreateId("T_Base_Area", "area_id"); if (bll.Add(model)) { adohelper.ExecuteSqlNonQuery("update T_Base_Area set ishot=" + (this.cbHot.Checked ? "1" : "0") + " where area_id='" + model.area_id + "'"); JSUtility.AlertAndRedirect("添加成功,请继续添加!", Request.RawUrl.ToString()); } } }