//submit bug private void imgsubmit_Click(object sender, EventArgs e) { string rtfText = this.richtextcodesnippet.Rtf; //string to save to db this.richtextcodesnippet.Rtf = rtfText; bug.setCode(rtfText); bug.setClass(this.txtclassname.Text); bug.setMethod(this.txtMethodname.Text); bug.setOS(this.txtOS.Text); bug.setSeverity(this.cmbSeverity.Text); bug.setVersion(this.txtVersion.Text); bug.setSummary(this.txtsummary.Text); bug.setlinenofrom(Convert.ToInt32(this.txtlinefrom.Text)); bug.setlinenoto(Convert.ToInt32(this.txtlineto.Text)); bug.setVCURL(this.txtRepoURL.Text); bug.setbugdesc(this.richtxtbugdesc.Text); bug.setCode(this.richtextcodesnippet.Text); bc.submittedby = sessionusername; bool flag = bc.ReportBug(bug); if (flag == true) { this.Hide(); MessageBox.Show("Bug has been reported succesfully"); } else { MessageBox.Show("Fields with * cannot be empty"); } }
/// <summary> /// Tester Dashboard Load /// </summary> /// <param name="bug"></param> public void populatetesterdashboard(BugModel bug) { try { String sql = "select pro.project_name,com.component_name," + "bug.summary,bug.version,bug.severity,bug.os,bug.class,bug.method,bug.linenofrom,bug.linenoto,bug.vcrurl," + "bug.screenshot,bug.bugdesc,bug.code,bug.submittedby,bug.submitteddate,bug.status,bug.assignedto" + " from tbl_project as pro" + " inner join tbl_component as com on pro.project_id = com.project_id " + "inner join tbl_bug as bug on com.component_id = bug.component_id " + "where bug_id = @bug_id"; MySqlConnection conn = DBUtils.GetDBConnection(); conn.Open(); MySqlCommand cmd = new MySqlCommand(); cmd.Connection = conn; cmd.CommandText = sql; cmd.Parameters.AddWithValue("@bug_id", bug.getBUGID()); MySqlDataAdapter MyAdapter = new MySqlDataAdapter(); MyAdapter.SelectCommand = cmd; DataTable dTable = new DataTable(); MyAdapter.Fill(dTable); bug.dtable = dTable; bug.setProjectName(dTable.Rows[0][0].ToString()); bug.setComponentName(dTable.Rows[0][1].ToString()); bug.setVersion(dTable.Rows[0][3].ToString()); bug.setSeverity(dTable.Rows[0][4].ToString()); bug.setClass(dTable.Rows[0][6].ToString()); bug.setMethod(dTable.Rows[0][7].ToString()); bug.setlinenofrom(Convert.ToInt32(dTable.Rows[0][8].ToString())); bug.setlinenoto(Convert.ToInt32(dTable.Rows[0][9].ToString())); bug.setbugdesc(dTable.Rows[0][12].ToString()); bug.setCode(dTable.Rows[0][13].ToString()); bug.setVCURL(dTable.Rows[0][10].ToString()); byte[] img = (byte[])dTable.Rows[0][11]; MemoryStream ms = new MemoryStream(img); bug.setImage(System.Drawing.Image.FromStream(ms)); bug.setStatus(dTable.Rows[0][16].ToString()); bug.setAssignedTo(dTable.Rows[0][17].ToString()); } catch (Exception e) { Debug.WriteLine("Error Message: " + e); Debug.WriteLine(e.StackTrace); } }
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"); } }