private void btnDelete_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("Are you sure that you would like to delete this frequent item?", "Delete Frequent Item", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { DataGridViewRow Row = grdMain.Rows[grdMain.SelectedRows[0].Index]; long UID = Convert.ToInt32(Row.Cells[0].Value); FrequentItem FrequentItem = Repository.Find <FrequentItem> (s => s.UID == UID) .FirstOrDefault(); Repository.Delete(FrequentItem); LoadGrid(PhishDataType.Undefined); } }
private void btnDelete_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("Are you sure that you would like to delete this rule?", "Delete Rule", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { DataGridViewRow Row = grdMain.Rows[grdMain.SelectedRows[0].Index]; long UID = Convert.ToInt32(Row.Cells[0].Value); IgnoreRule Config = Repository.Find <IgnoreRule> (s => s.UID == UID) .FirstOrDefault(); Repository.Delete(Config); LoadGrid(); } }