Exemplo n.º 1
0
        private void adminSubmitButton_Click(object sender, EventArgs e)
        {
            int codeDummy;

            if (!string.IsNullOrEmpty(adminEnterErrorCodeBox.Text))
            {
                if (!string.IsNullOrEmpty(adminEnterVersionBox.Text))
                {
                    if (!string.IsNullOrEmpty(adminEnterDescriptionBox.Text))
                    {
                        if (int.TryParse(adminEnterErrorCodeBox.Text, out codeDummy))
                        {
                            verifDummy = new VerifiedReport
                            {
                                error_code       = codeDummy,
                                software_version = adminEnterVersionBox.Text,
                                description      = adminEnterDescriptionBox.Text
                            };
                            BugReportDatabase.VerifiedReports.Add(verifDummy);
                            BugReportDatabase.SaveChanges();
                            adminNarrator.Text = "Your Verified Report has been submitted.";
                        }
                        else
                        {
                            adminNarrator.Text += Environment.NewLine + "Please enter a valid integer for Error Code.";
                        }
                    }
                    else
                    {
                        adminNarrator.Text += Environment.NewLine + "Please enter a description.";
                    }
                }
                else
                {
                    adminNarrator.Text += Environment.NewLine + "Please Enter a software version.";
                }
            }
            else
            {
                adminNarrator.Text += Environment.NewLine + "Please enter an error code.";
            }
        }
Exemplo n.º 2
0
        private void devDeleteButton_Click(object sender, EventArgs e)
        {
            int codeDummy;

            if (!string.IsNullOrEmpty(devEnterErrorCodeBox.Text))
            {
                if (!string.IsNullOrEmpty(devEnterVersionBox.Text))
                {
                    if (int.TryParse(devEnterErrorCodeBox.Text, out codeDummy))
                    {
                        VerifiedReport x = (VerifiedReport)from y in BugReportDatabase.VerifiedReports
                                           where y.error_code == codeDummy && y.software_version.Equals(devEnterVersionBox.Text, StringComparison.Ordinal)
                                           select y;
                        if (x != null)
                        {
                            BugReportDatabase.VerifiedReports.Remove(x);
                            BugReportDatabase.SaveChanges();
                            devNarrator.Text += Environment.NewLine + "Your report has been removed from Verified.";
                        }
                        else
                        {
                            devNarrator.Text = "That report does not exist";
                        }
                    }
                    else
                    {
                        devNarrator.Text += Environment.NewLine + "Please enter a valid integer for Error Code.";
                    }
                }
                else
                {
                    devNarrator.Text += Environment.NewLine + "Please enter a software version.";
                }
            }
            devNarrator.Text += Environment.NewLine + "Please enter an error code.";
        }