Exemplo n.º 1
0
 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 {
     if (IsUser)
     {
         if (leaveBindingSource != null)
         {
             DialogResult dResult = UtilityClass.GetDeleteDialog("Leave/O.B.");
             if (dResult == DialogResult.Yes)
             {
                 if (ActionClass.DeleteLeave((Leave)leaveBindingSource.Current))
                 {
                     MessageBox.Show("Record was successfully deleted.", "Delete", MessageBoxButtons.OK,
                                     MessageBoxIcon.Information);
                     leaveBindingSource.Remove(leaveBindingSource.Current);
                 }
             }
         }
     }
     else
     {
         MessageBox.Show("You have are not permitted to perform this operation.", "Delete", MessageBoxButtons.OK,
                         MessageBoxIcon.Stop);
     }
 }