private void expProcess_Expanded_1(object sender, RoutedEventArgs e) { int intVehicleCounter; int intVehicleNumberOfRecords; int intAutomileCounter; int intAutomileNumberOfRecords; int intVehicleID; string strVehicleNumber; string strAutomileVehicleNumber; bool blnItemFound; bool blnItemEntered; int intThirdCounter; string strInOrOut; string strManager; string strFullName; string strAssignedOffice; DateTime datStartDate; DateTime datEndDate; int intRecordsReturned; int intManagerID; try { expProcess.IsExpanded = false; //loading the vehicle data set TheFindActiveVehicleMainDataSet = TheVehicleMainClass.FindActiveVehicleMain(); TheVehicleCurrentStatusDataSet.vehiclecurrentstatus.Rows.Clear(); TheShortedCurrentVehicleDataSet.shortenlist.Rows.Clear(); datStartDate = DateTime.Now; datStartDate = TheDateSearchClass.RemoveTime(datStartDate); datEndDate = TheDateSearchClass.AddingDays(datStartDate, 1); intVehicleNumberOfRecords = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain.Rows.Count - 1; intAutomileNumberOfRecords = TheAutomileImportDataSet.automileimport.Rows.Count - 1; gintThirdCounter = 0; gintThirdNumberOfRecords = 0; for (intVehicleCounter = 0; intVehicleCounter <= intVehicleNumberOfRecords; intVehicleCounter++) { intVehicleID = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain[intVehicleCounter].VehicleID; if (intVehicleID != 9076) { strVehicleNumber = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain[intVehicleCounter].VehicleNumber; strAssignedOffice = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain[intVehicleCounter].AssignedOffice; TheFindCurrentAssignedVehicleMainByVehicleIDDataSet = TheVehicleAssignmentClass.FindCurrentAssignedVehicleMainByVehicleID(intVehicleID); strFullName = TheFindCurrentAssignedVehicleMainByVehicleIDDataSet.FindCurrentAssignedVehicleMainByVehicleID[0].FirstName + " "; strFullName += TheFindCurrentAssignedVehicleMainByVehicleIDDataSet.FindCurrentAssignedVehicleMainByVehicleID[0].LastName; intManagerID = TheFindCurrentAssignedVehicleMainByVehicleIDDataSet.FindCurrentAssignedVehicleMainByVehicleID[0].ManagerID; TheFindEnmployeeByEmployeeIDDataSet = TheEmployeeClass.FindEmployeeByEmployeeID(intManagerID); strManager = TheFindEnmployeeByEmployeeIDDataSet.FindEmployeeByEmployeeID[0].FirstName + " "; strManager += TheFindEnmployeeByEmployeeIDDataSet.FindEmployeeByEmployeeID[0].LastName; strInOrOut = "UNKNOWN"; if (TheFindCurrentAssignedVehicleMainByVehicleIDDataSet.FindCurrentAssignedVehicleMainByVehicleID[0].LastName == "WAREHOUSE") { strManager = "FLEET MANAGER"; } TheFindVehicleInShopByVehicleIDDataSet = TheVehiclesInShopClass.FindVehicleMainInShopByVehicleID(intVehicleID); TheFindVehicleInYardByVehicleIDAndDateRangeDataSet = TheVehicleInYardClass.FindVehiclesInYardByVehicleIDAndDateRange(intVehicleID, datStartDate, datEndDate); intRecordsReturned = TheFindVehicleInYardByVehicleIDAndDateRangeDataSet.FindVehiclesInYardByVehicleIDAndDateRange.Rows.Count; if (intRecordsReturned > 0) { strInOrOut = "IN YARD"; } blnItemEntered = false; for (intAutomileCounter = 0; intAutomileCounter <= intAutomileNumberOfRecords; intAutomileCounter++) { strAutomileVehicleNumber = TheAutomileImportDataSet.automileimport[intAutomileCounter].VehicleNumber; blnItemFound = strAutomileVehicleNumber.Contains(strVehicleNumber); if (blnItemFound == true) { strInOrOut = TheAutomileImportDataSet.automileimport[intAutomileCounter].IsInside; if (strInOrOut == "YES") { strInOrOut = "IN YARD"; } else if (strInOrOut == "NO") { strInOrOut = "OUT"; } if (gintThirdCounter > 0) { for (intThirdCounter = 0; gintThirdCounter <= gintThirdNumberOfRecords; intThirdCounter++) { if (strVehicleNumber == TheVehicleCurrentStatusDataSet.vehiclecurrentstatus[intThirdCounter].VehicleNumber) { if (strInOrOut == "YES") { TheVehicleCurrentStatusDataSet.vehiclecurrentstatus[intThirdCounter].InOrOut = "IN YARD"; } else if (strInOrOut == "NO") { TheVehicleCurrentStatusDataSet.vehiclecurrentstatus[intThirdCounter].InOrOut = strInOrOut; } blnItemEntered = true; } } } } } intRecordsReturned = TheFindVehicleInShopByVehicleIDDataSet.FindVehicleMainInShopByVehicleID.Rows.Count; if (intRecordsReturned > 0) { strInOrOut = "IN SHOP"; } if (blnItemEntered == false) { VehicleCurrentStatusDataSet.vehiclecurrentstatusRow NewVehicleRow = TheVehicleCurrentStatusDataSet.vehiclecurrentstatus.NewvehiclecurrentstatusRow(); NewVehicleRow.AssignedOffice = strAssignedOffice; NewVehicleRow.Manager = strManager; NewVehicleRow.Driver = strFullName; NewVehicleRow.InOrOut = strInOrOut; NewVehicleRow.VehicleNumber = strVehicleNumber; TheVehicleCurrentStatusDataSet.vehiclecurrentstatus.Rows.Add(NewVehicleRow); ShortedCurrentVehicleDataSet.shortenlistRow SecondVehicleRow = TheShortedCurrentVehicleDataSet.shortenlist.NewshortenlistRow(); SecondVehicleRow.Driver = strFullName; SecondVehicleRow.VehicleNumber = strVehicleNumber; SecondVehicleRow.InOrOut = strInOrOut; TheShortedCurrentVehicleDataSet.shortenlist.Rows.Add(SecondVehicleRow); } } } TheMessagesClass.InformationMessage("Processing the Report Is Completed"); dgrResults.ItemsSource = TheVehicleCurrentStatusDataSet.vehiclecurrentstatus; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Four Thirty Report // Main Window // Process Expander " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }
private void mitGenerateReport_Click(object sender, RoutedEventArgs e) { int intCounter; int intNumberOfRecords; int intRecordsReturned; DateTime datStartDate; DateTime datEndDated; DateTime datLimitDate; string strAssignedOffice; int intVehicleID; bool blnItemFound; try { TheHistoricalExceptionDataSet.vehicleexception.Rows.Clear(); strAssignedOffice = txtOfficeName.Text; if (strAssignedOffice == "") { TheMessagesClass.ErrorMessage("Assigned Office Was Not Entered"); return; } TheFindVehicleMainForAssignedOfficeDataSet = TheVehicleMainClass.FindVehicleMainForAssignedOffice(strAssignedOffice); intNumberOfRecords = TheFindVehicleMainForAssignedOfficeDataSet.FindVehicleMainForAssignedOffice.Rows.Count - 1; if (intNumberOfRecords < 0) { TheMessagesClass.ErrorMessage("The Assigned Office Does Not Exist"); return; } datLimitDate = DateTime.Now; datLimitDate = TheDateSearchClass.RemoveTime(datLimitDate); datStartDate = TheDateSearchClass.SubtractingDays(datLimitDate, 90); while (datStartDate < datLimitDate) { for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { blnItemFound = false; datEndDated = TheDateSearchClass.AddingDays(datStartDate, 1); intVehicleID = TheFindVehicleMainForAssignedOfficeDataSet.FindVehicleMainForAssignedOffice[intCounter].VehicleID; TheFindDailyVehicleInspectionByVehicleIDAndDateRangeDataSete = TheInspectionClass.FindDailyVehicleInspectionByVehicleIDAndDateRange(intVehicleID, datStartDate, datEndDated); intRecordsReturned = TheFindDailyVehicleInspectionByVehicleIDAndDateRangeDataSete.FindDailyVehicleInspectionsByVehicleIDAndDateRange.Rows.Count; if (intRecordsReturned > 0) { blnItemFound = true; } else { TheFindVehicleInYardByVehicleIDAndDateRangeDataSet = TheVehiclesInYardClass.FindVehiclesInYardByVehicleIDAndDateRange(intVehicleID, datStartDate, datEndDated); intRecordsReturned = TheFindVehicleInYardByVehicleIDAndDateRangeDataSet.FindVehiclesInYardByVehicleIDAndDateRange.Rows.Count; if (intRecordsReturned > 0) { blnItemFound = true; } } if (blnItemFound == false) { HistoricalExceptionsDataSet.vehicleexceptionRow NewVehicleRow = TheHistoricalExceptionDataSet.vehicleexception.NewvehicleexceptionRow(); NewVehicleRow.AssignedOffice = strAssignedOffice; NewVehicleRow.FirstName = TheFindVehicleMainForAssignedOfficeDataSet.FindVehicleMainForAssignedOffice[intCounter].FirstName; NewVehicleRow.LastName = TheFindVehicleMainForAssignedOfficeDataSet.FindVehicleMainForAssignedOffice[intCounter].LastName; NewVehicleRow.InspectionDate = datStartDate; NewVehicleRow.VehicleID = intVehicleID; NewVehicleRow.VehicleNumber = TheFindVehicleMainForAssignedOfficeDataSet.FindVehicleMainForAssignedOffice[intCounter].VehicleNumber; TheHistoricalExceptionDataSet.vehicleexception.Rows.Add(NewVehicleRow); } } datStartDate = TheDateSearchClass.AddingDays(datStartDate, 1); if (datStartDate.DayOfWeek == DayOfWeek.Saturday) { datStartDate = TheDateSearchClass.AddingDays(datStartDate, 2); } else if (datStartDate.DayOfWeek == DayOfWeek.Sunday) { datStartDate = TheDateSearchClass.AddingDays(datStartDate, 1); } } dgrResults.ItemsSource = TheHistoricalExceptionDataSet.vehicleexception; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Historical Vehicle Exception Report // Generate Report " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }
private void expCreateReport_Expanded(object sender, RoutedEventArgs e) { //setting local variables DateTime datStartDate; DateTime datEndDate; DateTime datTransactionDate; DateTime datLimitingDate; int intCounter; int intNumberOfRecords; int intRecordReturned; int intVehicleID; PleaseWait PleaseWait = new PleaseWait(); PleaseWait.Show(); try { TheVehicleUsageDataSet.vehicleusage.Rows.Clear(); expCreateReport.IsExpanded = false; TheFindActiveVehicleMainSortedDataSet = TheVehicleMainClass.FindActiveVehicleMainSorted(); intNumberOfRecords = TheFindActiveVehicleMainSortedDataSet.FindActiveVehicleMainSorted.Rows.Count - 1; for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { VehicleUsageDataSet.vehicleusageRow NewVehicleRow = TheVehicleUsageDataSet.vehicleusage.NewvehicleusageRow(); NewVehicleRow.VehicleID = TheFindActiveVehicleMainSortedDataSet.FindActiveVehicleMainSorted[intCounter].VehicleID; NewVehicleRow.VehicleNumber = TheFindActiveVehicleMainSortedDataSet.FindActiveVehicleMainSorted[intCounter].VehicleNumber; NewVehicleRow.AssignedOffice = TheFindActiveVehicleMainSortedDataSet.FindActiveVehicleMainSorted[intCounter].AssignedOffice; NewVehicleRow.TimesInYard = 0; NewVehicleRow.TimesUnknown = 0; NewVehicleRow.TimesDriven = 0; TheVehicleUsageDataSet.vehicleusage.Rows.Add(NewVehicleRow); } datEndDate = DateTime.Now; datEndDate = TheDateSearchClass.RemoveTime(datEndDate); datStartDate = TheDateSearchClass.SubtractingDays(datEndDate, 120); datTransactionDate = datStartDate; datLimitingDate = TheDateSearchClass.AddingDays(datTransactionDate, 1); intNumberOfRecords = TheVehicleUsageDataSet.vehicleusage.Rows.Count - 1; while (datLimitingDate <= datEndDate) { if (datTransactionDate.DayOfWeek != DayOfWeek.Saturday) { if (datTransactionDate.DayOfWeek != DayOfWeek.Sunday) { for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { intVehicleID = TheVehicleUsageDataSet.vehicleusage[intCounter].VehicleID; TheFindGEOFenceByVehicleIDDataSet = TheGEOFenceClass.FindGEOFenceByVehicleID(intVehicleID, datTransactionDate, datLimitingDate); intRecordReturned = TheFindGEOFenceByVehicleIDDataSet.FindGEOFenceByVehicleID.Rows.Count; if (intRecordReturned > 0) { TheVehicleUsageDataSet.vehicleusage[intCounter].TimesDriven++; } else { TheFindDailyVehicleInspectionByVehicleIDAndDateRangeDataSet = TheInspectionsClass.FindDailyVehicleInspectionByVehicleIDAndDateRange(intVehicleID, datTransactionDate, datLimitingDate); intRecordReturned = TheFindDailyVehicleInspectionByVehicleIDAndDateRangeDataSet.FindDailyVehicleInspectionsByVehicleIDAndDateRange.Rows.Count; if (intRecordReturned > 0) { TheVehicleUsageDataSet.vehicleusage[intCounter].TimesDriven++; } else { TheFindVehicleInYardByVehicleIDAndDateRangeDataSet = TheVehicleInYardClass.FindVehiclesInYardByVehicleIDAndDateRange(intVehicleID, datTransactionDate, datLimitingDate); intRecordReturned = TheFindVehicleInYardByVehicleIDAndDateRangeDataSet.FindVehiclesInYardByVehicleIDAndDateRange.Rows.Count; if (intRecordReturned > 0) { TheVehicleUsageDataSet.vehicleusage[intCounter].TimesInYard++; } else { TheVehicleUsageDataSet.vehicleusage[intCounter].TimesUnknown++; } } } } } } datTransactionDate = TheDateSearchClass.AddingDays(datTransactionDate, 1); datLimitingDate = TheDateSearchClass.AddingDays(datLimitingDate, 1); } dgrResults.ItemsSource = TheVehicleUsageDataSet.vehicleusage; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Vehicle Usage Report // Create Report Expander " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } PleaseWait.Close(); }
private void mitProcess_Click(object sender, RoutedEventArgs e) { //setting local variables string strVehicleNumber; int intRecordsReturned; int intVehicleID; DateTime datTransactionDate; bool blnFatalError = false; DateTime datStartDate = DateTime.Now; DateTime datEndDate = DateTime.Now; try { strVehicleNumber = txtEnterVehicleNumber.Text; datStartDate = TheDateSearchClass.RemoveTime(datStartDate); datEndDate = TheDateSearchClass.AddingDays(datStartDate, 1); if (strVehicleNumber == "") { TheMessagesClass.ErrorMessage("Vehicle Number Was Not Entered"); return; } TheFindActiveVehicleMainByVehicleNumberDataSet = TheVehicleMainClass.FindActiveVehicleMainByVehicleNumber(strVehicleNumber); intRecordsReturned = TheFindActiveVehicleMainByVehicleNumberDataSet.FindActiveVehicleMainByVehicleNumber.Rows.Count; if (intRecordsReturned == 0) { TheMessagesClass.ErrorMessage("The Vehicle Number Entered Does Not Exist"); return; } else if (intRecordsReturned == 1) { intVehicleID = TheFindActiveVehicleMainByVehicleNumberDataSet.FindActiveVehicleMainByVehicleNumber[0].VehicleID; TheFindVehiclesInYardByVehicleIDAndDateRangeDataSet = TheVehicleInYardClass.FindVehiclesInYardByVehicleIDAndDateRange(intVehicleID, datStartDate, datEndDate); intRecordsReturned = TheFindVehiclesInYardByVehicleIDAndDateRangeDataSet.FindVehiclesInYardByVehicleIDAndDateRange.Rows.Count; if (intRecordsReturned > 0) { TheMessagesClass.ErrorMessage("Vehicle Has Already Been Placed In The Yard"); return; } datTransactionDate = DateTime.Now; blnFatalError = TheVehicleInYardClass.InsertVehicleInYard(datTransactionDate, intVehicleID); if (blnFatalError == true) { TheMessagesClass.ErrorMessage("There Was a Problem, Contact IT"); return; } } txtEnterVehicleNumber.Text = ""; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Vehicle In Yard // Process Menu Item " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }
private bool RunVehicleExceptionReport(DateTime datStartDate) { bool blnFatalError = false; int intCounter; int intNumberOfRecords; int intVehicleID; int intRecordsReturned; DateTime datEndDate; string strFirstNamed = ""; string strLastName = ""; try { TheVehicleExceptionDataSet.vehicleexception.Rows.Clear(); datEndDate = TheDateSearchClass.AddingDays(datStartDate, 1); TheFindActiveVehicleMainDataSet = TheVehicleMainClass.FindActiveVehicleMain(); intNumberOfRecords = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain.Rows.Count - 1; for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { intVehicleID = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain[intCounter].VehicleID; TheFindDailyVehicleInspectionByVehicleIDAndDateRangeDataSet = TheInspectionClass.FindDailyVehicleInspectionByVehicleIDAndDateRange(intVehicleID, datStartDate, datEndDate); intRecordsReturned = TheFindDailyVehicleInspectionByVehicleIDAndDateRangeDataSet.FindDailyVehicleInspectionsByVehicleIDAndDateRange.Rows.Count; if (intRecordsReturned == 0) { TheFindVehicleInYardByVehicleIDAndDateRangeDataSet = TheVehicleInYardClass.FindVehiclesInYardByVehicleIDAndDateRange(intVehicleID, datStartDate, datEndDate); intRecordsReturned = TheFindVehicleInYardByVehicleIDAndDateRangeDataSet.FindVehiclesInYardByVehicleIDAndDateRange.Rows.Count; if (intRecordsReturned == 0) { TheFindVehicleInShopByVehicleIDDataSet = TheVehicleInShopClass.FindVehiclesInShopByVehicleID(intVehicleID); intRecordsReturned = TheFindVehicleInShopByVehicleIDDataSet.FindVehiclesInShopByVehicleID.Rows.Count; if (intRecordsReturned == 0) { TheFindcurrentAssignedVehicleMainByVehicleIDDataSet = TheVehicleAssignmentClass.FindCurrentAssignedVehicleMainByVehicleID(intVehicleID); intRecordsReturned = TheFindcurrentAssignedVehicleMainByVehicleIDDataSet.FindCurrentAssignedVehicleMainByVehicleID.Rows.Count; if (intRecordsReturned == 0) { strLastName = "NOT ASSIGNED"; strFirstNamed = "NOT ASSIGNED"; } else { strLastName = TheFindcurrentAssignedVehicleMainByVehicleIDDataSet.FindCurrentAssignedVehicleMainByVehicleID[0].LastName; strFirstNamed = TheFindcurrentAssignedVehicleMainByVehicleIDDataSet.FindCurrentAssignedVehicleMainByVehicleID[0].FirstName; } VehicleExceptionDataSet.vehicleexceptionRow NewVehicleRow = TheVehicleExceptionDataSet.vehicleexception.NewvehicleexceptionRow(); NewVehicleRow.AssignedOffice = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain[intCounter].AssignedOffice; NewVehicleRow.FirstName = strFirstNamed; NewVehicleRow.LastName = strLastName; NewVehicleRow.VehicleID = intVehicleID; NewVehicleRow.VehicleNumber = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain[intCounter].VehicleNumber; TheVehicleExceptionDataSet.vehicleexception.Rows.Add(NewVehicleRow); } } } } } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Automate Vehicle Reports // Run Vehicle Exception Report " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); blnFatalError = true; } return(blnFatalError); }
private void mitGenerateReport_Click(object sender, RoutedEventArgs e) { int intCounter; int intNumberOfRecords; int intVehicleID; int intRecordsReturned; DateTime datStartDate = DateTime.Now; DateTime datEndDate; string strFirstNamed = ""; string strLastName = ""; try { TheVehicleExceptionDataSet.vehicleexception.Rows.Clear(); datStartDate = TheDateSearchClass.RemoveTime(datStartDate); datEndDate = TheDateSearchClass.AddingDays(datStartDate, 1); TheFindActiveVehicleMainDataSet = TheVehicleMainClass.FindActiveVehicleMain(); intNumberOfRecords = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain.Rows.Count - 1; for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { intVehicleID = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain[intCounter].VehicleID; TheFindDailyVehicleInspectionByVehicleIDAndDateRangeDataSete = TheInspectionClass.FindDailyVehicleInspectionByVehicleIDAndDateRange(intVehicleID, datStartDate, datEndDate); intRecordsReturned = TheFindDailyVehicleInspectionByVehicleIDAndDateRangeDataSete.FindDailyVehicleInspectionsByVehicleIDAndDateRange.Rows.Count; if (intRecordsReturned == 0) { TheFindVehicleInYardByVehicleIDAndDateRangeDataSet = TheVehicleInYardClass.FindVehiclesInYardByVehicleIDAndDateRange(intVehicleID, datStartDate, datEndDate); intRecordsReturned = TheFindVehicleInYardByVehicleIDAndDateRangeDataSet.FindVehiclesInYardByVehicleIDAndDateRange.Rows.Count; if (intRecordsReturned == 0) { TheFindVehicleMainInShopByVehicleIDDataSet = TheVehicleInShopClass.FindVehicleMainInShopByVehicleID(intVehicleID); intRecordsReturned = TheFindVehicleMainInShopByVehicleIDDataSet.FindVehicleMainInShopByVehicleID.Rows.Count; if (intRecordsReturned == 0) { TheFindcurrentAssignedVehicleMainByVehicleIDDataSet = TheVehicleAssignmentClass.FindCurrentAssignedVehicleMainByVehicleID(intVehicleID); intRecordsReturned = TheFindcurrentAssignedVehicleMainByVehicleIDDataSet.FindCurrentAssignedVehicleMainByVehicleID.Rows.Count; if (intRecordsReturned == 0) { strLastName = "NOT ASSIGNED"; strFirstNamed = "NOT ASSIGNED"; } else { strLastName = TheFindcurrentAssignedVehicleMainByVehicleIDDataSet.FindCurrentAssignedVehicleMainByVehicleID[0].LastName; strFirstNamed = TheFindcurrentAssignedVehicleMainByVehicleIDDataSet.FindCurrentAssignedVehicleMainByVehicleID[0].FirstName; } VehicleExceptionDataSet.vehicleexceptionRow NewVehicleRow = TheVehicleExceptionDataSet.vehicleexception.NewvehicleexceptionRow(); NewVehicleRow.AssignedOffice = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain[intCounter].AssignedOffice; NewVehicleRow.FirstName = strFirstNamed; NewVehicleRow.LastName = strLastName; NewVehicleRow.VehicleID = intVehicleID; NewVehicleRow.VehicleNumber = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain[intCounter].VehicleNumber; TheVehicleExceptionDataSet.vehicleexception.Rows.Add(NewVehicleRow); } } } } dgrResults.ItemsSource = TheVehicleExceptionDataSet.vehicleexception; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Vehicle Exception Report // Generate The Report Menu Item " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }