Пример #1
0
        public async Task <List <StatusDto> > GetAllAsync()
        {
            var statuses = await _statusRepository.GetAllAsync();

            List <StatusDto> statusesDtos = new List <StatusDto>();

            foreach (var i in statuses)
            {
                var normal = _mapper.Map <StatusDto>(i);
                statusesDtos.Add(normal);
            }
            return(statusesDtos);
        }
        public async Task <ActionResult> Details(int id)
        {
            if (id == 0)
            {
                return(RedirectToAction(nameof(this.Index)));
            }

            var complaint = await _complaintsRepository.GetAsync(id);

            var status = await _statusRepository.GetAllAsync();

            ViewBag.StatusList = status.Data.Select(e => new SelectListItem {
                Value = e.Id.ToString(), Text = e.Name, Selected = e.Id == complaint.Data.StatusId
            }).ToList();

            var model = new ComplaintsViewModel
            {
                Complaint   = complaint,
                Binnacle    = new BinnacleDto(),
                ServiceRate = new ServiceRateDto()
            };

            return(View(model));
        }
Пример #3
0
        public async Task <IEnumerable <TextStatus> > GetAllAsync()
        {
            var statuses = await statusRepository.GetAllAsync();

            return(mapper.Map <IEnumerable <TextStatus> >(statuses));
        }
Пример #4
0
 public async Task <IList <Models.Status> > GetAllAsync()
 {
     return(await _repository.GetAllAsync());
 }
        public async Task <ResponseEntity> getAll(int taskId, string token)
        {
            var result = _statusRepository.GetAllAsync().Result;

            return(new ResponseEntity(StatusCodeConstants.OK, result, MessageConstants.MESSAGE_SUCCESS_200));
        }
        public async Task <ResponseEntity> getProjectById(int?idProject)
        {
            var pro = await _projectRepository.GetSingleByConditionAsync("id", idProject);

            if (pro == null)
            {
                return(new ResponseEntity(StatusCodeConstants.NOT_FOUND, "Project is not found", MessageConstants.MESSAGE_ERROR_404));
            }


            var lstUser = _projectUserRepository.GetMultiByConditionAsync("projectId", idProject).Result;
            List <Repository.Models.Member> members = new List <Repository.Models.Member>();

            foreach (var item in lstUser)
            {
                var user = _userJira.GetSingleByConditionAsync("id", item.userId).Result;
                Repository.Models.Member mem = new Repository.Models.Member();
                mem.userId = user.id;
                mem.name   = user.name;

                mem.avatar = user.avatar;
                members.Add(mem);
            }

            ProjectCategory projectCategory = await _projectCategoryRepository.GetSingleByConditionAsync("id", pro.categoryId);

            ProjectDetail projectDetail = new ProjectDetail();

            projectDetail.alias           = pro.alias;
            projectDetail.projectName     = pro.projectName;
            projectDetail.projectCategory = new ProjectCategoryDetail()
            {
                id = projectCategory.id, name = projectCategory.projectCategoryName
            };
            projectDetail.description = FuncUtilities.Base64Decode(pro.description);
            projectDetail.id          = pro.id;
            projectDetail.projectName = pro.projectName;
            projectDetail.members     = members;
            CreatorModel creator = new CreatorModel();

            if (pro.id != null)
            {
                creator.id = pro.creator;

                creator.name = _userJira.GetSingleByIdAsync(pro.creator).Result.name;
            }

            projectDetail.creator = creator;

            //List<ProjectDetail> lstResult = new List<ProjectDetail>();
            var lstStatus = await _statusRepository.GetAllAsync();

            //Lấy list priority
            IEnumerable <Priority> lstPriority = await _priorityRepository.GetAllAsync();

            //Lấy list task
            var lstTask = await _taskRepository.GetAllAsync();

            foreach (var status in lstStatus)
            {
                var statusTask = new StatusTask {
                    statusId = status.statusId, statusName = status.statusName, alias = status.alias
                };

                List <TaskDetail> task = lstTask.Where(n => n.projectId == projectDetail.id && n.statusId == status.statusId).Select(n => new TaskDetail {
                    taskId = n.taskId, taskName = n.taskName, alias = n.alias, description = FuncUtilities.Base64Decode(n.description), statusId = n.statusId, priorityTask = getTaskPriority(n.priorityId, lstPriority), originalEstimate = n.originalEstimate, timeTrackingSpent = n.timeTrackingSpent, timeTrackingRemaining = n.timeTrackingRemaining, assigness = getListUserAsign(n.taskId).ToList(), taskTypeDetail = getTaskType(n.typeId), lstComment = getListComment(n.taskId).ToList(), projectId = n.projectId
                }).ToList();

                statusTask.lstTaskDeTail.AddRange(task);

                projectDetail.lstTask.Add(statusTask);
            }


            return(new ResponseEntity(StatusCodeConstants.OK, projectDetail, MessageConstants.MESSAGE_SUCCESS_200));
        }
Пример #7
0
 public async Task <List <StatusDto> > GetListAsync()
 {
     return(await _statusRepository.GetAllAsync());
 }
Пример #8
0
        public async Task <ActionResult> Index()
        {
            var model = await _statusRepository.GetAllAsync();

            return(View(model));
        }
Пример #9
0
 // GET: api/Status
 /// <summary>
 /// Получить статусы
 /// </summary>
 /// <returns></returns>
 public async Task <ICollection <Status> > Get()
 {
     return(await _repository.GetAllAsync());
 }