private void MitGetVehicleInvoiceInformation_Click(object sender, RoutedEventArgs e) { //setting local variables string strValueForValidation; string strErrorMessage = ""; bool blnFatalError = false; bool blnThereIsAProblem = false; //data validation strValueForValidation = txtStartDate.Text; blnThereIsAProblem = TheDataValidationClass.VerifyDateData(strValueForValidation); if (blnThereIsAProblem == true) { blnFatalError = true; strErrorMessage += "Start Date is not a Date\n"; } else { MainWindow.gdatStartDate = Convert.ToDateTime(strValueForValidation); } strValueForValidation = txtEndDate.Text; blnThereIsAProblem = TheDataValidationClass.VerifyDateData(strValueForValidation); if (blnThereIsAProblem == true) { blnFatalError = true; strErrorMessage += "The End Date is not a Date\n"; } else { MainWindow.gdatEndDate = Convert.ToDateTime(strValueForValidation); } if (blnFatalError == true) { TheMessagesClass.ErrorMessage(strErrorMessage); return; } else { blnFatalError = TheDataValidationClass.verifyDateRange(MainWindow.gdatStartDate, MainWindow.gdatEndDate); if (blnFatalError == true) { TheMessagesClass.ErrorMessage("The End Date is after the Start Date"); return; } } TheFindVehicleInvoiceByVehicleIDDataSet = TheVehicleProblemDocumentClass.FindVehicleInvoiceByVehicleID(MainWindow.gintVehicleID, MainWindow.gdatStartDate, MainWindow.gdatEndDate); dgrResults.ItemsSource = TheFindVehicleInvoiceByVehicleIDDataSet.FindVehicleInvoicesByVehicleID; mitGenerateReport.IsEnabled = true; blnFatalError = TheEmployeeDateEntryClass.InsertIntoEmployeeDateEntry(MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID, "Blue Jay ERP // Vehicle Problem Invoice Report"); if (blnFatalError == true) { throw new Exception(); } }
private void ResetControls() { txtEndDate.Text = ""; txtStartDate.Text = ""; txtVehicleNumber.Text = ""; TheFindVehicleInvoiceByVehicleIDDataSet = TheVehicleProblemDocumentClass.FindVehicleInvoiceByVehicleID(-1, DateTime.Now, DateTime.Now); dgrResults.ItemsSource = TheFindVehicleInvoiceByVehicleIDDataSet.FindVehicleInvoicesByVehicleID; mitGetVehicleInvoiceInformation.IsEnabled = false; mitGenerateReport.IsEnabled = false; }