Example #1
0
 private void tabelDGV_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex == -1)
     {
         return;
     }
     if (e.ColumnIndex == -1)
     {
         return;
     }
     if (e.ColumnIndex == 0 && e.RowIndex > -1)
     {
         DialogResult dr = MessageBox.Show("Are you Sure you want to delete this record", "Warrning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
         if (dr == System.Windows.Forms.DialogResult.Yes)
         {
             int         id     = (int)tabelDGV.Rows[e.RowIndex].Cells["Id"].Value;
             Entity.Rule result = sysetm.FindRule(id);
             if (result == null)
             {
                 MessageBox.Show("An error has occure the item not found!");
                 return;
             }
             sysetm.Rules.Remove(result);
             fillRulesTable();
         }
     }
 }
Example #2
0
 private void newBtn_Click(object sender, EventArgs e)
 {
     saveBtn.Enabled = cancelBtn.Enabled = true;
     rule            = new Entity.Rule();
     clearForm();
     activateForm(true);
 }
Example #3
0
 private void cancelBtn_Click(object sender, EventArgs e)
 {
     rule = null;
     clearForm();
     activateForm(false);
 }