private void ModifyIssueButton_Click(object sender, EventArgs e) { if (IssueRepository.IsDuplicate(TitleBox.Text.Trim()) == true) { MessageBox.Show("Name must be unique!!", "Attention!!"); } else { int StatusOffset = 1; ModIssue.Title = TitleBox.Text; ModIssue.DiscoveryDate = DateTimePicker.Value; ModIssue.Discoverer = DiscovererComboBox.Text; ModIssue.Component = ComponentBox.Text; ModIssue.IssueStatusId = StatusComboBox.SelectedIndex + StatusOffset; ModIssue.InitialDescription = InitialDescription.Text; string result = IssueRepository.Modify(ModIssue); if ((result == FakeIssueRepository.NO_ERROR)) { MessageBox.Show("Modify Successful!!"); } else { MessageBox.Show("Error! " + result, "Requires your attention!"); } this.Close(); } }