public IActionResult InProgressList()
        {
            TasksListViewModel model = new TasksListViewModel();

            model.LoadData(_unitOfWork);
            return(View(model));
        }
示例#2
0
        public IActionResult SearchTasksByTags()
        {
            var model = new TasksListViewModel {
                Tasks = _tasks
            };

            return(View(model));
        }
示例#3
0
 //public TasksListPage (TasksListViewModel vm)
 public TasksListPage(ObservableCollection <TaskViewModel> tasks)
 {
     InitializeComponent();
     ViewModel = new TasksListViewModel(tasks);
     //ViewModel = vm;
     ViewModel.Navigation = this.Navigation;
     BindingContext       = ViewModel;
 }
        public async System.Threading.Tasks.Task <ActionResult> List(string timeType, int?projectID, string searchPhrase, string date, TaskType tasksType = TaskType.All)
        {
            var getTasksTask             = _taskApiRequestHandler.GetTasksHeadersWithPriority(timeType, projectID, searchPhrase, date, tasksType);
            TasksListViewModel viewModel = new TasksListViewModel();

            viewModel.Tasks = await getTasksTask;

            return(View(viewModel));
        }
        public async System.Threading.Tasks.Task <ActionResult> Search(string searchPhrase)
        {
            var searchTasksTask          = _taskApiRequestHandler.SearchTasks(searchPhrase);
            TasksListViewModel viewModel = new TasksListViewModel();

            viewModel.Tasks = await searchTasksTask;

            return(View("List", viewModel));
        }
        public IActionResult FinishList(TasksListViewModel model)
        {
            TaskStatusType completetd = new TaskStatusType();

            completetd = TaskStatusType.Completed;

            model.CompletedTasks = _unitOfWork.Tasks.GetTaskByName(model.FilterTaskName, completetd);
            return(View(model));
        }
        public IActionResult OpenList(TasksListViewModel model)
        {
            TaskStatusType open = new TaskStatusType();

            open = TaskStatusType.Open;

            model.UndefinedTasks = _unitOfWork.Tasks.GetTaskByName(model.FilterTaskName, open);
            return(View(model));
        }
示例#8
0
 public TasksPage(Users user)
 {
     InitializeComponent();
     this.t_user = user;
     tasksList   = new TasksListViewModel(t_user)
     {
         Navigation = this.Navigation
     };
     this.BindingContext = tasksList;
 }
        public IActionResult InProgressList(TasksListViewModel model)

        {
            TaskStatusType processing = new TaskStatusType();

            processing = TaskStatusType.Processing;

            model.ProcessingTasks = _unitOfWork.Tasks.GetTaskByName(model.FilterTaskName, processing);
            return(View(model));
        }
示例#10
0
        public async Task <IActionResult> TagTasks(int tagId)
        {
            var tag = await _taskService.GetTagById(tagId);

            var model = new TasksListViewModel()
            {
                Tasks = tag.Tasks
            };

            return(View(model));
        }
示例#11
0
        public IActionResult TasksList()
        {
            var tasksListViewModel = new TasksListViewModel();
            var tasks = _homeBusinessService.GetTasks(UserManager.UserTestId);

            tasksListViewModel.Tasks = tasks != null
                ? tasks.Select(t => new TodoTaskViewModel {
                Description = t.Description, Id = t.Id, IsChecked = t.IsChecked, LastUpdate = t.LastUpdate
            }).ToList()
                : new List <TodoTaskViewModel>();

            return(View(tasksListViewModel));
        }
示例#12
0
 public TasksListPage() : base()
 {
     try
     {
         InitializeComponent();
         ViewModel            = BindingContext as TasksListViewModel;
         ViewModel.Navigation = Navigation;
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException(ex);
     }
 }
示例#13
0
        public async Task GetAllTaskItemsTest()
        {
            var mockUserDataService         = new MockUserDataService();
            var mockRoleTypeDataService     = new MockRoleTypeDataService();
            var mockNavigationService       = new MockNavigationService();
            var mockTaskItemDataService     = new MockTaskItemDataService();
            var mockTaskSubitemDataServcice = new MockTaskSubitemDataService();

            var tasksListViewModel = new TasksListViewModel(mockNavigationService, mockTaskItemDataService,
                                                            mockUserDataService, mockRoleTypeDataService, mockTaskSubitemDataServcice);
            await tasksListViewModel.Refresh();

            Assert.AreEqual(4, tasksListViewModel.TaskItems.Count);
        }
示例#14
0
        public IActionResult Index(int id)
        {
            //Obtenga el listado de tareas
            // SELECT * FROM MyTask WHERE ProjectId=id
            List <MyTask> taskList = this._taskRepository.Tasks.Where(x => x.ProjectId == id).ToList();
            Project       project  = this._taskRepository.Projects.FirstOrDefault(x => x.ProjectId == id);

            var model = new TasksListViewModel
            {
                CurrentProject = project,
                Tasks          = taskList
            };

            //Enviamos los datos a la Vista
            return(View(model));
        }
示例#15
0
        public async Task <IActionResult> SearchTasksByTags(string tagPart)
        {
            var tagRegex = $@"(.+)?{tagPart}(.+)?";

            var tags = await _projectService.GetTags(CurrentProjectService.currentProjectId);

            var foundTags = tags.Where(tag => Regex.IsMatch(tag.Text, tagRegex)).ToList();

            foreach (var tag in foundTags)
            {
                //output[tag.Text] = tag.Tasks;
                _tasks.AddRange(tag.Tasks);
            }

            var model = new TasksListViewModel()
            {
                Tasks = _tasks
            };

            return(View(model));
        }
示例#16
0
        public ViewResult List(string search, string sortBy, int page = 1)
        {
            var tasksListViewModel = new TasksListViewModel();

            tasksListViewModel.Search = search;

            tasksListViewModel.DescriptionSort = string.IsNullOrEmpty(sortBy) ? "description_desc" : "";
            tasksListViewModel.DescriptionSort = sortBy == "description" ? "description_desc" : "description";
            tasksListViewModel.StatusSort      = sortBy == "status" ? "status_desc" : "status";

            tasksListViewModel.Tasks = tasks.GetTasks(search, sortBy, page, PageSize);

            tasksListViewModel.PagingInfo = new PagingInfo
            {
                CurrentPage  = page,
                ItemsPerPage = PageSize,
                TotalItems   = tasks.GetTasksCount(search)
            };

            return(View(tasksListViewModel));
        }
示例#17
0
        public async Task UserCanDeleteTaskTest()
        {
            var mockUserDataService         = new MockUserDataService();
            var mockRoleTypeDataService     = new MockRoleTypeDataService();
            var mockNavigationService       = new MockNavigationService();
            var mockTaskItemDataService     = new MockTaskItemDataService();
            var mockTaskSubitemDataServcice = new MockTaskSubitemDataService();

            var tasksListViewModel = new TasksListViewModel(mockNavigationService, mockTaskItemDataService,
                                                            mockUserDataService, mockRoleTypeDataService, mockTaskSubitemDataServcice);
            await tasksListViewModel.Refresh();

            int totalTaskItems = tasksListViewModel.TaskItems.Count;
            var taskItem       = tasksListViewModel.TaskItems.First();

            taskItem.IsCompleted = true;
            await Task.Factory.StartNew(() => tasksListViewModel.DeleteCompletedCommand.Execute(null));

            await Task.Delay(TimeSpan.FromSeconds(15));

            Assert.AreEqual(totalTaskItems - 1, tasksListViewModel.TaskItems.Count);
        }
示例#18
0
        public void Task_Can_Sort()
        {
            // Arrange
            Mock <ILogger <TasksController> > mockLogger             = new Mock <ILogger <TasksController> >();
            Mock <ITaskListRepository>        mockTaskListRepository = new Mock <ITaskListRepository>();
            Mock <IStatusRepository>          mockStatusRepository   = new Mock <IStatusRepository>();
            Mock <ILocationRepository>        mockLocationRepository = new Mock <ILocationRepository>();
            Mock <IIdentityRepository>        mockIdentityRepository = new Mock <IIdentityRepository>();

            mockTaskListRepository.Setup(m => m.GetTasks).Returns((new Task[] {
                new Task {
                    TaskId = 1, Description = "T1", StatusId = 1, LocationId = 1, UserId = "1", Location = new Location {
                        Description = "L1"
                    }, Status = new Status {
                        Name = "Open"
                    }, User = new AspNetUser {
                        FullName = "Joe"
                    }
                },
                new Task {
                    TaskId = 1, Description = "T2", StatusId = 1, LocationId = 1, UserId = "1", Location = new Location {
                        Description = "L2"
                    }, Status = new Status {
                        Name = "Open"
                    }, User = new AspNetUser {
                        FullName = "Joe"
                    }
                },
                new Task {
                    TaskId = 1, Description = "T3", StatusId = 1, LocationId = 1, UserId = "1", Location = new Location {
                        Description = "L3"
                    }, Status = new Status {
                        Name = "Open"
                    }, User = new AspNetUser {
                        FullName = "Joe"
                    }
                },
                new Task {
                    TaskId = 1, Description = "T4", StatusId = 1, LocationId = 1, UserId = "1", Location = new Location {
                        Description = "L4"
                    }, Status = new Status {
                        Name = "Open"
                    }, User = new AspNetUser {
                        FullName = "Joe"
                    }
                },
                new Task {
                    TaskId = 1, Description = "T5", StatusId = 1, LocationId = 1, UserId = "1", Location = new Location {
                        Description = "L5"
                    }, Status = new Status {
                        Name = "Open"
                    }, User = new AspNetUser {
                        FullName = "Joe"
                    }
                }
            }).AsQueryable <Task>());

            TasksController controller = new TasksController(mockLogger.Object, mockTaskListRepository.Object, mockStatusRepository.Object, mockLocationRepository.Object, mockIdentityRepository.Object);

            controller.PageSize = 3;

            // Act
            TasksListViewModel result = controller.List(string.Empty, "description", 1).ViewData.Model as TasksListViewModel;

            // Assert
            Task[] TaskArray = result.Tasks.ToArray();
            Assert.IsTrue(TaskArray.Length == 3);
            Assert.AreEqual("T1", TaskArray[0].Description);
            Assert.AreEqual("T2", TaskArray[1].Description);
            Assert.AreEqual("T3", TaskArray[2].Description);
        }
示例#19
0
        public void Task_Can_Send_Pagination()
        {
            // Arrange
            Mock <ILogger <TasksController> > mockLogger             = new Mock <ILogger <TasksController> >();
            Mock <ITaskListRepository>        mockTaskListRepository = new Mock <ITaskListRepository>();
            Mock <IStatusRepository>          mockStatusRepository   = new Mock <IStatusRepository>();
            Mock <ILocationRepository>        mockLocationRepository = new Mock <ILocationRepository>();
            Mock <IIdentityRepository>        mockIdentityRepository = new Mock <IIdentityRepository>();

            mockTaskListRepository.Setup(m => m.GetTasks).Returns((new Task[] {
                new Task {
                    TaskId = 1, Description = "T1", StatusId = 1, LocationId = 1, UserId = "1", Location = new Location {
                        Description = "L1"
                    }, Status = new Status {
                        Name = "Open"
                    }, User = new AspNetUser {
                        FullName = "Joe"
                    }
                },
                new Task {
                    TaskId = 1, Description = "T2", StatusId = 1, LocationId = 1, UserId = "1", Location = new Location {
                        Description = "L2"
                    }, Status = new Status {
                        Name = "Open"
                    }, User = new AspNetUser {
                        FullName = "Joe"
                    }
                },
                new Task {
                    TaskId = 1, Description = "T3", StatusId = 1, LocationId = 1, UserId = "1", Location = new Location {
                        Description = "L3"
                    }, Status = new Status {
                        Name = "Open"
                    }, User = new AspNetUser {
                        FullName = "Joe"
                    }
                },
                new Task {
                    TaskId = 1, Description = "T4", StatusId = 1, LocationId = 1, UserId = "1", Location = new Location {
                        Description = "L4"
                    }, Status = new Status {
                        Name = "Open"
                    }, User = new AspNetUser {
                        FullName = "Joe"
                    }
                },
                new Task {
                    TaskId = 1, Description = "T5", StatusId = 1, LocationId = 1, UserId = "1", Location = new Location {
                        Description = "L5"
                    }, Status = new Status {
                        Name = "Open"
                    }, User = new AspNetUser {
                        FullName = "Joe"
                    }
                }
            }).AsQueryable <Task>());

            TasksController controller = new TasksController(mockLogger.Object, mockTaskListRepository.Object, mockStatusRepository.Object, mockLocationRepository.Object, mockIdentityRepository.Object);

            controller.PageSize = 3;

            // Act
            TasksListViewModel result = controller.List(string.Empty, string.Empty, 2).ViewData.Model as TasksListViewModel;

            // Assert
            PagingInfo pageInfo = result.PagingInfo;

            Assert.AreEqual(2, pageInfo.CurrentPage);
            Assert.AreEqual(3, pageInfo.ItemsPerPage);
            Assert.AreEqual(5, pageInfo.TotalItems);
            Assert.AreEqual(2, pageInfo.TotalPages);
        }
 public IActionResult List(TasksListViewModel model)
 {
     model.Tasks = _unitOfWork.Tasks.GetTaskByName(model.FilterTaskName);
     return(View(model));
 }
示例#21
0
 public TasksListPage()
 {
     InitializeComponent();
     BindingContext = new TasksListViewModel();
 }
        public virtual ActionResult PendingTaskListEstimated(TaskFilter taskFilter)
        {
            var tasks = TaskService.GetAll(Query.ForTask(taskFilter).Include(x => x.Project())).ToList();

            var model = new TasksListViewModel { Tasks = tasks };

            return PartialView(MVC.Tasks.Views.PendingTaskListEstimated, model);
        }
 public virtual ActionResult List(TasksListViewModel model)
 {
     model.TaskFilter = model.TaskFilter ?? new TaskFilter();
     ViewBag.CustomersList = new SelectList(CustomerService.GetAll(Query.ForCustomer()), "CustomerId", "Name");
     ViewBag.ProjectsList = new SelectList(ProjectService.GetAll(Query.ForProject().Include(x => x.Customer())), "ProjectId", "Name", "Customer.Name");
     return View(model);
 }