private void buttonSelect_Click_1(object sender, EventArgs e) { this.Hide(); if (dataIssue.SelectedCells.Count < 0) { MessageBox.Show("A Issue must be selected.", "Attention"); } else { _selectedID = dataIssue.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = dataIssue.Rows[_selectedID]; int sID = Convert.ToInt32(selectedRow.Cells["ID"].Value); _selectedID = sID; FakeIssueRepository iss2 = new FakeIssueRepository(); Issue i2 = iss2.GetIssueByID(sID); DialogResult result = MessageBox.Show("Are you sure you want to Remove:" + i2.Title, "Confirmation", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { bool res = iss2.Remove(i2); this.Close(); } else { MessageBox.Show("Remove Canceled", "Attention", MessageBoxButtons.OK); } } }
private void FormModifyIssue_Load(object sender, EventArgs e) { this.CenterToParent(); List <IssueStatus> issueStatuses = fakeIssueStatus.GetAll(); foreach (IssueStatus i in issueStatuses) { comboBoxStatus.Items.Add(i.value); } comboBoxStatus.SelectedIndex = 0; FakeAppUserRepository fakeAppUserRepository = new FakeAppUserRepository(); List <AppUser> appUsers = fakeAppUserRepository.GetAll(); foreach (AppUser user in appUsers) { comboBoxDiscoverer.Items.Add(user.UserName); } Issue issue = fake.GetIssueByID(selected); textBox1.Text = issue.Id.ToString(); textBox2.Text = issue.Title; dateTimePicker1.Value = issue.DiscoveryDate; comboBoxDiscoverer.SelectedItem = issue.Discoverer; comboBoxStatus.SelectedIndex = issue.IssueStatusId; textBox3.Text = issue.Component; richTextBoxDescription.Text = issue.InitialDesscription; }
private void FormModifyIssue_Load(object sender, EventArgs e) { this.CenterToParent(); FakeIssueRepository iss = new FakeIssueRepository(); Issue i2 = iss.GetIssueByID(_selectID); modID.Text = Convert.ToString(i2.ID); modTitle.Text = i2.Title; modDateTime.Text = Convert.ToString(i2.DiscoveryDate); modDis.Text = i2.Discoverer; modComp.Text = i2.Component; modStatus.Text = Convert.ToString(i2.IssueStatusID); modDes.Text = i2.InitialDescription; }