public void display_attachment() { gbTicketID.Text = "Ticket ID: " + ticket_id; job_request = new classes.JobRequest(); job_request_attachment_table = job_request.select_job_request_attachment(ticket_id); if (job_request_attachment_table.Rows.Count > 0) { foreach (DataRow row in job_request_attachment_table.Rows) { pb = new PictureBox(); pb.Name = row["id"].ToString(); pb.Image = Image.FromStream(new MemoryStream((Byte[])row["image"])); pb.Size = new Size(90, 70); pb.SizeMode = PictureBoxSizeMode.StretchImage; this.pb.Click += new System.EventHandler(this.pb_Click); flpPreview.Controls.Add(pb); } } else { lblStatusMessage.Visible = true; } }
private void display_items_for_replace() { job_request = new classes.JobRequest(); cbReplaceWith.DataSource = job_request.select_items_for_replace(inventory_type, Convert.ToInt32(cbItemHavingIssue.SelectedValue)); cbReplaceWith.DisplayMember = "item_name"; cbReplaceWith.ValueMember = "id"; cbReplaceWith.SelectedIndex = 0; }
private void display_items_having_issue_with() { job_request = new classes.JobRequest(); cbItemHavingIssue.DataSource = job_request.select_items_having_issue_with(inventory_type, department); cbItemHavingIssue.DisplayMember = "item_name"; cbItemHavingIssue.ValueMember = "id"; cbItemHavingIssue.SelectedIndex = 0; }
private void display_computer_unit_having_issue_with() { job_request = new classes.JobRequest(); cbItemHavingIssue.DataSource = job_request.select_computer_unit_having_issue_with(department); cbItemHavingIssue.DisplayMember = "machine_name"; cbItemHavingIssue.ValueMember = "id"; cbItemHavingIssue.SelectedIndex = 0; }
public void display_job_request_data() { job_request = new classes.JobRequest(); string search = cbSearchBy.Text; switch (search) { case "Ticket ID": job_request_table = job_request.select_job_request_table("a.ticket_id", txtSearch.Text); break; case "Problem": job_request_table = job_request.select_job_request_table("a.problem", txtSearch.Text); break; case "Employee": job_request_table = job_request.select_job_request_table("c.first_name", txtSearch.Text); break; case "Department": job_request_table = job_request.select_job_request_table("d.department_name", txtSearch.Text); break; case "Status": job_request_table = job_request.select_job_request_table("a.status", txtSearch.Text); break; case "--Search by--": job_request_table = job_request.select_job_request_table(); break; default: job_request_table = job_request.select_job_request_table(); break; } dgvJobRequest.DataSource = job_request_table; dgvJobRequest.AutoGenerateColumns = false; if (dgvJobRequest.Columns.Contains("action") && dgvJobRequest.Columns["action"].Visible) { } else { DataGridViewButtonColumn button = new DataGridViewButtonColumn(); { button.Name = "action"; button.HeaderText = "Action"; button.Text = "View Request"; button.UseColumnTextForButtonValue = true; this.dgvJobRequest.Columns.Add(button); } } }
public void display_job_request_information() { job_request = new classes.JobRequest(); var result = job_request.select_job_request_count(); total = result.Item1; completed = result.Item2; ongoing = result.Item3; cancelled = result.Item4; job_request_employee_count_table = job_request.select_job_request_per_employee(); job_request_department_count_table = job_request.select_job_request_per_department(); job_request_most_common_issue_table = job_request.select_job_request_most_common_issue(); display_job_request_count(); display_job_request_per_employee(); display_job_request_per_department(); display_job_request_most_common_issue(); display_mci_chart(); }
public void display_job_request_history() { gbTicketID.Text = "Ticket ID: " + ticket_id; lblDateReported.Text = date_reported; lblStatus.Text = status; job_request = new classes.JobRequest(); job_request_history_table = job_request.select_job_request_history(ticket_id); if (job_request_history_table.Rows.Count > 0) { foreach (DataRow row in job_request_history_table.Rows) { uc_feedback = new uc.frmDashboard.admin.mr.ucJobRequestFeedback(); uc_feedback.date_responded = Convert.ToDateTime(row["responded_at"]).ToLongDateString(); uc_feedback.findings = row["findings"].ToString(); uc_feedback.findings_selection = row["findings_selection"].ToString(); uc_feedback.action_taken = row["action_taken"].ToString(); uc_feedback.feedback = row["feedback"].ToString(); flpFeedbackHistory.Controls.Add(uc_feedback); } } }
private void send_feedback() { hasError = false; if ((rdbHardwareRelated.Checked || rdbSoftwareRelated.Checked) == false) { hasError = true; MessageBox.Show("Please choose your findings.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (rdbHardwareRelated.Checked) { if ((rdbComputerUnit.Checked || rdbHardwareItems.Checked || rdbOthers.Checked) == false) { hasError = true; MessageBox.Show("Please select your findings on the menu.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (rdbComputerUnit.Checked) { if (cbItemHavingIssue.SelectedIndex == 0 || cbItemHavingIssue.SelectedIndex == -1) { hasError = true; MessageBox.Show("Please select the computer that having issue with.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if ((rdbTroubleshoot.Checked || rdbReplaceWith.Checked) == false) { hasError = true; MessageBox.Show("Please select the action you took to respond to the request.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (rdbReplaceWith.Checked) { if (cbReplaceWith.SelectedIndex == 0 || cbReplaceWith.SelectedIndex == -1) { hasError = true; MessageBox.Show("Please select the item to replace the item that having issue with .", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } } } else if (rdbHardwareItems.Checked) { if (cbItemHavingIssue.SelectedIndex == 0 || cbItemHavingIssue.SelectedIndex == -1) { hasError = true; MessageBox.Show("Please select the item that having issue with.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if ((rdbWorking.Checked || rdbDefective.Checked || rdbCondemned.Checked) == false) { hasError = true; MessageBox.Show("Please select the new status of the item that having issue with.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if ((rdbTroubleshoot.Checked || rdbReplaceWith.Checked) == false) { hasError = true; MessageBox.Show("Please select the action you took to respond to the request.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (rdbReplaceWith.Checked) { if (cbReplaceWith.SelectedIndex == 0 || cbReplaceWith.SelectedIndex == -1) { hasError = true; MessageBox.Show("Please select the item to replace the item that having issue with .", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } } } } else if (rdbOthers.Checked) { if (rdbTroubleshoot.Checked == false) { hasError = true; MessageBox.Show("Please select the action you took to respond to the request.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } } else if (rdbSoftwareRelated.Checked) { if ((rdbApplicationSoftware.Checked || rdbOthers.Checked) == false) { hasError = true; MessageBox.Show("Please select your findings on the menu.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (rdbApplicationSoftware.Checked) { if (cbItemHavingIssue.SelectedIndex == 0 || cbItemHavingIssue.SelectedIndex == -1) { hasError = true; MessageBox.Show("Please select the application that having issue with.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if ((rdbWorking.Checked || rdbDefective.Checked) == false) { hasError = true; MessageBox.Show("Please select the new status of the application that having issue with.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if ((rdbReinstall.Checked || rdbReplaceWith.Checked) == false) { hasError = true; MessageBox.Show("Please select the action you took to respond to the request.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (rdbReplaceWith.Checked) { if (cbReplaceWith.SelectedIndex == 0 || cbReplaceWith.SelectedIndex == -1) { hasError = true; MessageBox.Show("Please select the item to replace the item that having issue with .", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } } } } else if (rdbOthers.Checked) { if ((rdbTroubleshoot.Checked || rdbReinstall.Checked) == false) { hasError = true; MessageBox.Show("Please select the action you took to respond to the request.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } } } if (string.IsNullOrEmpty(txtFeedback.Text)) { hasError = true; MessageBox.Show("Please provide a feedback to the request.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if ((rdbCompleted.Checked || rdbOngoing.Checked) == false) { hasError = true; MessageBox.Show("Please indicate the status of the request.", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (hasError == false) { string findings = (rdbHardwareRelated.Checked) ? rdbHardwareRelated.Text : rdbSoftwareRelated.Text; string findings_selection = (rdbComputerUnit.Checked) ? rdbComputerUnit.Text : (rdbHardwareItems.Checked) ? rdbHardwareItems.Text : (rdbApplicationSoftware.Checked) ? rdbApplicationSoftware.Text : rdbOthers.Text; int computer_unit_having_issue = (rdbComputerUnit.Checked) ? Convert.ToInt32(cbItemHavingIssue.SelectedValue) : 0; int inventory_having_issue = (rdbHardwareItems.Checked || rdbApplicationSoftware.Checked) ? Convert.ToInt32(cbItemHavingIssue.SelectedValue) : 0; string new_status_having_issue = (rdbWorking.Checked) ? rdbWorking.Text : (rdbDefective.Checked) ? rdbDefective.Text : rdbCondemned.Text; string action_taken = (rdbTroubleshoot.Checked) ? rdbTroubleshoot.Text : (rdbReinstall.Checked) ? rdbReinstall.Text : rdbReplaceWith.Text; int computer_replaced_with = (rdbComputerUnit.Checked && rdbReplaceWith.Checked) ? Convert.ToInt32(cbReplaceWith.SelectedValue) : 0; int inventory_replaced_with = ((rdbHardwareItems.Checked || rdbApplicationSoftware.Checked) && rdbReplaceWith.Checked) ? Convert.ToInt32(cbReplaceWith.SelectedValue) : 0; string feedback = txtFeedback.Text; string status = (rdbCompleted.Checked) ? rdbCompleted.Text : rdbOngoing.Text; job_request = new classes.JobRequest(); if (job_request.send_job_request_feedback(ticket_id, findings, findings_selection, computer_unit_having_issue, inventory_having_issue, action_taken, computer_replaced_with, inventory_replaced_with, feedback, status)) { MessageBox.Show("Feedback has been sent!", "Send Feedback", MessageBoxButtons.OK, MessageBoxIcon.Information); frmViewReport.instance.display_selected_report(); this.Close(); } else { return; } } else { return; } } } }