Example #1
0
        public FindEmployeeProjectAssignmentByTaskIDDataSet FindEmployeeProjectAssignementByTaskID(int intTaskID)
        {
            try
            {
                aFindEmployeeProjectAssignmentByTaskIDDataSet      = new FindEmployeeProjectAssignmentByTaskIDDataSet();
                aFindEmployeeProjectAssignmentByTaskIDTableAdapter = new FindEmployeeProjectAssignmentByTaskIDDataSetTableAdapters.FindEmployeeProjectAssignmentByTaskIDTableAdapter();
                aFindEmployeeProjectAssignmentByTaskIDTableAdapter.Fill(aFindEmployeeProjectAssignmentByTaskIDDataSet.FindEmployeeProjectAssignmentByTaskID, intTaskID);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Employee project Assignment Class // Find Employee Project Assignement By Task ID " + Ex.Message);
            }

            return(aFindEmployeeProjectAssignmentByTaskIDDataSet);
        }
        private void mitProcess_Click(object sender, RoutedEventArgs e)
        {
            //setting variables
            int  intTaskCounter;
            int  intTaskNumberOfRecords;
            int  intTaskID;
            int  intEmployeeCounter;
            int  intEmployeeNumberOfRecords;
            int  intTransactionID;
            bool blnFatalError = false;

            PleaseWait PleaseWait = new PleaseWait();

            PleaseWait.Show();

            try
            {
                intTaskNumberOfRecords = TheOldWorkTasksDataSet.worktask.Rows.Count - 1;

                for (intTaskCounter = 0; intTaskCounter <= intTaskNumberOfRecords; intTaskCounter++)
                {
                    if (TheOldWorkTasksDataSet.worktask[intTaskCounter].ChangeItems == true)
                    {
                        intTaskID = TheOldWorkTasksDataSet.worktask[intTaskCounter].WorkTaskID;

                        TheFindEmployeeProjectAssignmentByTaskIDDataSet = TheEmployeeProjectAssignmentClass.FindEmployeeProjectAssignementByTaskID(intTaskID);

                        intEmployeeNumberOfRecords = TheFindEmployeeProjectAssignmentByTaskIDDataSet.FindEmployeeProjectAssignmentByTaskID.Rows.Count - 1;

                        for (intEmployeeCounter = 0; intEmployeeCounter <= intEmployeeNumberOfRecords; intEmployeeCounter++)
                        {
                            intTransactionID = TheFindEmployeeProjectAssignmentByTaskIDDataSet.FindEmployeeProjectAssignmentByTaskID[intEmployeeCounter].TransactionID;

                            blnFatalError = TheEmployeeProjectAssignmentClass.UpdateEmployeeProjectAssignmentTaskID(intTransactionID, gintNewTaskID);

                            if (blnFatalError == true)
                            {
                                throw new Exception();
                            }
                        }

                        blnFatalError = TheWorkTaskClass.UpdateWorkTaskActive(intTaskID, false);

                        TheFindProjectTaskByTaskIDDataSet = TheProjectTaskClass.FindProjectTaskByTaskID(intTaskID);

                        intEmployeeNumberOfRecords = TheFindProjectTaskByTaskIDDataSet.FindProjectTaskByTaskID.Rows.Count - 1;

                        for (intEmployeeCounter = 0; intEmployeeCounter <= intEmployeeNumberOfRecords; intEmployeeCounter++)
                        {
                            intTransactionID = TheFindProjectTaskByTaskIDDataSet.FindProjectTaskByTaskID[intEmployeeCounter].TransactionID;

                            blnFatalError = TheProjectTaskClass.UpdateProjectTaskID(intTransactionID, intTaskCounter);

                            if (blnFatalError == true)
                            {
                                throw new Exception();
                            }
                        }
                    }
                }

                TheMessagesClass.InformationMessage("All Tasks Have Been Updated");
                TheOldWorkTasksDataSet.worktask.Rows.Clear();
                dgrOldTasks.ItemsSource             = TheOldWorkTasksDataSet.worktask;
                TheFindWorktaskByTaskKeywordDataSet = TheWorkTaskClass.FindWorkTaskByTaskKeyword("llllllllll");
                dgrNewTask.ItemsSource = TheFindWorktaskByTaskKeywordDataSet.FindWorkTaskByTaskKeyword;
                txtNewTask.Text        = "";
                txtOldTaskName.Text    = "";
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Edit Project Work Task // Process Menu Item " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }

            PleaseWait.Close();
        }