private void dashboardGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { ticketDetails viewTicket = new ticketDetails(); viewTicket.ticketIDText.Text = this.dashboardGrid.CurrentRow.Cells[0].Value.ToString(); viewTicket.unitIDText.Text = this.dashboardGrid.CurrentRow.Cells[1].Value.ToString(); //viewTicket.statusCombo.SelectedValue = this.dashboardGrid.CurrentRow.Cells[2].Value.ToString(); //viewTicket.priorityCombo.SelectedValue = this.dashboardGrid.CurrentRow.Cells[3].Value.ToString(); //viewTicket.dateText.Text = this.dashboardGrid.CurrentRow.Cells[4].Value.ToString(); //viewTicket.equipmentCombo.SelectedValue = this.dashboardGrid.CurrentRow.Cells[5].Value.ToString(); viewTicket.welderSignatureText.Text = this.dashboardGrid.CurrentRow.Cells[6].Value.ToString(); viewTicket.inspectorSignatureText.Text = this.dashboardGrid.CurrentRow.Cells[7].Value.ToString(); viewTicket.additionalInformationText.Text = this.dashboardGrid.CurrentRow.Cells[8].Value.ToString(); viewTicket.statusText.Text = this.dashboardGrid.CurrentRow.Cells[2].Value.ToString(); viewTicket.statusCombo.Visible = false; viewTicket.priorityText.Text = this.dashboardGrid.CurrentRow.Cells[3].Value.ToString(); viewTicket.priorityCombo.Visible = false; viewTicket.equipText.Text = this.dashboardGrid.CurrentRow.Cells[5].Value.ToString(); viewTicket.equipmentCombo.Visible = false; if (labelRole.Text == "manager") { viewTicket.updateButton.Enabled = false; viewTicket.saveButton.Enabled = false; viewTicket.mangButton.Enabled = true; viewTicket.coordButton.Enabled = false; } viewTicket.Show(); this.Hide(); }
private void ticketPage_Click(object sender, EventArgs e) { ticketDetails newTicket = new ticketDetails(); newTicket.Show(); this.Hide(); }
private void dashboardGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) { //generates ticketDetails window populated with database information relevant to datagridview cell selected ticketDetails viewTicket = new ticketDetails(); viewTicket.ticketIDText.Text = this.dashboardGrid.CurrentRow.Cells[0].Value.ToString(); viewTicket.unitIDText.Text = this.dashboardGrid.CurrentRow.Cells[1].Value.ToString(); viewTicket.equipmentCombo.SelectedValue = this.dashboardGrid.CurrentRow.Cells[2].Value.ToString(); //viewTicket.dateSubmittedDateTimePicker.Text = this.dashboardGrid.CurrentRow.Cells[3].Value.ToString(); viewTicket.priorityCombo.Text = this.dashboardGrid.CurrentRow.Cells[3].Value.ToString(); viewTicket.statusCombo.Text = this.dashboardGrid.CurrentRow.Cells[2].Value.ToString(); viewTicket.welderSignatureText.Text = this.dashboardGrid.CurrentRow.Cells[6].Value.ToString(); viewTicket.inspectorSignatureText.Text = this.dashboardGrid.CurrentRow.Cells[7].Value.ToString(); viewTicket.additionalInformationText.Text = this.dashboardGrid.CurrentRow.Cells[8].Value.ToString(); if (labelRole.Text == "coordinator") { viewTicket.updateButton.Enabled = false; viewTicket.saveButton.Enabled = false; viewTicket.mangButton.Enabled = false; } viewTicket.Show(); this.Hide(); }
private void createTicket_Click(object sender, EventArgs e) { ticketDetails newTicket = new ticketDetails(); newTicket.Show(); this.Hide(); //this makes it so it autofills the ticket number for us string connetionString = null; SqlConnection connection; SqlCommand command; SqlDataAdapter adapter = new SqlDataAdapter(); DataSet ds = new DataSet(); string sql = null; connetionString = "Data Source=10.135.85.184;Initial Catalog=Group6;User ID=Group6;Password=Grp6s2117"; sql = "SELECT ticketID FROM Tickets"; connection = new SqlConnection(connetionString); try { connection.Open(); command = new SqlCommand(sql, connection); adapter.SelectCommand = command; adapter.Fill(ds, "SQL Temp Table"); adapter.Dispose(); command.Dispose(); //connection.Close(); newTicket.ticketIDText.Text = (ds.Tables[0].Rows.Count + 100).ToString(); //MessageBox.Show("Number of row(s) - " + ds.Tables[0].Rows.Count); } catch (Exception ex) { MessageBox.Show("Cannot open connection to database! "); } if (coordButton.Enabled == true) { newTicket.mangButton.Enabled = false; newTicket.coordButton.Enabled = true; newTicket.Show(); this.Hide(); } else if (mangButton.Enabled == true) { newTicket.mangButton.Enabled = true; newTicket.coordButton.Enabled = false; newTicket.Show(); this.Hide(); } }
private void dashboardGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { ticketDetails viewTicket = new ticketDetails(); viewTicket.ticketIDText.Text = this.dashboardGrid.CurrentRow.Cells[0].Value.ToString(); //viewTicket.unitIDText.Text = this.dashboardGrid.CurrentRow.Cells[1].Value.ToString(); viewTicket.priorityCombo.SelectedValue = this.dashboardGrid.CurrentRow.Cells[1].Value.ToString(); viewTicket.statusCombo.SelectedValue = this.dashboardGrid.CurrentRow.Cells[2].Value.ToString(); //viewTicket.dateText.Text = this.dashboardGrid.CurrentRow.Cells[4].Value.ToString(); //viewTicket.equipmentCombo.SelectedValue = this.dashboardGrid.CurrentRow.Cells[5].Value.ToString(); //viewTicket.welderSignatureText.Text = this.dashboardGrid.CurrentRow.Cells[6].Value.ToString(); //viewTicket.inspectorSignatureText.Text = this.dashboardGrid.CurrentRow.Cells[7].Value.ToString(); //viewTicket.additionalInformationText.Text = this.dashboardGrid.CurrentRow.Cells[8].Value.ToString(); viewTicket.Show(); this.Hide(); }