Ejemplo n.º 1
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", depart.id, "tabdepartments"))
         {
             MessageBox.Show("Delete ok !", "delete department");
             parent.resetDepartList();
         }
         else
         {
             MessageBox.Show("Delete failed !", "delete department");
         }
     }
 }
Ejemplo n.º 2
0
        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("departmentname", txtName.Text.Trim());
            dict.Add("departmentinfo", txtInfo.Text.Trim());

            if (service.add(dict, "tabdepartments"))
            {
                MessageBox.Show("Save record ok !", "Add Department");
                parent.resetDepartList();
                this.Close();
            }
            else
            {
                MessageBox.Show("Save record failed !", "Add Department");
            }
        }