/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_solution_Click(object sender, EventArgs e) { MemoryStream mStream; if (dataGridView1.SelectedRows.Count != 0) { int bugId = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value); string projectname = dataGridView1.SelectedRows[0].Cells[1].Value.ToString(); string classname = dataGridView1.SelectedRows[0].Cells[2].Value.ToString(); string method = dataGridView1.SelectedRows[0].Cells[3].Value.ToString(); string lineNo = dataGridView1.SelectedRows[0].Cells[4].Value.ToString(); string endline = dataGridView1.SelectedRows[0].Cells[5].Value.ToString(); byte[] errorsnap = (byte[])dataGridView1.SelectedRows[0].Cells[6].Value; string author = dataGridView1.SelectedRows[0].Cells[7].Value.ToString(); string year = dataGridView1.SelectedRows[0].Cells[8].Value.ToString(); string month = dataGridView1.SelectedRows[0].Cells[9].Value.ToString(); string day = dataGridView1.SelectedRows[0].Cells[10].Value.ToString(); string sourcecode = dataGridView1.SelectedRows[0].Cells[11].Value.ToString(); string status = dataGridView1.SelectedRows[0].Cells[12].Value.ToString(); string addedby = dataGridView1.SelectedRows[0].Cells[13].Value.ToString(); string solveremail = dataGridView1.SelectedRows[0].Cells[14].Value.ToString(); string solveyear = dataGridView1.SelectedRows[0].Cells[15].Value.ToString(); string solvemonth = dataGridView1.SelectedRows[0].Cells[16].Value.ToString(); string solveday = dataGridView1.SelectedRows[0].Cells[17].Value.ToString(); string solvecode = dataGridView1.SelectedRows[0].Cells[18].Value.ToString(); mStream = new MemoryStream(errorsnap); string role = email; if (role == "*****@*****.**") { AdminPanelForm admin = new AdminPanelForm(); admin.BugDetailForm(email, bugId, projectname, classname, method, lineNo, endline, mStream, author, year, month, day, sourcecode, status, addedby, solveremail, solveyear, solvemonth, solveday, solvecode); dataGridView1.Refresh(); LoadAllBugs(); btn_solution.Visible = false; } else { BugTracking panel = new BugTracking(); panel.EditBugForm(email, bugId, projectname, classname, method, lineNo, endline, mStream, author, year, month, day, sourcecode, status, addedby, solveremail, solveyear, solvemonth, solveday, solvecode); dataGridView1.Refresh(); LoadAllBugs(); } } else { MessageBox.Show("Select row to update.."); } }
/// <summary> /// button event to edit user data /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_edit_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count != 0) { int Id = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value); string fullname = dataGridView1.SelectedRows[0].Cells[1].Value.ToString(); string email = dataGridView1.SelectedRows[0].Cells[2].Value.ToString(); string contact = dataGridView1.SelectedRows[0].Cells[4].Value.ToString(); string status = dataGridView1.SelectedRows[0].Cells[5].Value.ToString(); AdminPanelForm adminpanel = new AdminPanelForm(); adminpanel.EditUserForm(Id, fullname, email, contact, status); dataGridView1.Refresh(); LoadAllUser(); } else { MessageBox.Show("Please selct a row..."); } }