// This button takes the user to the technical support menu private void button3_Click(object sender, EventArgs e) { this.Hide(); frmTechnicalSupport frmTechnicalSupport = new frmTechnicalSupport(admin); frmTechnicalSupport.Show(); }
// Submits the ticket to the database. private void btnSubmitTicket_Click(object sender, EventArgs e) { if (rtxFaultDescription.Text == "") { MessageBox.Show("No description for the problem was provided!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { string clientID = cmbClient.SelectedValue.ToString(); string fault = rtxFaultDescription.Text; int typeOfServiceID = int.Parse(cmbTypeOfService.SelectedValue.ToString().Substring(0, cmbTypeOfService.SelectedValue.ToString().IndexOf('-'))); int technicianID = 0; if (cmbTechnician.Items.Count != 0) { technicianID = int.Parse(cmbTechnician.SelectedValue.ToString()); } int productID = int.Parse(cmbProduct.SelectedValue.ToString().Substring(0, cmbProduct.SelectedValue.ToString().IndexOf('-'))); Ticket ticket = new Ticket(0, clientID, fault, new Service(0, productID, typeOfServiceID, technicianID), DateTime.Now, true); ticket.AddTicket(); this.Hide(); frmTechnicalSupport frmTechnicalSupport = new frmTechnicalSupport(admin); frmTechnicalSupport.Show(); } }
// Adds a new installation to the database. private void btnAddInstallation_Click(object sender, EventArgs e) { Installation installation = new Installation(0, false, new Technician(int.Parse(cmbTechnician.SelectedValue.ToString()))); Installation.AddInstallation(installation, int.Parse(cmbOrder.SelectedValue.ToString())); this.Hide(); frmTechnicalSupport frmTechnicalSupport = new frmTechnicalSupport(admin); frmTechnicalSupport.Show(); }
private void btnCancelTicket_Click_1(object sender, EventArgs e) { int ticketID = int.Parse(dgvTickets.SelectedRows[0].Cells[0].Value.ToString()); Ticket.CancelTicket(ticketID); this.Hide(); frmTechnicalSupport frmTechnicalSupport = new frmTechnicalSupport(admin); frmTechnicalSupport.Show(); }
// Finished the installation. private void btnFinishInstallation_Click(object sender, EventArgs e) { int installationID = int.Parse(dgvInstallations.SelectedRows[0].Cells[0].Value.ToString()); Installation.FinishInstallation(installationID); this.Hide(); frmTechnicalSupport frmTechnicalSupport = new frmTechnicalSupport(admin); frmTechnicalSupport.Show(); }
private void btnLogOut_Click_1(object sender, EventArgs e) { if (updateOrder) { this.Hide(); frmClientManagement frmClientManagement = new frmClientManagement(admin); frmClientManagement.Show(); } else { this.Hide(); frmTechnicalSupport frmTechnicalSupport = new frmTechnicalSupport(admin); frmTechnicalSupport.Show(); } }