private void txtEnterTrailerNumber_TextChanged(object sender, TextChangedEventArgs e) { string strTrailerNumber; int intLength; int intRecordsReturned; strTrailerNumber = txtEnterTrailerNumber.Text; intLength = strTrailerNumber.Length; cboDamageReported.IsEnabled = false; cboSelectEmployee.IsEnabled = false; if ((intLength == 4) || (intLength >= 6)) { TheFindTrailerByTrailerNumberDataSet = TheTrailerClass.FindTrailerByTrailerNumber(strTrailerNumber); intRecordsReturned = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber.Rows.Count; if (intRecordsReturned == 0) { TheMessagesClass.ErrorMessage("Trailer Not Found"); return; } MainWindow.gintTrailerID = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].TrailerID; cboDamageReported.IsEnabled = true; cboSelectEmployee.IsEnabled = true; } }
public FindTrailerByTrailerNumberDataSet FindTrailerByTrailerNumber(string strTrailerNumber) { try { aFindTrailerByTrailerNumberDataSet = new FindTrailerByTrailerNumberDataSet(); aFindTrailerByTrailerNumberTableAdapter = new FindTrailerByTrailerNumberDataSetTableAdapters.FindTrailerByTrailerNumberTableAdapter(); aFindTrailerByTrailerNumberTableAdapter.Fill(aFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber, strTrailerNumber); } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Trailers Class // Find Trailer By Trailer Number " + Ex.Message); } return(aFindTrailerByTrailerNumberDataSet); }
private void txtTrailerNumber_TextChanged(object sender, TextChangedEventArgs e) { int intLength; string strTrailerNumber; int intRecordsReturned; strTrailerNumber = txtTrailerNumber.Text; intLength = strTrailerNumber.Length; if (intLength == 4) { TheFindTrailerByTrailerNumberDataSet = TheTrailersClass.FindTrailerByTrailerNumber(strTrailerNumber); intRecordsReturned = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber.Rows.Count; if (intRecordsReturned > 0) { txtFirstName.Text = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].FirstName; txtLastName.Text = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].LastName; MainWindow.gintTrailerID = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].TrailerID; txtEnterLastName.IsReadOnly = false; } } else if (intLength == 6) { TheFindTrailerByTrailerNumberDataSet = TheTrailersClass.FindTrailerByTrailerNumber(strTrailerNumber); intRecordsReturned = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber.Rows.Count; if (intRecordsReturned > 0) { txtFirstName.Text = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].FirstName; txtLastName.Text = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].LastName; MainWindow.gintTrailerID = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].TrailerID; txtEnterLastName.IsReadOnly = false; } else { TheMessagesClass.ErrorMessage("Trailer Not Found"); } } }
private void btnFind_Click(object sender, RoutedEventArgs e) { string strTrailerNumber; int intRecordsReturned; int intCounter; int intNumberOfRecords; string strFullName; try { strTrailerNumber = txtEnterTrailerNumber.Text; TheOpenTrailerProblemsDataSet.opentrailerproblems.Rows.Clear(); if (strTrailerNumber.Length < 4) { TheMessagesClass.ErrorMessage("The Trailer Number is to Short"); return; } TheFindTrailerByTrailerNumberDataSet = TheTrailersClass.FindTrailerByTrailerNumber(strTrailerNumber); intRecordsReturned = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber.Rows.Count; if (intRecordsReturned < 1) { TheMessagesClass.ErrorMessage("The Trailer Was Not Found"); return; } MainWindow.gintTrailerID = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].TrailerID; TheFindOpenTrailerProblemsByTrailerIDDataSet = TheTrailerProblemClass.FindOpenTrailerProblemsByTrailerID(MainWindow.gintTrailerID); intNumberOfRecords = TheFindOpenTrailerProblemsByTrailerIDDataSet.FindOpenTrailerProblemByTrailerID.Rows.Count; if (intNumberOfRecords > 0) { for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++) { strFullName = TheFindOpenTrailerProblemsByTrailerIDDataSet.FindOpenTrailerProblemByTrailerID[intCounter].FirstName + " "; strFullName += TheFindOpenTrailerProblemsByTrailerIDDataSet.FindOpenTrailerProblemByTrailerID[intCounter].LastName; OpenTrailerProblemsDataSet.opentrailerproblemsRow NewProblemRow = TheOpenTrailerProblemsDataSet.opentrailerproblems.NewopentrailerproblemsRow(); NewProblemRow.Employee = strFullName; NewProblemRow.ProblemID = TheFindOpenTrailerProblemsByTrailerIDDataSet.FindOpenTrailerProblemByTrailerID[intCounter].ProblemID; NewProblemRow.ReportedProblem = TheFindOpenTrailerProblemsByTrailerIDDataSet.FindOpenTrailerProblemByTrailerID[intCounter].ProblemReported; NewProblemRow.TransactionDate = TheFindOpenTrailerProblemsByTrailerIDDataSet.FindOpenTrailerProblemByTrailerID[intCounter].TransactionDate; TheOpenTrailerProblemsDataSet.opentrailerproblems.Rows.Add(NewProblemRow); } } dgrProblems.ItemsSource = TheOpenTrailerProblemsDataSet.opentrailerproblems; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Update Trailer Problems // Find Button " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }
private void mitSave_Click(object sender, RoutedEventArgs e) { //setting local variables string strTrailerNumber; string strVINNumber; string strTrailerDescription; string strLicensePlate; string strTrailerNotes; int intRecordsReturned; bool blnFatalError = false; string strErrorMessage = ""; try { strTrailerNumber = txtTrailerNumber.Text; if (strTrailerNumber == "") { blnFatalError = true; strErrorMessage += "Trailer Number Was Not Entered\n"; } else { TheFindTrailerByTrailerNumberDataSet = TheTrailersClass.FindTrailerByTrailerNumber(strTrailerNumber); intRecordsReturned = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber.Rows.Count; if (intRecordsReturned > 0) { blnFatalError = true; strErrorMessage += "Trailer Number is Already Used\n"; } } if (cboTrailerCategory.SelectedIndex < 1) { blnFatalError = true; strErrorMessage += "The Trailer Type Was Not Selected\n"; } strVINNumber = txtVINNUmber.Text; if (strVINNumber == "") { blnFatalError = true; strErrorMessage += "VIN Number Was Not Entered\n"; } strTrailerDescription = txtDescription.Text; if (strTrailerDescription == "") { blnFatalError = true; strErrorMessage += "The Trailer Description Was Not Entered\n"; } strLicensePlate = txtLicensePlate.Text; if (strLicensePlate == "") { blnFatalError = true; strErrorMessage += "The License Plate Was Not Entered\n"; } if (cboAssignedWarehouse.SelectedIndex < 1) { blnFatalError = true; strErrorMessage += "The Trailer Was Not Assigned a Warehouse\n"; } strTrailerNotes = txtTrailerNotes.Text; if (strTrailerNotes == "") { strTrailerNotes = "NO NOTES ENTERED"; } if (blnFatalError == true) { TheMessagesClass.ErrorMessage(strErrorMessage); return; } //inserting the trailer blnFatalError = TheTrailersClass.InsertTrailer(strTrailerNumber, gintCategoryID, strVINNumber, strTrailerDescription, strLicensePlate, MainWindow.gintWarehouseID, MainWindow.gintWarehouseID, strTrailerNotes); if (blnFatalError == true) { throw new Exception(); } TheMessagesClass.InformationMessage("The Trailer has been Added"); LoadCategoryCombo(); LoadWarehouseCombo(); ClearTextBoxes(); } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Add Trailers // Save Menu Item " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }
private void btnFind_Click(object sender, RoutedEventArgs e) { //setting variables string strTrailerNumber; int intRecordsReturned; string strTrailerCategory; int intLocationID; bool blnActive; int intCounter; int intNumberOfRecords; try { strTrailerNumber = txtEnterTrailerNumber.Text; if (strTrailerNumber == "") { TheMessagesClass.ErrorMessage("Trailer Number Was Not Entered"); return; } TheFindTrailerByTrailerNumberDataSet = TheTrailersClass.FindTrailerByTrailerNumber(strTrailerNumber); intRecordsReturned = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber.Rows.Count; if (intRecordsReturned == 0) { TheMessagesClass.ErrorMessage("Trailer Was Not Found"); return; } txtTrailerID.Text = Convert.ToString(TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].TrailerID); txtTrailerDescription.Text = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].TrailerDescription; strTrailerCategory = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].TrailerCategory; intNumberOfRecords = TheFindSortedTrailerCategoryDataSet.FindSortedTrailerCategory.Rows.Count - 1; for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { if (strTrailerCategory == TheFindSortedTrailerCategoryDataSet.FindSortedTrailerCategory[intCounter].TrailerCategory) { cboTrailerCategory.SelectedIndex = intCounter + 1; } } txtVINNumber.Text = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].VINNumber; txtLicensePlate.Text = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].LicensePlate; txtTrailerNotes.Text = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].TrailerNotes; intLocationID = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].LocationID; intNumberOfRecords = MainWindow.TheFindWarehousesDataSet.FindWarehouses.Rows.Count - 1; for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { if (intLocationID == MainWindow.TheFindWarehousesDataSet.FindWarehouses[intCounter].EmployeeID) { cboLocation.SelectedIndex = intCounter + 1; } } blnActive = TheFindTrailerByTrailerNumberDataSet.FindTrailerByTrailerNumber[0].TrailerActive; if (blnActive == true) { cboActive.SelectedIndex = 1; } else if (blnActive == false) { cboActive.SelectedIndex = 2; } } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Edit Trailer // Find Button " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }