protected void Add1_Click(object sender, EventArgs e) { if (TextBox1.Text == "") { this.lblCheck.Text = "添加项为空!"; } else { FirstClassDm firstclassdm = new FirstClassDm(); GA gAdmin = new GA(); firstclassdm.FirstClassDmName = this.TextBox1.Text; if (gAdmin.FcIsRepeat(firstclassdm) == true) { if (gAdmin.AddClum(firstclassdm) > 0) { this.lblCheck.Text = "添加成功!"; //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "添加成功" + "');</script>"); } else { this.lblCheck.Text = "添加失败!"; //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "添加失败" + "');</script>"); } } else { this.lblCheck.Text = "添加项重复!"; //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "添加项重复" + "');</script>"); } } }
protected void Add3_Click(object sender, EventArgs e) { if (TextBox3.Text == "") { this.lblCheck.Text = "添加项为空!"; } else { SecondClassDm secondclassdm = new SecondClassDm(); ThirdClassDm thirdclassdm = new ThirdClassDm(); secondclassdm.SecondClassDmName = dlistSecondClumName.SelectedItem.Text; GA gAdmin = new GA(); secondclassdm.SecondClassDmID = gAdmin.ScNameGetID(secondclassdm); thirdclassdm.ThirdClassDmName = this.TextBox3.Text; if (gAdmin.TcIsRepeat(thirdclassdm) == true) { if (gAdmin.AddClum(thirdclassdm, secondclassdm) > 0) { this.lblCheck.Text = "添加成功!"; //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "添加成功" + "');</script>"); } else { this.lblCheck.Text = "添加失败!"; //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "添加失败" + "');</script>"); } } else { this.lblCheck.Text = "添加项重复!"; //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "添加项重复" + "');</script>"); } } }