private void button1_Click(object sender, EventArgs e) { XmlProcess xml = new XmlProcess(); DBProcess DB = new DBProcess(); if (TxtAddName.Text == "") { return; } if (xml.ItemCount(Type, TxtAddName.Text) == 0) { DB.AlterTableAdd("add", TxtAddName.Text); MessageBox.Show("该字段为首次添加"); } xml.AddItem(Type, TxtAddName.Text); TxtAddName.Text = ""; }
private void button1_Click(object sender, EventArgs e) { DBProcess DB = new DBProcess(); if (xml.ItemCount(Type, CboxDel.Text) == 1) { DB.AlterTableAdd("del", CboxDel.Text); MessageBox.Show("该字段已在表内删除"); } Control[] colLbl = new Control[1]; Control[] colCbo = new Control[1]; if ((colLbl = panel.Controls.Find("Lbl" + CboxDel.Text, false)).Count() > 0 && (colCbo = panel.Controls.Find(CboxDel.Text, false)).Count() > 0) { colLbl[0].Dispose(); colCbo[0].Dispose(); // MessageBox.Show("del find"); } xml.DelItem(Type, CboxDel.Text); CboxDel.Text = ""; }