Exemplo n.º 1
0
 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 {
     if (machineInstanceBindingSource.Current != null)
     {
         if (IsUser)
         {
             DialogResult dResult = UtilityClass.GetDeleteDialog("Machine Log Instance");
             if (dResult == DialogResult.Yes)
             {
                 if (ActionClass.DeleteMachieneInstance((MachineInstance)machineInstanceBindingSource.Current))
                 {
                     machineInstanceBindingSource.RemoveCurrent();
                     machinesBindingSource.DataSource = null;
                 }
             }
         }
         else
         {
             MessageBox.Show("You have are not permitted to perform this operation.", "Delete", MessageBoxButtons.OK,
                             MessageBoxIcon.Stop);
         }
     }
 }