Ejemplo n.º 1
0
        public List <TaskDto> Search(TaskSearchDto dto)
        {
            using (UnitOfWork uow = new UnitOfWork())
            {
                var list = uow.GetRepository <Data.Context.Task>().GetAll();

                //Ekrandan proje seçilmişse filtre olarak eklenecek
                if (dto.ProjectId > 0)
                {
                    list = list.Where(p => p.ProjectId == dto.ProjectId);
                }

                //Ekrandan statü seçilmişse filtre olarak eklenecek
                if (dto.TaskStatusId > 0)
                {
                    list = list.Where(p => p.TaskStatusId == dto.TaskStatusId);
                }

                //Ekrandan kişi seçilmişse filtre olarak eklenecek
                if (dto.UserId > 0)
                {
                    list = list.Where(p => p.AssignTo == dto.UserId);
                }

                return(list.Select(MapperFactory.Map <Data.Context.Task, TaskDto>).ToList());
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Index([FromQuery] TaskSearchDto searchDto)
        {
            //we are just returning data and because the domain contains all the business logic we can just get the model
            //and serialize the properties.
            var examples = await _taskRepository.Get(searchDto.Index, searchDto.Size == 0? 10 : searchDto.Size);

            return(new JsonResult(_mapper.Map <List <TaskDto> >(examples)));
        }
Ejemplo n.º 3
0
        public async Task <PageModelDto <TaskLogDto> > GetLogPaged(TaskSearchDto searchDto)
        {
            PageModelDto <TaskLogDto> result = new PageModelDto <TaskLogDto>();

            Expression <Func <SysTaskLog, bool> > whereCondition = x => true;

            if (searchDto.Id > 0)
            {
                whereCondition = whereCondition.And(x => x.ID == searchDto.Id);
            }

            var taskLogs = await _taskLogRepository.SelectAsync(t => t, whereCondition, t => t.ID, false);

            return(_mapper.Map <PageModelDto <TaskLogDto> >(taskLogs));
        }
Ejemplo n.º 4
0
        public async Task <List <TaskDto> > GetList(TaskSearchDto searchDto)
        {
            List <TaskDto> result = new List <TaskDto>();

            Expression <Func <SysTask, bool> > whereCondition = x => true;

            if (searchDto.Name.IsNotNullOrWhiteSpace())
            {
                whereCondition = whereCondition.And(x => x.Name.Contains(searchDto.Name));
            }

            var tasks = await _taskRepository.SelectAsync(t => t, whereCondition, t => t.ModifyTime, false);

            return(_mapper.Map <List <TaskDto> >(tasks));
        }
Ejemplo n.º 5
0
 public async Task <PageModelDto <TaskLogDto> > GetLogPaged([FromQuery] TaskSearchDto searchDto)
 {
     return(await _taskAppService.GetLogPaged(searchDto));
 }
Ejemplo n.º 6
0
 public async Task <List <TaskDto> > GetList([FromQuery] TaskSearchDto searchDto)
 {
     return(await _taskAppService.GetList(searchDto));
 }