public FindWorkTaskDepartmentForBusinessLineDataSet FindWorkTaskDepartmentForBusienssLine(int intBusinessLineID, int intWorkTaskID) { try { aFindWorkTaskDepartmentForBusinessLineDataSet = new FindWorkTaskDepartmentForBusinessLineDataSet(); aFindWorkTaskDepartmentForBusinessLineTableAdapter = new FindWorkTaskDepartmentForBusinessLineDataSetTableAdapters.FindWorkTaskDepartmentForBusinessLineTableAdapter(); aFindWorkTaskDepartmentForBusinessLineTableAdapter.Fill(aFindWorkTaskDepartmentForBusinessLineDataSet.FindWorkTaskDepartmentForBusinessLine, intBusinessLineID, intWorkTaskID); } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Work Task Class // Find Work Task Department For Business Line " + Ex.Message); } return(aFindWorkTaskDepartmentForBusinessLineDataSet); }
private void cboSelectBusinessLine_SelectionChanged(object sender, SelectionChangedEventArgs e) { int intSelectedIndex; int intDepartmentID; int intCounter; int intNumberOfNumber; int intWorkTaskID; int intBusinessLineID; string strDescription = ""; string strDepartment = ""; string strWorkTask; int intRecordsReturned; try { intSelectedIndex = cboSelectBusinessLine.SelectedIndex - 1; TheDepartmentWorkTaskDataSet.worktask.Rows.Clear(); if (intSelectedIndex > -1) { intBusinessLineID = TheFindSortedCustomerLinesDataSEt.FindSortedCustomerLines[intSelectedIndex].DepartmentID; TheFindWorkTaskByDepartmentDataSet = TheWorkTaskClass.FindWorkTaskByDepartment(intBusinessLineID); intNumberOfNumber = TheFindWorkTaskByDepartmentDataSet.FindWorkTaskByDepartment.Rows.Count; if (intNumberOfNumber > 0) { for (intCounter = 0; intCounter < intNumberOfNumber; intCounter++) { intWorkTaskID = TheFindWorkTaskByDepartmentDataSet.FindWorkTaskByDepartment[intCounter].WorkTaskID; strWorkTask = TheFindWorkTaskByDepartmentDataSet.FindWorkTaskByDepartment[intCounter].WorkTask; TheFindWorkTaskImportByWorkTaskIDDataSet = TheWorkTaskClass.FindWorkTaskImportByWorkTaskID(intWorkTaskID); intRecordsReturned = TheFindWorkTaskImportByWorkTaskIDDataSet.FindWorkTaskImportByWorkTaskID.Rows.Count; if (intRecordsReturned == 0) { strDescription = ""; } else if (intRecordsReturned > 0) { strDescription = TheFindWorkTaskImportByWorkTaskIDDataSet.FindWorkTaskImportByWorkTaskID[0].ItemDescription; } TheFindWorkTaskDepartmentForBusinessLineDataSet = TheWorkTaskClass.FindWorkTaskDepartmentForBusienssLine(intBusinessLineID, intWorkTaskID); intRecordsReturned = TheFindWorkTaskDepartmentForBusinessLineDataSet.FindWorkTaskDepartmentForBusinessLine.Rows.Count; if (intRecordsReturned > 1) { strDepartment = "BOTH"; } else if (intRecordsReturned == 1) { intDepartmentID = TheFindWorkTaskDepartmentForBusinessLineDataSet.FindWorkTaskDepartmentForBusinessLine[0].DepartmentID; TheFindDepartmentByDepartmentIDDataSet = TheDepartmentClass.FindDepartmentByDepartmentID(intDepartmentID); strDepartment = TheFindDepartmentByDepartmentIDDataSet.FindDepartmentByDepartmentID[0].Department; } DepartmentWorkTaskDataSet.worktaskRow NewWorkTask = TheDepartmentWorkTaskDataSet.worktask.NewworktaskRow(); NewWorkTask.Department = strDepartment; NewWorkTask.Description = strDescription; NewWorkTask.WorkTask = strWorkTask; TheDepartmentWorkTaskDataSet.worktask.Rows.Add(NewWorkTask); } } dgrWorkTasks.ItemsSource = TheDepartmentWorkTaskDataSet.worktask; } } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Sorted Work Task Report // Select Business Line Combo Box " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }