private void buttonSelectIssue_Click(object sender, EventArgs e) { targetId = Int32.Parse(dataGrid.CurrentRow.Cells[0].Value.ToString()); if (targetId != 0) { if (action == "Modify") { FormIssueModify form = new FormIssueModify(targetId); form.ShowDialog(); dataGrid.Rows.Clear(); FillGrid(); } if (action == "Remove") { if (MessageBox.Show("Are you sure you want to remove: " + _FakeIssueRepository.GetIssueById(targetId).Title, "Confirmation", MessageBoxButtons.YesNo) == DialogResult.Yes) { _FakeIssueRepository.Remove(_FakeIssueRepository.GetIssueById(targetId)); dataGrid.Rows.Clear(); FillGrid(); } else { MessageBox.Show("Remove cancelled.", "Attention"); Close(); } } } }
public FormIssueModify(int Id) { InitializeComponent(); this.IssueToModify = _FakeIssueRepository.GetIssueById(Id); }