private void userSubmitButton_Click(object sender, EventArgs e) { int codeDummy; if (!string.IsNullOrEmpty(userEnterErrorCodeBox.Text)) { if (!string.IsNullOrEmpty(userEnterVersionBox.Text)) { if (!string.IsNullOrEmpty(userEnterDescriptionBox.Text)) { if (int.TryParse(userEnterErrorCodeBox.Text, out codeDummy)) { UnverifiedReport reportDummy = new UnverifiedReport { error_code = codeDummy, software_version = userEnterVersionBox.Text, description = userEnterDescriptionBox.Text }; BugReportDatabase.UnverifiedReports.Add(reportDummy); BugReportDatabase.SaveChanges(); userNarrator.Text = "Your Report has been submitted. Thank you for your feedback"; } else { userNarrator.Text += Environment.NewLine + "Please Enter a valid integer for Error Code"; } } else { userNarrator.Text += Environment.NewLine + "Please Enter a Description"; } } else { userNarrator.Text += Environment.NewLine + "Please Enter a Software Version"; } } else { userNarrator.Text += Environment.NewLine + "Please Enter an Error Code"; } }
private void adminDeleteButton_Click(object sender, EventArgs e) { int codeDummy; if (!string.IsNullOrEmpty(adminEnterErrorCodeBox.Text)) { if (!string.IsNullOrEmpty(adminEnterVersionBox.Text)) { if (int.TryParse(adminEnterErrorCodeBox.Text, out codeDummy)) { UnverifiedReport x = (UnverifiedReport)from y in BugReportDatabase.UnverifiedReports where y.error_code == codeDummy && y.software_version.Equals(adminEnterVersionBox.Text, StringComparison.Ordinal) select y; if (x != null) { BugReportDatabase.UnverifiedReports.Remove(x); BugReportDatabase.SaveChanges(); adminNarrator.Text += Environment.NewLine + "Your report has been removed from Unverified."; } else { adminNarrator.Text = "That report does not exist."; } } else { adminNarrator.Text += Environment.NewLine + "Please enter a valid integer for Error Code."; } } else { adminNarrator.Text += Environment.NewLine + "Please Enter a software version."; } } else { adminNarrator.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; }