private void button1_Click(object sender, EventArgs e) { if (combDepart.Text.Equals("") || txtName.Text.Equals("") || txtInfo.Text.Equals("")) { MessageBox.Show("Please complete the blank space !", "warning"); return; } else { Dictionary <string, string> dict = new Dictionary <string, string>(); dict.Add("teamname", txtName.Text); dict.Add("departname", combDepart.Text); dict.Add("teaminfo", txtInfo.Text); if (service.add(dict, "tabteams")) { MessageBox.Show("Save record ok !", "Add Team"); parent.resetTeamList(); this.Close(); } else { MessageBox.Show("Save record failed !", "Add Platform"); } } }
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", team.id, "tabteams")) { MessageBox.Show("Delete ok !", "delete team"); parent.resetTeamList(); } else { MessageBox.Show("Delete failed !", "delete team"); } } }