Exemplo n.º 1
0
        public WorkItem GetWorkItem(int workItemId)
        {
            try
            {
                WorkItem workItemEntity = _WorkItemRepository.Get(workItemId);

                if (workItemEntity == null)
                {
                    throw new Exception(string.Format("Work Item with ID of {0} is not in the database", workItemId));
                }
                return(workItemEntity);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Exemplo n.º 2
0
        public IEnumerable <WorkItemView> QueryViews(string statCondition, string typeCondition, int itemsPerPage,
                                                     int page)
        {
            var predict = (statCondition + '_' + typeCondition).GetWorkItemFilter();
            var stats   = predict == null
                ? _repository.GetAll(page, itemsPerPage, x => x.Deadline)
                : _repository.Get(predict, page, itemsPerPage, x => x.Deadline);

            var views = Mapper.Map <List <WorkItem>, List <WorkItemView> >(stats.ToList());

            views.ForEach(x => x.UpdateTown(_eNodebRepository, _btsRepository, _townRepository));
            return(views);
        }
        public ICommandResult Handle(GetWorkItemCommand command)
        {
            _workItemRepository.Get(command);

            return(new CommandResult(true, ""));
        }
Exemplo n.º 4
0
 public List <WorkItem> Get(SearchModel searchModel)
 {
     return(_repository.Get(searchModel).ToList());
 }