public FindEmployeesForDataEntryForLastYearDataSet FindEmployeesForDataEntryForLastYear(DateTime datStartDate, string strLastName) { try { aFindEmployeesForDataEntryForLastYearDataSet = new FindEmployeesForDataEntryForLastYearDataSet(); aFindEmployeesForDataEntryForLastYearTableAdapter = new FindEmployeesForDataEntryForLastYearDataSetTableAdapters.FindEmployeesForDataEntryForLastYearTableAdapter(); aFindEmployeesForDataEntryForLastYearTableAdapter.Fill(aFindEmployeesForDataEntryForLastYearDataSet.FindEmployeesForDataEntryForLastYear, datStartDate, strLastName); } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Employee Class // Find Employees For Data entry For Last Year " + Ex.Message); } return(aFindEmployeesForDataEntryForLastYearDataSet); }
private void txtInspectorLTName_TextChanged(object sender, TextChangedEventArgs e) { string strLastName; int intCounter; int intNumberOfRecords; int intLength; DateTime datStartDate = DateTime.Now; try { strLastName = txtInspectorLTName.Text; intLength = strLastName.Length; cboSelectInspector.Items.Clear(); cboSelectInspector.Items.Add("Select Inspector"); datStartDate = TheDateSearchClass.SubtractingDays(datStartDate, 365); if (intLength > 2) { TheFindInspectorEmployeesForDataEntryForLastYearDataEntryDataSet = TheEmployeeClass.FindEmployeesForDataEntryForLastYear(datStartDate, strLastName); intNumberOfRecords = TheFindInspectorEmployeesForDataEntryForLastYearDataEntryDataSet.FindEmployeesForDataEntryForLastYear.Rows.Count - 1; if (intNumberOfRecords < 0) { TheMessagesClass.ErrorMessage("Inspector Not Found"); return; } for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { cboSelectInspector.Items.Add(TheFindInspectorEmployeesForDataEntryForLastYearDataEntryDataSet.FindEmployeesForDataEntryForLastYear[intCounter].FullName); } cboSelectInspector.SelectedIndex = 0; } } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Create JSI Entry // Inspector LT Name Text Box " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }
private void txtLastName_TextChanged(object sender, TextChangedEventArgs e) { //setting up local variables int intCounter; int intNumberOfRecords; int intLength; string strLastName; string strAssignedProjectID; int intRecordsReturned; DateTime datStartDate = DateTime.Now; try { strLastName = txtLastName.Text; intLength = strLastName.Length; datStartDate = TheDateSearchClass.SubtractingDays(datStartDate, 365); if (intLength > 2) { //getting the project id strAssignedProjectID = txtAssignedProjectID.Text; TheFindProjectMatrixByCustomerProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByCustomerProjectID(strAssignedProjectID); intRecordsReturned = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID.Rows.Count; if (intRecordsReturned < 1) { TheFindProjectMatrixByAssignedProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByAssignedProjectID(strAssignedProjectID); intRecordsReturned = TheFindProjectMatrixByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID.Rows.Count; if (intRecordsReturned > 0) { MainWindow.gintProjectID = TheFindProjectMatrixByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID[0].ProjectID; } else if (intRecordsReturned < 1) { TheMessagesClass.ErrorMessage("The Assigned Project ID Does Not Exist"); return; } } else { MainWindow.gintProjectID = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID[0].ProjectID; } cboSelectEmployee.Items.Clear(); cboSelectEmployee.Items.Add("Select Employee"); TheFindEmployeesForDataEntryForLastYearDataSet = TheEmployeeClass.FindEmployeesForDataEntryForLastYear(datStartDate, strLastName); intNumberOfRecords = TheFindEmployeesForDataEntryForLastYearDataSet.FindEmployeesForDataEntryForLastYear.Rows.Count - 1; if (intNumberOfRecords < 0) { TheMessagesClass.ErrorMessage("The Employee Was Not Found"); cboSelectEmployee.SelectedIndex = 0; return; } for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { cboSelectEmployee.Items.Add(TheFindEmployeesForDataEntryForLastYearDataSet.FindEmployeesForDataEntryForLastYear[intCounter].FullName); } cboSelectEmployee.SelectedIndex = 0; } } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Create JSI Entry // Last Name Text Change " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }