예제 #1
0
 public static void DeleteCellClickEvent(DataTier db, DataGridView dgv, int rowIndex, int columnIndex)
 {
     if (rowIndex >= 0 && columnIndex >= 0 && !dgv.Rows[rowIndex].IsNewRow &&
         dgv.Rows[rowIndex].Cells[columnIndex].OwningColumn == dgv.Columns["Delete"])
     {
         DialogResult dlg = MessageBox.Show(Messages.event_confirm_delete, Messages.application_confirm,
                                            MessageBoxButtons.OKCancel,
                                            MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
         if (dlg == DialogResult.OK)
         {
             db.RemoveEvent((int)dgv.Rows[rowIndex].Cells["Id"].Value);
             db.LoadDataEvent(dgv);
         }
     }
 }
예제 #2
0
 void f_RecordAdded(object sender, EventArgs e)
 {
     db.LoadDataEvent(dataGridView1);
 }
예제 #3
0
 private void FormEvent_Load(object sender, EventArgs e)
 {
     Util.SetupGrid(dataGridView1);
     db = new DataTier(Util.GetCountyId());
     db.LoadDataEvent(dataGridView1);
 }
예제 #4
0
 public static void DeleteCellClickEvent(DataTier db, DataGridView dgv, int rowIndex, int columnIndex)
 {
     if (rowIndex >= 0 && columnIndex >= 0 && !dgv.Rows[rowIndex].IsNewRow &&
         dgv.Rows[rowIndex].Cells[columnIndex].OwningColumn == dgv.Columns["Delete"])
     {
         DialogResult dlg = MessageBox.Show(Messages.event_confirm_delete, Messages.application_confirm,
             MessageBoxButtons.OKCancel,
             MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
         if (dlg == DialogResult.OK)
         {
             db.RemoveEvent((int)dgv.Rows[rowIndex].Cells["Id"].Value);
             db.LoadDataEvent(dgv);
         }
     }
 }
예제 #5
0
 private void FormEvent_Load(object sender, EventArgs e)
 {
     Util.SetupGrid(dataGridView1);
     db = new DataTier(Util.GetCountyId());
     db.LoadDataEvent(dataGridView1);
 }