public IList <Task> GetAll()
        {
            var tasks = _tasksRepository.GetAll();

            if (tasks == null)
            {
                return(new List <Task>());
            }
            return(tasks);
        }
Exemple #2
0
            public async Task <TasksResponse> Handle(GetAllTasksQuery request, CancellationToken cancellationToken)
            {
                var Tasks = await _repository.GetAll();

                var response = new TasksResponse();

                response.Tasks.AddRange(_mapper.Map <List <TaskDto> >(Tasks));

                return(response);
            }
        public ActionResult Index()
        {
            ViewBag.Title = "My Tasks";
            var config = new MapperConfiguration(cfg => {
                cfg.CreateMap <TaskFull, TaskViewModel>();
            });
            IMapper mapper = config.CreateMapper();
            var     model  = new TasksViewModel()
            {
                AllTasks = mapper.Map <List <TaskFull>, List <TaskViewModel> >(_tasksRepository.GetAll(_usersRepository.GetCurrentUserId())),
            };

            return(View(model));
        }
        public PartialViewResult EditTimeReport(int id)
        {
            TimeReportEntity reportEntity = this.reportsRepository.GetById(id);
            var model = new ManageTimeReportModel
            {
                Id         = reportEntity.Id,
                SpentHours = new ReportSpentHours
                {
                    Effort   = reportEntity.Effort,
                    Overtime = reportEntity.Overtime
                },
                TimeInterval = new TimeReportInterval
                {
                    StartDate = reportEntity.StartDate,
                    EndDate   = reportEntity.EndDate
                },
                ProjectId   = reportEntity.Task.Project.Id,
                TaskId      = reportEntity.Task.Id,
                Tasks       = tasksRepository.GetAll(), //todo: проверить чтобы таски соответствовали проекту!!!!
                Description = reportEntity.Description
            };

            return(this.PartialView("EditableTimeReportRow", model));
        }
Exemple #5
0
        public JsonResult GetAll()
        {
            var tasks = _tasksRepository.GetAll();

            return(Json(tasks, JsonRequestBehavior.AllowGet));
        }
Exemple #6
0
 public async Task <IActionResult> Index()
 {
     return(View(await tasksRepository.GetAll()));
 }
Exemple #7
0
 public async Task <HomeworkTask[]> GetAllTasksAsync()
 {
     return(await _tasksRepository.GetAll().ToArrayAsync());
 }
 public IEnumerable <Tasks> GetAll()
 {
     return(_tasksRepository.GetAll());
 }
Exemple #9
0
 public List <Tasks> GetAll()
 {
     return(_tasksRepository.GetAll());
 }