Exemplo n.º 1
0
 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");
         }
     }
 }
Exemplo n.º 2
0
 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");
         }
     }
 }