Esempio n. 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmAddEditStaff frm = new frmAddEditStaff();

            DatabaseConnection.adding   = true;
            DatabaseConnection.updating = false;

            if (frm.ShowDialog() == DialogResult.Cancel)
            {
                loadData();
            }
        }
Esempio n. 2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (lvwStaff.SelectedItems.Count == 1)
     {
         frmAddEditStaff frm = new frmAddEditStaff();
         DatabaseConnection.adding   = false;
         DatabaseConnection.updating = true;
         frm.txtID.Text = lvwStaff.SelectedItems[0].SubItems[0].Text;
         frm.LoadUpdate();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             loadData();
         }
         FirstLoad();
     }
 }