private void tb_delete_Click(object sender, EventArgs e) { if (MessageBox.Show("确定删除吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { clsMethed cf = new clsMethed(); clsMethedMethod cm = new clsMethedMethod(); cf.id = this.textBox1.Text.Trim().ToString(); if (cm.delete_table(cf)) { MessageBox.Show("ok"); } else { MessageBox.Show("error"); } this.fillTree(); } }
private void button2_Click(object sender, EventArgs e) { clsMethed cf = new clsMethed(); clsMethedMethod cfm = new clsMethedMethod(); cf.id = this.textBox1.Text.ToString(); cf.name = textBox2.Text.ToString(); cf.remark = richTextBox1.Text.ToString(); //上面是进行附值 if (M_Str_tempt == "add") { string strResult = cfm.insert_table(cf); if (strResult == "ok") { MessageBox.Show("ok"); } else { MessageBox.Show(strResult); } M_Str_tempt = string.Empty; } else if (M_Str_tempt == "update") { if (cfm.update_table(cf)) { MessageBox.Show("Ok"); } else { MessageBox.Show("Error"); } M_Str_tempt = string.Empty; } else { MessageBox.Show("请选取有效操作"); } this.fillTree(); }