public FindSortedPhoneListOnlyDataSet FindSortedPhoneListOnly() { try { aFindSortedPhoneListOnlyDataSet = new FindSortedPhoneListOnlyDataSet(); aFindSortedPhoneListOnlyTableAdapter = new FindSortedPhoneListOnlyDataSetTableAdapters.FindSortedPhoneListOnlyTableAdapter(); aFindSortedPhoneListOnlyTableAdapter.Fill(aFindSortedPhoneListOnlyDataSet.FindSortedPhoneListOnly); } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Phones Class // Find Sorted Phone List Only " + Ex.Message); } return(aFindSortedPhoneListOnlyDataSet); }
private void ResetControls() { int intCounter; int intNumberOfRecords; int intRecordsReturned; string strCellNumber = ""; string strPhoneExtension; string strFirstName; string strLastName; string strHomeOffice; string strDirectNumber; int intEmployeeID; try { TheCompletePhoneListDataSet.completephonelist.Rows.Clear(); TheFindSortedPhoneListOnlyDataSet = ThePhonesClass.FindSortedPhoneListOnly(); intNumberOfRecords = TheFindSortedPhoneListOnlyDataSet.FindSortedPhoneListOnly.Rows.Count; for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++) { strPhoneExtension = Convert.ToString(TheFindSortedPhoneListOnlyDataSet.FindSortedPhoneListOnly[intCounter].Extension); strFirstName = TheFindSortedPhoneListOnlyDataSet.FindSortedPhoneListOnly[intCounter].FirstName; strLastName = TheFindSortedPhoneListOnlyDataSet.FindSortedPhoneListOnly[intCounter].LastName; strHomeOffice = TheFindSortedPhoneListOnlyDataSet.FindSortedPhoneListOnly[intCounter].HomeOffice; strDirectNumber = TheFindSortedPhoneListOnlyDataSet.FindSortedPhoneListOnly[intCounter].DirectNumber; intEmployeeID = TheFindSortedPhoneListOnlyDataSet.FindSortedPhoneListOnly[intCounter].EmployeeID; TheFindCellPhoneByEmployeeIDDataSet = ThePhonesClass.FindCellPhoneByEmployeeID(intEmployeeID); intRecordsReturned = TheFindCellPhoneByEmployeeIDDataSet.FindCellPhoneByEmployeeID.Rows.Count; if (intRecordsReturned < 1) { strCellNumber = " "; } else if (intRecordsReturned > 0) { strCellNumber = TheFindCellPhoneByEmployeeIDDataSet.FindCellPhoneByEmployeeID[0].PhoneNumber; } if (strFirstName == "OPEN") { strCellNumber = " "; strDirectNumber = " "; } if (strDirectNumber == "NONE") { strDirectNumber = " "; } CompletePhoneListDataSet.completephonelistRow NewPhoneRow = TheCompletePhoneListDataSet.completephonelist.NewcompletephonelistRow(); NewPhoneRow.CellNumber = strCellNumber; NewPhoneRow.DirectNumber = strDirectNumber; NewPhoneRow.Extension = strPhoneExtension; NewPhoneRow.FirstName = strFirstName; NewPhoneRow.HomeOffice = strHomeOffice; NewPhoneRow.LastName = strLastName; TheCompletePhoneListDataSet.completephonelist.Rows.Add(NewPhoneRow); } dgrPhoneList.ItemsSource = TheCompletePhoneListDataSet.completephonelist; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Phone List // Reset Controls " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }