Beispiel #1
0
        private void cboSelectTask_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int    intSelectedInndex;
            int    intCounter;
            int    intNumberOfRecords;
            int    intDepartmentID;
            string strFunction;

            try
            {
                intSelectedInndex = cboSelectTask.SelectedIndex - 1;

                if (intSelectedInndex > -1)
                {
                    MainWindow.gintWorkTaskID = TheFindWorkTaskByTaskKeywordDataSet.FindWorkTaskByTaskKeyword[intSelectedInndex].WorkTaskID;

                    TheWorkTaskAssignedDataSet.worktaskassigned.Rows.Clear();

                    txtWorkTask.Text = TheFindWorkTaskByTaskKeywordDataSet.FindWorkTaskByTaskKeyword[intSelectedInndex].WorkTask;

                    TheFindWorkTaskDepartmentByWorkTaskDataSet = TheWorkTaskClass.FindWorkTaskDepartmentByWorkTask(MainWindow.gintWorkTaskID);

                    intNumberOfRecords = TheFindWorkTaskDepartmentByWorkTaskDataSet.FindWorkTaskDepartmentByWorkTask.Rows.Count;

                    if (intNumberOfRecords > 0)
                    {
                        for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                        {
                            intDepartmentID = TheFindWorkTaskDepartmentByWorkTaskDataSet.FindWorkTaskDepartmentByWorkTask[intCounter].DepartmentID;

                            TheFindDepartmentByDepartmentIDDataSet = TheDepartmentClass.FindDepartmentByDepartmentID(intDepartmentID);

                            strFunction = TheFindDepartmentByDepartmentIDDataSet.FindDepartmentByDepartmentID[0].Department;

                            WorkTaskAssignedDataSet.worktaskassignedRow NewTaskRow = TheWorkTaskAssignedDataSet.worktaskassigned.NewworktaskassignedRow();

                            NewTaskRow.BusinessLine  = TheFindWorkTaskDepartmentByWorkTaskDataSet.FindWorkTaskDepartmentByWorkTask[intCounter].BusinessLine;
                            NewTaskRow.Function      = strFunction;
                            NewTaskRow.WorkTask      = TheFindWorkTaskDepartmentByWorkTaskDataSet.FindWorkTaskDepartmentByWorkTask[intCounter].WorkTask;
                            NewTaskRow.WorkTaskID    = TheFindWorkTaskDepartmentByWorkTaskDataSet.FindWorkTaskDepartmentByWorkTask[intCounter].WorkTaskID;
                            NewTaskRow.TransactionID = TheFindWorkTaskDepartmentByWorkTaskDataSet.FindWorkTaskDepartmentByWorkTask[intCounter].TransactionID;

                            TheWorkTaskAssignedDataSet.worktaskassigned.Rows.Add(NewTaskRow);
                        }

                        dgrWorkTasks.ItemsSource = TheWorkTaskAssignedDataSet.worktaskassigned;
                    }
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Assign Work Task Business Line // Select Task Combo Box " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
Beispiel #2
0
        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());
            }
        }