Ejemplo n.º 1
0
        public void updateDatabase()
        {
            if (beenChanged)
            {
                AssignedTaskTableAdapter taskAdapter            = new AssignedTaskTableAdapter();
                NuRacingDataSet.AssignedTaskDataTable taskTable = taskAdapter.GetAssignedTask(taskID);
                NuRacingDataSet.AssignedTaskRow       taskRow   = (NuRacingDataSet.AssignedTaskRow)taskTable.Rows[0];
                taskRow.WorkType_UID        = workTypeID;
                taskRow.Task_Name           = taskName;
                taskRow.Task_Description    = taskDescription;
                taskRow.Task_TakeFiveNeeded = takeFiveNeeded;
                taskRow.Task_DueDate        = dueDate;

                if (taskStatus != null)
                {
                    taskRow.Task_Status = taskStatus;
                }

                if (taskIncompleteReason != null)
                {
                    taskRow.Task_IncompleteReason = taskIncompleteReason;
                }

                taskAdapter.Update(taskTable);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Return a TaskInfo object via specified assignedTaskID
        /// </summary>
        /// <param name="assignedTaskID"></param>
        /// <returns></returns>

        public static TaskInfo getAssignedTask(int assignedTaskID)
        {
            AssignedTaskTableAdapter assignedTaskAdapter = new AssignedTaskTableAdapter();

            NuRacingDataSet.AssignedTaskDataTable assignedTaskTable = assignedTaskAdapter.GetAssignedTask(assignedTaskID);

            if (assignedTaskTable.Rows.Count == 0)
            {
                throw new ArgumentException("Assigned Task Doesn't Exist");
            }

            return(new TaskInfo((NuRacingDataSet.AssignedTaskRow)assignedTaskTable.Rows[0]));
        }
Ejemplo n.º 3
0
        public void resetData()
        {
            if (!beenChanged)
            {
                AssignedTaskTableAdapter assignedTaskAdapter            = new AssignedTaskTableAdapter();
                NuRacingDataSet.AssignedTaskDataTable assignedTaskTable = assignedTaskAdapter.GetAssignedTask(taskID);
                NuRacingDataSet.AssignedTaskRow       taskRow           = (NuRacingDataSet.AssignedTaskRow)assignedTaskTable.Rows[0];

                assigningUserInfo = UserInfo.getUser(taskRow.User_Username_AssignedBy);

                taskID = taskRow.Task_UID;

                workTypeID = taskRow.WorkType_UID;

                taskName = taskRow.Task_Name;

                taskDescription = taskRow.Task_Description;

                takeFiveNeeded = taskRow.Task_TakeFiveNeeded;

                if (!taskRow.IsTask_StatusNull())
                {
                    taskStatus = taskRow.Task_Status;

                    if (!taskRow.IsTask_IncompleteReasonNull())
                    {
                        taskIncompleteReason = taskRow.Task_IncompleteReason;
                    }
                }

                dueDate = taskRow.Task_DueDate;

                AssignedUserTableAdapter assignedUserAdapter            = new AssignedUserTableAdapter();
                NuRacingDataSet.AssignedUserDataTable assignedUserTable = assignedUserAdapter.GetDataByTaskID(TaskID);

                userAssignedInfo = new List <UserInfo>(assignedUserTable.Rows.Count);

                foreach (NuRacingDataSet.AssignedUserRow assignedUserRow in assignedUserTable.Rows)
                {
                    userAssignedInfo.Add(UserInfo.getUser(assignedUserRow.User_Username));
                }
            }
        }
Ejemplo n.º 4
0
        public void updateDatabase()
        {
            if (beenChanged)
            {
                AssignedTaskTableAdapter taskAdapter = new AssignedTaskTableAdapter();
                NuRacingDataSet.AssignedTaskDataTable taskTable = taskAdapter.GetAssignedTask(taskID);
                NuRacingDataSet.AssignedTaskRow taskRow = (NuRacingDataSet.AssignedTaskRow)taskTable.Rows[0];
                taskRow.WorkType_UID = workTypeID;
                taskRow.Task_Name = taskName;
                taskRow.Task_Description = taskDescription;
                taskRow.Task_TakeFiveNeeded = takeFiveNeeded;
                taskRow.Task_DueDate = dueDate;

                if (taskStatus != null)
                {
                    taskRow.Task_Status = taskStatus;
                }

                if (taskIncompleteReason != null)
                {
                    taskRow.Task_IncompleteReason = taskIncompleteReason;
                }

                taskAdapter.Update(taskTable);
            }
        }
Ejemplo n.º 5
0
        public void resetData()
        {
            if (!beenChanged)
            {
                AssignedTaskTableAdapter assignedTaskAdapter = new AssignedTaskTableAdapter();
                NuRacingDataSet.AssignedTaskDataTable assignedTaskTable = assignedTaskAdapter.GetAssignedTask(taskID);
                NuRacingDataSet.AssignedTaskRow taskRow = (NuRacingDataSet.AssignedTaskRow)assignedTaskTable.Rows[0];

                assigningUserInfo = UserInfo.getUser(taskRow.User_Username_AssignedBy);

                taskID = taskRow.Task_UID;

                workTypeID = taskRow.WorkType_UID;

                taskName = taskRow.Task_Name;

                taskDescription = taskRow.Task_Description;

                takeFiveNeeded = taskRow.Task_TakeFiveNeeded;

                if (!taskRow.IsTask_StatusNull())
                {
                    taskStatus = taskRow.Task_Status;

                    if (!taskRow.IsTask_IncompleteReasonNull())
                    {
                        taskIncompleteReason = taskRow.Task_IncompleteReason;
                    }
                }

                dueDate = taskRow.Task_DueDate;

                AssignedUserTableAdapter assignedUserAdapter = new AssignedUserTableAdapter();
                NuRacingDataSet.AssignedUserDataTable assignedUserTable = assignedUserAdapter.GetDataByTaskID(TaskID);

                userAssignedInfo = new List<UserInfo>(assignedUserTable.Rows.Count);

                foreach (NuRacingDataSet.AssignedUserRow assignedUserRow in assignedUserTable.Rows)
                {
                    userAssignedInfo.Add(UserInfo.getUser(assignedUserRow.User_Username));
                }
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Return a TaskInfo object via specified assignedTaskID
        /// </summary>
        /// <param name="assignedTaskID"></param>
        /// <returns></returns>
        public static TaskInfo getAssignedTask(int assignedTaskID)
        {
            AssignedTaskTableAdapter assignedTaskAdapter = new AssignedTaskTableAdapter();

            NuRacingDataSet.AssignedTaskDataTable assignedTaskTable = assignedTaskAdapter.GetAssignedTask(assignedTaskID);

            if (assignedTaskTable.Rows.Count == 0)
            {
                throw new ArgumentException("Assigned Task Doesn't Exist");
            }

            return new TaskInfo((NuRacingDataSet.AssignedTaskRow)assignedTaskTable.Rows[0]);
        }