//保存 protected void btnSubmit_Click(object sender, EventArgs e) { bool flag = false; HyDept HyDept = new HyDept(); HyDept.hy_deptAdd = this.txtJgdz.Text; HyDept.hy_deptDetail = this.txtOrgDesc.Text; HyDept.hy_deptid = this.txtOrgId.Text; HyDept.hy_deptname = this.txtOrgName.Text; HyDept.hy_deptsort = 1; HyDept.hy_isenabled = this.dr_isenabled.SelectedValue; HyDept.hy_fzr = this.txtFuzheMan.Text; HyDept.hy_fzrphone = this.txtFuzheTel.Text; if (this.txtop.Value == "add") { flag = HyDept.insert(); } else if (this.txtop.Value == "modify") { flag = HyDept.Update(); } if (flag) { Response.Write("<script>alert('保存成功!');window.location='OrgList.aspx?rend=" + System.Guid.NewGuid().ToString() + "';</script>"); } else { Response.Write("<script>alert('保存失败,请联系管理员!');window.location='OrgList.aspx?rend=" + System.Guid.NewGuid().ToString() + "';</script>"); } }