private void btDel_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure delete this record ?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (service.delete("id", level.id, "tabuserlevels")) { MessageBox.Show("Delete ok !", "delete level"); parent.resetLevList(); } else { MessageBox.Show("Delete failed !", "delete level"); } } }
private void button1_Click(object sender, EventArgs e) { if (txtName.Text == "" || txtInfo.Text == null) { MessageBox.Show("Complete the blank space !", "waraing"); return; } Dictionary <string, string> dict = new Dictionary <string, string>(); dict.Add("levelname", txtName.Text.Trim()); dict.Add("levelinfo", txtInfo.Text.Trim()); if (service.add(dict, "tabuserlevels")) { MessageBox.Show("Save record ok !", "Add Department"); parent.resetLevList(); this.Close(); } else { MessageBox.Show("Save record failed !", "Add Department"); } }