Пример #1
0
 public DailyTooDueListService(
     ITaskItemRepository taskItemRepository,
     IDailyTooDueListRepository dailyTooDueListRepository)
 {
     _taskItemRepository        = taskItemRepository;
     _dailyTooDueListRepository = dailyTooDueListRepository;
 }
 public TaskListsController(ITaskListRepository iTLRepo, IInventoryTaskItemRepository iTaskRepo, IInventoryRepository invRepo, ITaskItemRepository taskRepo)
 {
     _tlRepo      = iTLRepo;
     _iTaskRepo   = iTaskRepo;
     _invRepo     = invRepo;
     _genTaskRepo = taskRepo;
 }
Пример #3
0
 public OverviewHelper(ITaskItemRepository taskItemRepository)
 {
     this.taskItemRepository = taskItemRepository;
     releaseRepository       = new ReleaseRepository();
     leadTimeHelper          = new LeadTimeHelper();
     releaseHelper           = new ReleaseHelper();
     taskItemHelper          = new TaskItemHelper();
 }
Пример #4
0
 public OverviewHelper(IReleaseRepository releaseRepository, IReleaseHelper releaseHelper)
 {
     taskItemRepository     = new TaskItemRepository();
     this.releaseRepository = releaseRepository;
     leadTimeHelper         = new LeadTimeHelper();
     this.releaseHelper     = releaseHelper;
     taskItemHelper         = new TaskItemHelper();
 }
Пример #5
0
 public TaskItemController(IMapper mapper, IUnitOfWork unitOfWork, ITaskItemRepository taskItemRepository,
                           ITaskRepository taskRepository)
 {
     this.mapper             = mapper;
     this.unitOfWork         = unitOfWork;
     this.taskItemRepository = taskItemRepository;
     this.taskRepository     = taskRepository;
 }
 public EnglishTaskCreateService(
     IEnglishTaskRepository englishTaskRepository,
     ITaskItemRepository taskItemRepository,
     ApplicationMapper applicationMapper)
 {
     _englishTaskRepository = englishTaskRepository;
     _taskItemRepository    = taskItemRepository;
     _mapper = applicationMapper.Mapper;
 }
 public TaskItemService(
     ITaskItemRepository taskItemRepository,
     ITaskGenerationRepository taskGenerationRepository,
     ApplicationMapper applicationMapper)
 {
     _taskItemRepository       = taskItemRepository;
     _taskGenerationRepository = taskGenerationRepository;
     _mapper = applicationMapper.Mapper;
 }
Пример #8
0
 /// <inheritdoc />
 public QueryResolver(
     IUserRepository userRepo,
     ITaskListRepository taskListRepo,
     ITaskItemRepository taskItemRepo
     )
 {
     _userRepo     = userRepo;
     _taskListRepo = taskListRepo;
     _taskItemRepo = taskItemRepo;
 }
Пример #9
0
        public void InitializeDomainFromDatabase(
            ITaskItemRepositoryFactory taskItemRepositoryFactory,
            INotificationManager notificationManager,
            ITaskManager taskManager,
            IClock clock)
        {
            /*
             * hook up to notfication added event now, so to retrieve new notifications generated by
             * the TaskItems being created below
             */
            notificationManager.NotificationAdded += OnNotificationAdded;

            /*
             * read in task items from database. Create domain taskItems from
             * data and add items to taskManager
             */
            ITaskItemRepository taskItemRepository = taskItemRepositoryFactory.New();

            foreach (TaskItemDAL task in taskItemRepository.GetAll())
            {
                INotificationFrequency notificationFrequency = null;

                if (task.customNotificationFrequency.HasValue)
                {
                    CustomNotificationFrequencyDAL frequencyDAL = task.customNotificationFrequency.Value;

                    notificationFrequency = NotificationFrequencyFactory.New(
                        //TODO: do something safer than just a cast
                        (NotificationFrequencyType)task.notificationFrequencyType,
                        frequencyDAL.time
                        );
                }
                else
                {
                    notificationFrequency = NotificationFrequencyFactory.New(
                        //TODO: do something safer than just a cast
                        (NotificationFrequencyType)task.notificationFrequencyType
                        );
                }

                taskManager.Add(
                    new TaskItem(
                        task.title,
                        task.description,
                        new Colour(task.r, task.g, task.b),
                        task.startTime,
                        notificationManager,
                        notificationFrequency,
                        clock,
                        task.lastNotificationTime,
                        task.id
                        )
                    );
            }
        }
Пример #10
0
 public TaskItemAssignService(ILoggerServices loggerServices, IDbContextScopeFactory dbContextScopeFactory, IMapper mapper, ITaskItemAssignRepository taskItemAssignRepository, ITaskItemRepository taskItemRepository, IUserServices userServices, IUserDepartmentServices userDepartmentServices, ITaskItemProcessHistoryRepository taskItemProcessHistoryRepository, IAttachmentRepository attachmentRepository)
 {
     _loggerServices        = loggerServices;
     _dbContextScopeFactory = dbContextScopeFactory;
     _mapper                           = mapper;
     _objectRepository                 = taskItemAssignRepository;
     _userServices                     = userServices;
     _userDepartmentServices           = userDepartmentServices;
     _taskItemProcessHistoryRepository = taskItemProcessHistoryRepository;
     _attachmentRepository             = attachmentRepository;
     _taskItemRepository               = taskItemRepository;
 }
Пример #11
0
        /// <summary>
        /// Executes the logic of the <see cref="ViewTasksUseCase"/>. Retrieves TaskItem data and
        /// stores it in the <see cref="ViewTasksUseCase"/>'s Output property.
        /// </summary>
        public ViewTasksOutput Execute(ViewTasksInput input)
        {
            ITaskItemRepository taskRepo = taskItemRepositoryFactory.New();

            ViewTasksOutput output = new ViewTasksOutput {
                Success = true
            };

            /*
             * go through all taskItems in database then add them to the Output property as
             * TaskItemDTO's.
             */
            foreach (TaskItem domainTask in taskManager.GetAll())
            {
                //retrieve dataLayer task which carries notification frequency description
                Maybe <TaskItemDAL> maybeTask = taskRepo.GetById(domainTask.ID);

                if (maybeTask.HasValue)
                {
                    TaskItemDAL taskDAL             = maybeTask.Value;
                    TimeSpan    customFrequencyTime = new TimeSpan();

                    //if the current taskItem has a custom frequency type, then retrieve its Time value
                    if (taskDAL.customNotificationFrequency.HasValue)
                    {
                        CustomNotificationFrequencyDAL frequencyDAL = taskDAL.customNotificationFrequency.Value;
                        customFrequencyTime = frequencyDAL.time;
                    }

                    DTO.TaskItemDTO taskDTO =
                        new DTO.TaskItemDTO()
                    {
                        Id          = domainTask.ID,
                        Title       = domainTask.Title,
                        Description = domainTask.Description,
                        R           = domainTask.Colour.R,
                        G           = domainTask.Colour.G,
                        B           = domainTask.Colour.B,
                        StartTime   = domainTask.StartTime,
                        //TODO: prefer to do a better conversion that just a cast to an enum
                        NotificationFrequencyType =
                            (NotificationFrequencyType)taskDAL.notificationFrequencyType,
                        CustomNotificationFrequency = customFrequencyTime
                    };

                    output.TaskItems.Add(taskDTO);
                }
            }

            return(output);
        }
        public TaskController(TaskContext context)
        {
            _context = context;

            if (!_context.TaskItems.Any())
            {
                _context.TaskItems.Add(new TaskItem {
                    Subject = "Item1"
                });
                _context.SaveChanges();
            }

            _repository = new TaskItemRepository();
        }
Пример #13
0
 public CategoryService(ILoggerServices loggerServices, IDbContextScopeFactory dbContextScopeFactory, IMapper mapper, ITaskItemCategoryRepository taskItemCategoryRepository, IUserServices userServices, IProjectCategoryRepository projectCategoryRepository, ITaskItemStatusRepository taskItemStatusRepository, ITaskItemPriorityRepository taskItemPriorityRepository, INatureTaskRepository natureTaskRepository, IProjectPriorityRepository projectPriorityRepository, IProjectTypeRepository projectTypeRepository, ISettingsService settingsService, ITaskItemRepository taskItemRepository, IProjectStatusRepository projectStatusRepository)
 {
     _loggerServices             = loggerServices;
     _dbContextScopeFactory      = dbContextScopeFactory;
     _projectCategoryRepository  = projectCategoryRepository;
     _taskItemCategoryRepository = taskItemCategoryRepository;
     _taskItemStatusRepository   = taskItemStatusRepository;
     _taskItemPriorityRepository = taskItemPriorityRepository;
     _natureTaskRepository       = natureTaskRepository;
     _projectPriorityRepository  = projectPriorityRepository;
     _projectTypeRepository      = projectTypeRepository;
     _mapper                  = mapper;
     _userServices            = userServices;
     _settingsService         = settingsService;
     _taskItemRepository      = taskItemRepository;
     _projectStatusRepository = projectStatusRepository;
 }
Пример #14
0
        protected void OnNotificationAdded(object source, Notification notification)
        {
            //update database with new notification
            NotificationDAL notificationDal = new NotificationDAL {
                taskId = notification.Producer.ID,
                time   = notification.Time
            };

            INotificationRepository notificationRepo = notificationRepositoryFactory.New();

            notificationRepo.Add(notificationDal);

            ITaskItemRepository taskRepo = taskItemRepositoryFactory.New();
            List <TaskItemDAL>  tasks    = new List <TaskItemDAL>(taskRepo.GetAll());

            if (notification.Producer is TaskItem task)
            {
                //update the notifications producer in the database
                TaskItemDAL taskItemDAL = tasks.Find(t => t.id == task.ID);
                taskItemDAL.lastNotificationTime = task.LastNotificationTime;
                if (taskRepo.Update(taskItemDAL) == false)
                {
                    //could not update task in database
                }

                //create DTO to invoke NotificationAdded with
                NotificationDTO dto = new NotificationDTO()
                {
                    TaskId = task.ID,
                    Time   = notification.Time,
                    Title  = notification.Producer.Title,
                    R      = task.Colour.R,
                    G      = task.Colour.G,
                    B      = task.Colour.B
                };

                //invoked event delegates
                NotificationAdded?.Invoke(source, dto);
            }

            taskRepo.Save();
            notificationRepo.Save();
        }
        /// <summary>
        /// Executes the ViewNotificationsUseCase. Sets the Output property of the UseCase object
        /// once complete
        /// </summary>
        public ViewNotificationsOutput Execute(ViewNotificationsInput input)
        {
            //no input for use case
            ITaskItemRepository taskRepo = taskItemRepositoryFactory.New();

            ViewNotificationsOutput output = new ViewNotificationsOutput {
                Success = true
            };

            /*
             * Get all notifications that are present in the application, convert them to DTO's, then
             * add them to a collection to return
             */
            INotificationRepository notificationRepository = notificationRepositoryFactory.New();

            foreach (NotificationDAL notification in notificationRepository.GetAll())
            {
                Maybe <TaskItemDAL> maybeTask = taskRepo.GetById(notification.taskId);

                if (maybeTask.HasValue)
                {
                    TaskItemDAL     taskDAL = maybeTask.Value;
                    NotificationDTO dto     = new NotificationDTO()
                    {
                        TaskId = taskDAL.id,
                        Title  = taskDAL.title,
                        Time   = notification.time,
                        R      = taskDAL.r,
                        G      = taskDAL.g,
                        B      = taskDAL.b
                    };

                    output.Notifications.Add(dto);
                }
            }

            return(output);
        }
Пример #16
0
 public TaskItemHelper(ITaskItemRepository taskItemRepository)
 {
     this.taskItemRepository = taskItemRepository;
 }
Пример #17
0
 public TaskItemHelper()
 {
     taskItemRepository = new TaskItemRepository();
 }
Пример #18
0
 public TaskItemService(ITaskItemRepository taskRepo)
 {
     _taskRepo = taskRepo;
 }
Пример #19
0
 public TaskItemController(ITaskItemRepository taskRepository)
 {
     _taskRepository = taskRepository;
 }
Пример #20
0
        public CreateTaskOutput Execute(CreateTaskInput input)
        {
            if (input is null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            if (input.IsValid())
            {
                //create new Domain TaskItem from the supplied input data
                TaskItem newTask = InputToTaskItem(input);

                if (taskManager.Add(newTask))
                {
                    ITaskItemRepository taskItemRepo = taskItemRepositoryFactory.New();

                    //Create a TaskItemDAL to save to the database
                    TaskItemDAL taskItemDAL = TaskItemAndInputToDAL(newTask, input);

                    //add the new TaskItemDAL to the database
                    if (taskItemRepo.Add(taskItemDAL))
                    {
                        //save the changed make to the TaskItemRepository
                        if (taskItemRepo.Save())
                        {
                            //create DTO to return as Output data
                            TaskItemDTO taskItemDTO = InputToTaskItemDTO(input);

                            //fill output data and return
                            return(new CreateTaskOutput {
                                Success = true, TaskItemDTO = taskItemDTO
                            });
                        }
                        else
                        {
                            //failed to save state of repository
                            //remove taskItem from domain TaskManager
                            if (!taskManager.Remove(newTask))
                            {
                                //TaskItem could not be removed. we're now screwed . . .
                                //TODO: decide what to do here
                            }

                            return(new CreateTaskOutput {
                                Success = false, Error = "Unable to save the new Task."
                            });
                        }
                    }
                    else
                    {
                        //failed to save task to repository
                        //remove taskItem from domain TaskManager
                        if (!taskManager.Remove(newTask))
                        {
                            //TaskItem could not be removed. we're now screwed . . .
                            //TODO: decide what to do here
                        }

                        return(new CreateTaskOutput {
                            Success = false, Error = "Unable to save the new Task."
                        });
                    }
                }
                else
                {
                    //unable to add new TaskItem to domain TaskManager
                    return(new CreateTaskOutput {
                        Success = false, Error = "Unable to process the new Task."
                    });
                }
            }
            else
            {
                //Input is not valid
                return(new CreateTaskOutput {
                    Success = false, Error = input.GetErrorMessage()
                });
            }
        }
Пример #21
0
 public KanbanizeApi(IRestClient client, ITaskItemRepository taskItemRepository, IDatabaseConnection databaseConnection)
 {
     this.client             = client;
     this.taskItemRepository = taskItemRepository;
     this.databaseConnection = databaseConnection;
 }
Пример #22
0
 public TaskService(ITaskItemRepository taskItemRepository)
 {
     _taskItemRepository = taskItemRepository;
 }
Пример #23
0
 public TaskItemService(ITaskItemRepository repository)
 {
     _repository = repository;
 }
 public TaskItemService(ITaskItemRepository _taskItemRepository)
 {
     taskItemRepository = _taskItemRepository;
 }
Пример #25
0
 public BoxGraphHelper(ITaskItemRepository taskItemRepository, TaskItemHelper taskItemHelper)
 {
     this.taskItemRepository = taskItemRepository;
     this.taskItemHelper     = taskItemHelper;
 }
Пример #26
0
 public BoxGraphHelper()
 {
     taskItemHelper     = new TaskItemHelper();
     taskItemRepository = new TaskItemRepository();
 }
Пример #27
0
 public TaskItemService()
 {
     this.repository = new TaskItemRepository();
 }
Пример #28
0
 public TaskService(IUnitOfWork unitOfWork, IProjectService projectService)
 {
     _unitOfWork = unitOfWork;
     _tasks      = unitOfWork.Tasks;
 }
Пример #29
0
 public GeneralTasksController(ITaskItemRepository iTaskRepo, ITaskListRepository taskListsRepo)
 {
     _iTaskRepo     = iTaskRepo;
     _taskListsRepo = taskListsRepo;
 }
Пример #30
0
 public TaskItemsController(ITaskItemRepository repository)
 {
     _repository = repository;
 }
Пример #31
0
 public KanbanizeApi()
 {
     client             = new RestClient();
     taskItemRepository = new TaskItemRepository();
 }