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); } }
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, "")); }
public List <WorkItem> Get(SearchModel searchModel) { return(_repository.Get(searchModel).ToList()); }