private void btnFindInQueued_Click(object sender, EventArgs e) { try { if (txtJobNumber.Text != "" && cmbJobType.Text != "") { Job job = new Job(); job.jobNumber = txtJobNumber.Text; job.jobType = cmbJobType.Text; JobController jobController = new JobController(); bool ReturnVal = jobController.CheckAvailabilty(job); if (jobController.CheckAvailabilty(job)) { MessageBox.Show("File is Available in Queued folder"); } else { MessageBox.Show("File is Not Available in Queued folder"); } } else { MessageBox.Show("Please enter all the required details"); } } catch (Exception ex) { MessageBox.Show("Error occured"); } }
private void btnReprocessWithAdminPwd_Click(object sender, EventArgs e) { try { if (txtJobNumber.Text != "") { if (txtAdminPwd.Text == "tdapower") { var confirmationResult = MessageBox.Show("Are you sure that you would like to Re-process?", "Warning Re-processing", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (confirmationResult == DialogResult.Yes) { Job job = new Job(); job.jobNumber = txtJobNumber.Text; job.jobType = cmbJobType.Text; DBController dbController = new DBController(); String status = dbController.GetJobStatusFromDB(job.jobNumber, job.jobType); if (status != null) { job.jobStatus = status; if (dbController.CheckStatus(job)) { JobController jobController = new JobController(); if (jobController.CheckAvailabilty(job)) { ReprocessController reprocessController = new ReprocessController(); if (reprocessController.MoveFolders(job)) { MessageBox.Show("File sucessfully moved to Saved Folder"); } else { MessageBox.Show("File is Not Found in Queued folder"); } } else { MessageBox.Show("File is Not Found in Queued folder"); } } else { JobController jobController = new JobController(); if (jobController.CheckAvailabilty(job)) { ReprocessController reprocessController = new ReprocessController(); if (reprocessController.MoveFolders(job)) { MessageBox.Show("File sucessfully moved to Saved Folder"); } else { MessageBox.Show("File is Not Found in Queued folder"); } } else { MessageBox.Show("File is Not Found in Queued folder"); } } } } } else { MessageBox.Show("Wrong admin password!"); } } else { MessageBox.Show("Please enter all the required details"); } } catch (Exception ex) { MessageBox.Show("Error occured"); } }