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; }
public OverviewHelper(ITaskItemRepository taskItemRepository) { this.taskItemRepository = taskItemRepository; releaseRepository = new ReleaseRepository(); leadTimeHelper = new LeadTimeHelper(); releaseHelper = new ReleaseHelper(); taskItemHelper = new TaskItemHelper(); }
public OverviewHelper(IReleaseRepository releaseRepository, IReleaseHelper releaseHelper) { taskItemRepository = new TaskItemRepository(); this.releaseRepository = releaseRepository; leadTimeHelper = new LeadTimeHelper(); this.releaseHelper = releaseHelper; taskItemHelper = new TaskItemHelper(); }
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; }
/// <inheritdoc /> public QueryResolver( IUserRepository userRepo, ITaskListRepository taskListRepo, ITaskItemRepository taskItemRepo ) { _userRepo = userRepo; _taskListRepo = taskListRepo; _taskItemRepo = taskItemRepo; }
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 ) ); } }
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; }
/// <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(); }
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; }
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); }
public TaskItemHelper(ITaskItemRepository taskItemRepository) { this.taskItemRepository = taskItemRepository; }
public TaskItemHelper() { taskItemRepository = new TaskItemRepository(); }
public TaskItemService(ITaskItemRepository taskRepo) { _taskRepo = taskRepo; }
public TaskItemController(ITaskItemRepository taskRepository) { _taskRepository = taskRepository; }
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() }); } }
public KanbanizeApi(IRestClient client, ITaskItemRepository taskItemRepository, IDatabaseConnection databaseConnection) { this.client = client; this.taskItemRepository = taskItemRepository; this.databaseConnection = databaseConnection; }
public TaskService(ITaskItemRepository taskItemRepository) { _taskItemRepository = taskItemRepository; }
public TaskItemService(ITaskItemRepository repository) { _repository = repository; }
public TaskItemService(ITaskItemRepository _taskItemRepository) { taskItemRepository = _taskItemRepository; }
public BoxGraphHelper(ITaskItemRepository taskItemRepository, TaskItemHelper taskItemHelper) { this.taskItemRepository = taskItemRepository; this.taskItemHelper = taskItemHelper; }
public BoxGraphHelper() { taskItemHelper = new TaskItemHelper(); taskItemRepository = new TaskItemRepository(); }
public TaskItemService() { this.repository = new TaskItemRepository(); }
public TaskService(IUnitOfWork unitOfWork, IProjectService projectService) { _unitOfWork = unitOfWork; _tasks = unitOfWork.Tasks; }
public GeneralTasksController(ITaskItemRepository iTaskRepo, ITaskListRepository taskListsRepo) { _iTaskRepo = iTaskRepo; _taskListsRepo = taskListsRepo; }
public TaskItemsController(ITaskItemRepository repository) { _repository = repository; }
public KanbanizeApi() { client = new RestClient(); taskItemRepository = new TaskItemRepository(); }