示例#1
0
        public void CreateTaskStatus(Model.TaskStatus TaskStatus)
        {
            Model.TaskStatus Exists = TaskStatusRepository.Get(x => x.Status == TaskStatus.Status).FirstOrDefault();
            if (Exists != null)
            {
                throw new Exception("Status already Exists!");
            }

            TaskStatusRepository.Add(TaskStatus);
            SaveTaskStatus();
        }
        private void HideCusstomeTasks(TaskStatus taskStatus)
        {
            foreach (var @group in Groups)
            {
                var tmpTasks = new List<UserTask>();
                foreach (var userTask in @group.UserTasks.Where(userTask => @userTask.TaskStatus == taskStatus))
                {
                    if (!Trash.Contains(userTask))
                    {
                        Trash.Add(userTask);
                    }
                    tmpTasks.Add(userTask);
                }

                foreach (var userTask in tmpTasks)
                {
                    @group.UserTasks.Remove(userTask);
                }
                
            }
        }
示例#3
0
 public Model.TaskStatus GetTaskStatusByID(int ID)
 {
     Model.TaskStatus TaskStatus = TaskStatusRepository.GetByID(ID);
     return(TaskStatus);
 }
        private void ShowCusstomeTasks(TaskStatus taskStatus)
        {
            foreach (var userTask in Trash.Where(p=>p.TaskStatus == taskStatus).ToList())
            {
                var group = Groups.FirstOrDefault(p => p.Name == userTask.Group);
                var myTasksGroup = Groups.FirstOrDefault(p=>p.Name == _undeleteGroups[2]);
                myTasksGroup?.UserTasks.Add(userTask);
                @group?.UserTasks.Add(userTask);
                CheckDate(userTask);
                Trash.Remove(userTask);

            }
        }