private void devSubmitButton_Click(object sender, EventArgs e) { int codeDummy; if (!string.IsNullOrEmpty(devEnterErrorCodeBox.Text)) { if (!string.IsNullOrEmpty(devEnterVersionBox.Text)) { if (!string.IsNullOrEmpty(devEnterDescriptionBox.Text)) { if (!string.IsNullOrEmpty(devEnterSolutionBox.Text)) { if (int.TryParse(devEnterSolutionBox.Text, out codeDummy)) { SolvedReport reportDummy = new SolvedReport { error_code = codeDummy, software_version = devEnterVersionBox.Text, description = devEnterDescriptionBox.Text, solution = devEnterSolutionBox.Text }; BugReportDatabase.SolvedReports.Add(reportDummy); BugReportDatabase.SaveChanges(); devNarrator.Text = "Your Solved Report has been submitted."; } else { devNarrator.Text += Environment.NewLine + "Please Enter a valid integer for Error Code."; } } else { devNarrator.Text += Environment.NewLine + "Please enter a solution."; } } else { devNarrator.Text += Environment.NewLine + "Please enter a description."; } } else { devNarrator.Text += Environment.NewLine + "Please enter a software version."; } } else { devNarrator.Text += Environment.NewLine + "Please enter an Error Code."; } }
public Form1() { InitializeComponent(); BugReportDatabase = new KnowledgeBaseEntities(); solvedDummy = new SolvedReport(); unverDummy = new UnverifiedReport(); userBi = new BindingSource(); adminBi = new BindingSource(); devBi = new BindingSource(); BugReportDatabase.Administrators.Add(new Administrator { username = "******", password = "******" });//Eric, password1 BugReportDatabase.Developers.Add(new Developer { username = "******", password = "******" });//Justin, password2 BugReportDatabase.Keywords.Add(new Keyword { word = "AspectJ" });//AspectJ BugReportDatabase.Keywords.Add(new Keyword { word = "Eclipse" });//Eclipse BugReportDatabase.Keywords.Add(new Keyword { word = "exception" });//exception BugReportDatabase.Keywords.Add(new Keyword { word = "header" });//header BugReportDatabase.Keywords.Add(new Keyword { word = "headers" });//headers BugReportDatabase.Keywords.Add(new Keyword { word = "threads" });//threads BugReportDatabase.Keywords.Add(new Keyword { word = "thread" });//thread BugReportDatabase.Keywords.Add(new Keyword { word = "Thread" });//Thread BugReportDatabase.Keywords.Add(new Keyword { word = "Java" });//Java BugReportDatabase.Keywords.Add(new Keyword { word = "Stack" });//Stack BugReportDatabase.Keywords.Add(new Keyword { word = "contextMap" });//contextMap BugReportDatabase.Keywords.Add(new Keyword { word = "declares" });//declares BugReportDatabase.Keywords.Add(new Keyword { word = "hashcode()" });//hashcode() BugReportDatabase.Keywords.Add(new Keyword { word = "error" });//error BugReportDatabase.SolvedReports.Add(new SolvedReport { error_code = 407017, software_version = "1.1.1", description = "In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise.", solution = "Bug 407017 Stack trace being printed, but want to mute it." });//14,394535,contextMap,CompilationAndWeavingContext,Thread BugReportDatabase.SolvedReports.Add(new SolvedReport { error_code = 39993, software_version = "1.1.2", description = "When an AspectJ thread declares hashcode(), throws unknown exception", solution = "package-level abstract generic privileged aspect, which extends an abstract generic aspect, gives a IllegalStateException on a method call" }); BugReportDatabase.SaveChanges(); adminSearchButton.Enabled = false; adminSubmitButton.Enabled = false; adminDeleteButton.Enabled = false; devSearchButton.Enabled = false; devSubmitButton.Enabled = false; devDeleteButton.Enabled = false; }