private void btnFindTool_Click(object sender, RoutedEventArgs e) { string strToolID; int intRecordsReturned; int intToolKey; int intCounter; int intNumberOfRecords; try { TheOpenToolProblemsDataSet.opentoolproblems.Rows.Clear(); strToolID = txtEnterToolID.Text; TheFindToolByToolIDDataSet = TheToolsClass.FindAToolByToolID(strToolID); intRecordsReturned = TheFindToolByToolIDDataSet.FindToolByToolID.Rows.Count; if (intRecordsReturned < 1) { TheMessagesClass.ErrorMessage("The Tool Was Not Found"); return; } txtDescription.Text = TheFindToolByToolIDDataSet.FindToolByToolID[0].ToolDescription; intToolKey = TheFindToolByToolIDDataSet.FindToolByToolID[0].ToolKey; TheFindToolProblemByTookKeyDataSet = TheToolProblemClass.FindToolProblemByToolKey(intToolKey); intNumberOfRecords = TheFindToolProblemByTookKeyDataSet.FindToolProblemByToolKey.Rows.Count; if (intNumberOfRecords > 0) { for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++) { OpenToolProblemsDataSet.opentoolproblemsRow NewToolProblem = TheOpenToolProblemsDataSet.opentoolproblems.NewopentoolproblemsRow(); NewToolProblem.ProblemID = TheFindToolProblemByTookKeyDataSet.FindToolProblemByToolKey[intCounter].ProblemID; NewToolProblem.ReportedDate = TheFindToolProblemByTookKeyDataSet.FindToolProblemByToolKey[intCounter].TransactionDate; NewToolProblem.ReportedProblem = TheFindToolProblemByTookKeyDataSet.FindToolProblemByToolKey[intCounter].WarehouseStatement; TheOpenToolProblemsDataSet.opentoolproblems.Rows.Add(NewToolProblem); } } dgrpProblems.ItemsSource = TheOpenToolProblemsDataSet.opentoolproblems; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Update Tool Problem // Find Tool Button " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }
public FindToolByToolIDDataSet FindAToolByToolID(string strToolID) { try { aFindToolByToolIDDataSet = new FindToolByToolIDDataSet(); aFindToolByToolIDTableAdapter = new FindToolByToolIDDataSetTableAdapters.FindToolByToolIDTableAdapter(); aFindToolByToolIDTableAdapter.Fill(aFindToolByToolIDDataSet.FindToolByToolID, strToolID); } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Tools Class // Find Tool By Tool ID " + Ex.Message); } return(aFindToolByToolIDDataSet); }