Example #1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            BugClass bc = new BugClass();

            if (ddlSearchType.SelectedValue == "Assignee")
            {
                Repeater1.DataSource = bc.getBugsByAssignee(txtSearch.Text);
                lblError.Text        = "";
            }
            else if (ddlSearchType.SelectedValue == "Keywords")
            {
                Repeater1.DataSource = bc.getBugsByKeywords(txtSearch.Text);
                lblError.Text        = "";
            }
            else if (ddlSearchType.SelectedValue == "Title")
            {
                Repeater1.DataSource = bc.getBugsByTitle(txtSearch.Text);
                lblError.Text        = "";
            }
            else if (string.IsNullOrWhiteSpace(txtSearch.Text))
            {
                lblError.Text = "Type something to search on.";
            }
            else
            {
                lblError.Text = "Choose a type to search on.";
            }

            Repeater1.DataBind();
        }
        private void displayBugs()
        {
            BugClass bc = new BugClass();

            Repeater1.DataSource = bc.getBugsForReview();
            Repeater1.DataBind();
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string Month        = DateTime.Now.AddMonths(-1).ToString("MM");
            string Year         = DateTime.Now.ToString("yyyy");
            string currentMonth = Year + "-" + Month;

            string Month_word = DateTime.Now.AddMonths(-1).ToString("MMMM");
            string date       = DateTime.Now.StartOfWeek(DayOfWeek.Monday).ToString("yyyy-MM-dd h:mm tt");
            string dateEnd    = DateTime.Now.EndOfWeek(DayOfWeek.Monday).ToString("yyyy-MM-dd h:mm tt");

            BugClass bc = new BugClass();

            DataTable    reportw  = bc.countReportedWeekly();
            DataTable    reportm  = bc.countReportedMonthly();
            DataTable    resolvew = bc.countResolvedWeekly();
            DataTable    resolvem = bc.countResolvedMonthly();
            DataTable    commentw = bc.countComments();
            MySqlCommand reporter = bc.mostBugsReported();
            MySqlCommand dev      = bc.mostBugsFixed();

            NumOfBugsReportedWeekly.Text  = "Number of bugs reported last week: " + reportw.Rows.Count.ToString() + "   [" + date + "  TO  " + dateEnd + "]";
            NumOfBugsReportedMonthly.Text = "Number of bugs reported in " + Month_word + ": " + reportm.Rows.Count.ToString();
            NumOfBugsFixedWeekly.Text     = "Number of bugs fixed last week: " + resolvew.Rows.Count.ToString() + "   [" + date + "  TO  " + dateEnd + "]";;
            NumOfBugsFixedMonthly.Text    = "Number of bugs fixed in " + Month_word + ": " + resolvem.Rows.Count.ToString();
            NumOfComments.Text            = "Number of Comments last week: " + commentw.Rows.Count.ToString() + "   [" + date + "  TO  " + dateEnd + "]";
            BestReporter.Text             = "Best performing Reporter in " + Month_word + ": " + reporter.ExecuteScalar().ToString();
            BestDeveloper.Text            = "Best performing Developer in " + Month_word + ": " + dev.ExecuteScalar().ToString();
        }
        public void TestViewAllBugsDeveloper()
        {
            BugClass bc = new BugClass();

            bc.assignee = "Keith";
            Assert.AreNotEqual(bc.getAllBugsForDeveloper().Rows.Count, 0);
        }
Example #5
0
        protected void searchBugs(object sender, EventArgs e)
        {
            string username = Session["loginID"].ToString();

            BugClass bc = new BugClass();

            if (ddlSearchType.SelectedValue == "Assignee")
            {
                Repeater1.DataSource = bc.getBugsByAssigneeForTriager(txtSearch.Text);
                lblError.Text        = "";
            }
            else if (ddlSearchType.SelectedValue == "Keywords")
            {
                Repeater1.DataSource = bc.getBugsByKeywordsForTriager(txtSearch.Text);
                lblError.Text        = "";
            }
            else if (ddlSearchType.SelectedValue == "Title")
            {
                Repeater1.DataSource = bc.getBugsByTitleForTriager(txtSearch.Text);
                lblError.Text        = "";
            }
            else if (string.IsNullOrWhiteSpace(txtSearch.Text))
            {
                lblError.Text = "Type something to search on.";
            }
            else
            {
                lblError.Text = "Choose a type to search on.";
            }

            Repeater1.DataBind();
        }
Example #6
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                string title       = txtTitle.Text;
                string desc        = txtDescription.Text;
                string key         = txtKeywords.Text;
                string bugReporter = Session["loginID"].ToString();

                BugClass bc = new BugClass();
                bc.bugReporter = bugReporter;
                bc.title       = title;
                bc.keywords    = key;
                bc.description = desc;
                bc.category    = ddlCategory.SelectedValue;

                if (bc.addBug() == 0)
                {
                    lblError.InnerText = "Bug report submitted.";
                    clearInput();
                }

                else
                {
                    lblError.InnerText = "Error in bug submission.";
                }
            }
            else
            {
                lblError.InnerText = "*Fill up your bug report!";
            }
        }
Example #7
0
        private void displayBugs()
        {
            BugClass  bc    = new BugClass();
            DataTable bugDt = bc.getAllBugs();

            Repeater1.DataSource = bugDt;
            Repeater1.DataBind();
        }
        private void displayMyBugs()
        {
            BugClass bc = new BugClass();

            bc.assignee = Session["loginID"].ToString();

            Repeater1.DataSource = bc.getAllBugsForDeveloper();
            Repeater1.DataBind();
        }
Example #9
0
        private void displayManageBugs()
        {
            BugClass bc = new BugClass();

            bc.bugReporter = Session["loginID"].ToString();

            Repeater1.DataSource = bc.getBugsForTriager();
            Repeater1.DataBind();
        }
Example #10
0
        private void displayMyBugs()
        {
            BugClass bc = new BugClass();

            bc.bugReporter = Session["loginID"].ToString();

            Repeater1.DataSource = bc.getAllBugsByBugReporter();
            Repeater1.DataBind();
        }
Example #11
0
        protected void updateReport(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                BugClass bc = new BugClass();
                bc.bugID = Int32.Parse(id);

                if (ddlStatus.SelectedValue == "Assigned")
                {
                    if (ddlPriority.SelectedValue != "" && ddlAssignee.SelectedValue != "")
                    {
                        bc.priority = ddlPriority.SelectedValue;
                        bc.assignee = ddlAssignee.SelectedValue;

                        if (bc.assignBug() == 0)
                        {
                            Label3.Text = "Bug assigned successfully!";
                        }
                        else
                        {
                            Label3.Text = "There seem to be a problem changing the status of this bug report.";
                        }
                    }
                    else
                    {
                        Label3.Text = "You need to select both a priority and an assignee!";
                    }
                }
                else if (ddlStatus.SelectedValue == "Closed")
                {
                    if (bc.closeBugReport() == 0)
                    {
                        Label3.Text = "Bug report closed successfully!";
                    }
                    else
                    {
                        Label3.Text = "There seem to be a problem changing the status of this bug report.";
                    }
                }
                else
                {
                    if (bc.rejectBug() == 0)
                    {
                        Label3.Text = "Bug report has been rejected!";
                    }
                    else
                    {
                        Label3.Text = "There seem to be a problem changing the status of this bug report.";
                    }
                }

                displayBugs();
            }
        }
        private void displayBugs()
        {
            id = Request.QueryString["id"];
            BugClass a = new BugClass(id);

            IdLabel.InnerText  = "#" + id.ToString();
            CategoryLabel.Text = "[" + a.category + "]";
            TitleLabel.Text    = a.title;
            KeyLabel.Text      = a.keywords;
            ReporterLabel.Text = "<u>Reported by: " + a.bugReporter + "</u>";
            DateLabel.Text     = a.dateReported.ToString();
            if (a.dateModified == a.dateReported)
            {
                DateModifiedLabel.Text = "-";
            }
            else
            {
                DateModifiedLabel.Text = a.dateModified.ToString();
            }
            if (a.dateResolved < a.dateReported)
            {
                DateResolvedLabel.Text = "-";
            }
            else
            {
                DateResolvedLabel.Text = a.dateResolved.ToString();
            }
            DescriptionLabel.Text = a.description;
            PriorityLabel.Text    = a.priority;
            AssigneeLabel.Text    = a.assignee;
            StatusLabel.Text      = a.status;
            changeStatusColor(a.status);

            //fake uploaded fix
            if (a.status == "Fixed")
            {
                btnSubmit.Disabled = false;
                aFix.InnerText     = id + "_fix.exe";
                aFix.HRef          = "#aFix";
                aFix.Attributes.Add("onClientClick", "fix()");
            }
            else if (a.status == "Closed")
            {
                btnSubmit.Disabled = true;
                aFix.InnerText     = id + "_fix.exe";
                aFix.HRef          = "#aFix";
                aFix.Attributes.Add("onClientClick", "fix()");
            }
            else
            {
                btnSubmit.Disabled = true;
                aFix.InnerText     = " none";
            }
        }
        public void TestAssignBug()
        {
            DateTime date = DateTime.Now;

            BugClass bc = new BugClass();

            bc.priority     = "low";
            bc.assignee     = "nlegonc";
            bc.dateModified = date;
            bc.bugID        = 1003;

            Assert.AreEqual(bc.assignBug(), 0);
        }
Example #14
0
        protected void upload_File(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                BugClass bc = new BugClass();
                bc.bugID = Int32.Parse(id);
                if (bc.addFixToBug() == 0)
                {
                    btnUpload.InnerHtml = "Fix Uploaded";
                    btnUpload.Disabled  = true;


                    displayBugs();
                }
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                BugClass bc = new BugClass();
                bc.status = ddlReview.SelectedValue;
                bc.bugID  = Int32.Parse(id);

                if (bc.reviewFix() == 0)
                {
                    Label3.Text = "Bug Report Updated.";
                }
                else
                {
                    Label3.Text = "Error in updating bug report.";
                }

                displayBugs();
            }
        }
        public void TestSubmitBug()
        {
            string   bugReporter   = "";
            string   title         = "Unable to add new item to checkout";
            string   keywords      = "cart checkout check out";
            string   description   = "add one item to cart > go to product A via the search bar > add new item to cart via 'add to cart' > go to cart";
            DateTime date_reported = DateTime.Now;
            string   category      = "UI";
            string   status        = "New";

            BugClass bc = new BugClass();

            bc.bugReporter  = bugReporter;
            bc.title        = title;
            bc.keywords     = keywords;
            bc.description  = description;
            bc.dateReported = date_reported;
            bc.category     = category;
            bc.status       = status;

            Assert.AreEqual(bc.addBug(), 0);
        }
Example #17
0
        private void displayBugs()
        {
            id = Request.QueryString["id"];
            BugClass a = new BugClass(id);

            IdLabel.InnerText  = "#" + id.ToString();
            CategoryLabel.Text = "[" + a.category + "]";
            TitleLabel.Text    = a.title;
            KeyLabel.Text      = a.keywords;
            ReporterLabel.Text = "<u>Reported by: " + a.bugReporter + "</u>";
            DateLabel.Text     = a.dateReported.ToString();
            if (a.dateModified == a.dateReported)
            {
                DateModifiedLabel.Text = "-";
            }
            else
            {
                DateModifiedLabel.Text = a.dateModified.ToString();
            }
            if (a.dateResolved < a.dateReported)
            {
                DateResolvedLabel.Text = "-";
            }
            else
            {
                DateResolvedLabel.Text = a.dateResolved.ToString();
            }
            DescriptionLabel.Text = a.description;
            PriorityLabel.Text    = a.priority;
            AssigneeLabel.Text    = a.assignee;
            StatusLabel.Text      = a.status;
            StatusLabel2.Text     = a.status; //the one inside details card
            changeStatusColor(a.status);

            //fake uploaded fix
            if (a.status == "Fixed" || a.status == "Closed")
            {
                btnSubmit.Disabled    = true;
                ddlAssignee.Visible   = false;
                ddlPriority.Visible   = false;
                ddlStatus.Visible     = false;
                StatusLabel2.Visible  = true;
                AssigneeLabel.Visible = true;
                PriorityLabel.Visible = true;
                aFix.InnerText        = id + "_fix.exe";
                aFix.HRef             = "#aFix";
            }
            else if (a.status == "Rejected" || a.status == "Assigned")
            {
                btnSubmit.Disabled    = true;
                ddlAssignee.Visible   = false;
                ddlPriority.Visible   = false;
                ddlStatus.Visible     = false;
                StatusLabel2.Visible  = true;
                AssigneeLabel.Visible = true;
                PriorityLabel.Visible = true;
                aFix.InnerText        = " none";
            }
            else if (a.status == "Verified")
            {
                StatusLabel2.Visible  = false;
                AssigneeLabel.Visible = false;
                PriorityLabel.Visible = false;
                aFix.InnerText        = id + "_fix.exe";
                aFix.HRef             = "#aFix";
            }
            else
            {
                StatusLabel2.Visible  = false;
                AssigneeLabel.Visible = false;
                PriorityLabel.Visible = false;

                aFix.InnerText = " none";
            }
        }