예제 #1
0
 public void deleteMessageToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to delete this record?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         string MsgId = dataGrid.SelectedRows[0].Cells[0].Value.ToString();
         SystemMessage.DeleteRecord(FileName, MsgId);
         populateGridWithMessage(FileName);
     }
 }
예제 #2
0
 private void deleteRecordToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to delete this record?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         DataGridViewRow row;
         if (messageGrid.SelectedRows.Count != 0)
         {
             row = messageGrid.SelectedRows[0];
         }
         else
         {
             row = messageGridOld.SelectedRows[0];
         }
         string MsgId   = row.Cells[0].Value.ToString(),
                MsgDesc = row.Cells[1].Value.ToString();
         SystemMessage.DeleteRecord(FileName, MsgId, systemBackup);
         InitMessageGrid(FileName);
         Replace(MsgId, MsgDesc);
     }
 }