public void LoadBugs() { BugController bugController = new BugController(); DataTable dataTable = bugController.LoadMyBugs(); //populating datagridview with source bugtableview.DataSource = dataTable; //setting columns visibility bugtableview.Columns["fixDate"].Visible = false; //editing columns header text bugtableview.Columns["bugId"].HeaderText = "Bug ID"; bugtableview.Columns["projectName"].HeaderText = "Project Name"; bugtableview.Columns["issue"].HeaderText = "Bug Description"; bugtableview.Columns["fileName"].HeaderText = "File Name"; bugtableview.Columns["lineNo"].HeaderText = "Line No"; bugtableview.Columns["createdDate"].HeaderText = "Created Date"; bugtableview.Columns["userName"].HeaderText = "Issue By"; bugtableview.Columns["status"].HeaderText = "Status"; bugtableview.Columns["fixDate"].HeaderText = "Fix Date"; //setting user edit role bugtableview.SelectionMode = DataGridViewSelectionMode.FullRowSelect; bugtableview.AllowUserToAddRows = false; bugtableview.AllowUserToDeleteRows = false; bugtableview.MultiSelect = false; bugtableview.AllowUserToResizeRows = false; bugtableview.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing; }
public void populatedashboard() { BugController bc = new BugController(); history = BugController.getHistory(bugid); PopulateDataGridHistory(); }
/// <summary> ///populate dashboard /// </summary> public void PopulateDashboardItems() { bug.setBugID(bugid); BugController bc = new BugController(); bc.populatepmdashboard(bug); historytable = bc.getHistory(bug); if (historytable != null && historytable.Rows.Count > 0) { this.lbllastupdatedby.Text = historytable.Rows[0][4].ToString(); this.lbllastupdateon.Text = historytable.Rows[0][3].ToString(); this.richremarks.Text = historytable.Rows[0][7].ToString(); } else { this.lbllastupdatedby.Text = "Unkown"; this.lbllastupdateon.Text = "Unknown"; this.richremarks.Text = ""; } this.richsourcecode.Text = bug.getCode(); this.richbugdesc.Text = bug.getbugdesc(); this.imgscreenshot.Image = bug.GetImage(); this.txtclassname.Text = bug.getClass(); this.txtcomponent.Text = bug.getComponentName(); this.txtproject.Text = bug.getProjectName(); this.txtmethodname.Text = bug.getMethod(); this.txtlinefrom.Text = bug.getlinenofrom().ToString(); this.txtlineto.Text = bug.getlinenoto().ToString(); this.lblbugstatus.Text = bug.getStatus(); this.lblversion.Text = bug.getVersion(); imgnew = bug.GetImage(); //setting bug image if (bug.getSeverity() == "Critical") { this.imgbugseverity.Image = Properties.Resources.bugred; } else if (bug.getSeverity() == "Low") { this.imgbugseverity.Image = Properties.Resources.buggreen; } //enabling disabling assign bug feature if (bug.getAssignedTo() != "") { this.txtdeveloperusername.ReadOnly = true; this.txtdeveloperusername.Text = bug.getAssignedTo(); this.btnassignbug.Enabled = false; } else { this.txtdeveloperusername.ReadOnly = false; this.btnassignbug.Enabled = true; } }
private void btnUpdate_Click(object sender, EventArgs e) { string project = txtProject.Text; string file = txtFile.Text; string lineno = txtLine.Text; string issue = txtIssue.Text; string cdate = txtdate.Text; string status = txtstatus.Text; if (!string.IsNullOrEmpty(project)) { if (!string.IsNullOrEmpty(issue)) { Bugs bug = new Bugs(); bug.BugId = Convert.ToInt32(bugtableview.CurrentRow.Cells[0].Value.ToString()); bug.Username = username; bug.ProjectName = project; bug.FileName = file; bug.LineNo = lineno; bug.Issue = issue; bug.CreatedDate = cdate; bug.Status = status; bug.FixBy = username; BugController bugController = new BugController(); Boolean reported = bugController.UpdateBug(bug); if (reported) { MessageBox.Show("Bug successfully updated!"); this.Close(); } else { MessageBox.Show("Unable to update bug!"); } } else { MessageBox.Show("Project name cannot be blank!"); txtProject.Focus(); } } else { MessageBox.Show("Bug Issue cannot be blank!"); txtIssue.Focus(); } }
private void btnAdd_Click(object sender, EventArgs e) { string project = txtProject.Text; string file = txtFile.Text; string lineno = txtLine.Text; string issue = txtIssue.Text; string cdate = txtdate.Text; string status = txtstatus.Text; if (!string.IsNullOrEmpty(project)) { if (!string.IsNullOrEmpty(issue)) { Bugs bug = new Bugs(); bug.Username = username; bug.ProjectName = project; bug.FileName = file; bug.LineNo = lineno; bug.Issue = issue; bug.CreatedDate = cdate; bug.Status = status; BugController bugController = new BugController(); Boolean reported = bugController.ReportBug(bug); if (reported) { MessageBox.Show("Bug successfully reported!"); this.Close(); } else { MessageBox.Show("Unable to report bug!"); } } else { MessageBox.Show("Project name cannot be blank!"); txtProject.Focus(); } } else { MessageBox.Show("Bug Issue cannot be blank!"); txtIssue.Focus(); } }
private void btnassignbug_Click(object sender, EventArgs e) { BugModel bug = new BugModel(); bug.setAssignedTo(this.txtdeveloperusername.Text); bug.setBugID(bugid); BugController bc = new BugController(); if (bc.AssignBug(bug) == false) { MessageBox.Show("Sorry, Bug cannot be assigned to this user. Either Check the privilage or if the user exists.", "Assign Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("Bug has been assigned and the developer has been notified"); } }
/// <summary> ///populate dashboard /// </summary> public void PopulateDashboardItems() { bug.setBugID(bugid); BugController bc = new BugController(); bc.populatepmdashboard(bug); this.richsourcecode.Text = bug.getCode(); this.richbugdesc.Text = bug.getbugdesc(); this.imgscreenshot.Image = bug.GetImage(); this.txtclassname.Text = bug.getClass(); this.txtcomponent.Text = bug.getComponentName(); this.txtproject.Text = bug.getProjectName(); this.txtmethodname.Text = bug.getMethod(); this.txtlinefrom.Text = bug.getlinenofrom().ToString(); this.txtlineto.Text = bug.getlinenoto().ToString(); this.lblbugstatus.Text = bug.getStatus(); imgnew = bug.GetImage(); //setting bug image if (bug.getSeverity() == "Critical") { this.imgbugseverity.Image = Properties.Resources.bugred; } else if (bug.getSeverity() == "Low") { this.imgbugseverity.Image = Properties.Resources.buggreen; } //enabling disabling assign bug feature if (bug.getAssignedTo() != "") { this.txtdeveloperusername.ReadOnly = true; this.txtdeveloperusername.Text = bug.getAssignedTo(); this.btnassignbug.Enabled = false; } else { this.txtdeveloperusername.ReadOnly = false; this.btnassignbug.Enabled = true; } }
private void submit_Click(object sender, EventArgs e) { BugModel bug = new BugModel(); bug.setRemarks(this.txtremarks.Text); bug.setCode(this.txtupdatecode.Text); bug.setStatus(this.cmbStatus.Text); bug.setVersion(this.txtversion.Text); Debug.WriteLine("Username is:" + username); bug.setUsername(username); bug.setBugID(bugid); BugController bc = new BugController(); bool flag = bc.UpdateBug(bug); if (flag == true) { this.Hide(); MessageBox.Show("Bug Was Succesfully Updated"); } else if (flag == false) { MessageBox.Show("Bug could not be updated"); } }
/// <summary> /// Search /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnsearchbug_Click(object sender, EventArgs e) { try { DataTable searchhistory = new DataTable(); String searchfor; String search; searchfor = this.cmbsearchfor.GetItemText(this.cmbsearchfor.SelectedItem); switch (searchfor) { case "summary": search = "summary"; searchhistory = BugController.getSearch(search, this.txtsearchbug.Text); dtable = searchhistory; Debug.WriteLine("Search query found" + searchhistory.Rows[0][2].ToString()); PopulateDataGridPMDashboard(); this.Refresh(); break; case "bug description": search = "bugdesc"; searchhistory = BugController.getSearch(search, this.txtsearchbug.Text); dtable = searchhistory; Debug.WriteLine("Search query found" + searchhistory.Rows[0][2].ToString()); PopulateDataGridPMDashboard(); this.Refresh(); break; case "code": search = "code"; searchhistory = BugController.getSearch(search, this.txtsearchbug.Text); dtable = searchhistory; Debug.WriteLine("Search query found" + searchhistory.Rows[0][2].ToString()); PopulateDataGridPMDashboard(); this.Refresh(); break; case "class": search = "class"; searchhistory = BugController.getSearch(search, this.txtsearchbug.Text); dtable = searchhistory; Debug.WriteLine("Search query found" + searchhistory.Rows[0][2].ToString()); PopulateDataGridPMDashboard(); this.Refresh(); break; case "method": search = "method"; searchhistory = BugController.getSearch(search, this.txtsearchbug.Text); dtable = searchhistory; Debug.WriteLine("Search query found" + searchhistory.Rows[0][2].ToString()); PopulateDataGridPMDashboard(); this.Refresh(); break; default: MessageBox.Show("Please select a search criteria"); break; } } catch (Exception ex) { MessageBox.Show("No Data Found"); Debug.WriteLine(ex); } }