Esempio n. 1
0
 public IList<IssueSummaryModel> GetIssueSummaries(IssueSearchCriteriaModel criteria = null)
 {
     return Search(criteria).Select(Map<IssueSummaryModel>).ToList();
 }
Esempio n. 2
0
 public IList<IssueDetailsModel> GetIssueDetails(IssueSearchCriteriaModel criteria = null,
     bool includeSummary = false, bool includeUser = false, bool includeIssue = false)
 {
     return Search(criteria).Select(
         c => BuildIssueDetails(c, includeSummary, includeUser, includeIssue)).ToList();
 }
 public IEnumerable<IssueDetailsModel> Get(IssueSearchCriteriaModel criteria = null,
     bool includeSummary = false, bool includeUser = false, bool includeIssue = false)
 {
     return Service<IssueService>().GetIssueDetails(
         criteria, includeSummary, includeUser, includeIssue);
 }
Esempio n. 4
0
        IList<Issue> Search(IssueSearchCriteriaModel criteria)
        {
            if (criteria == null) criteria = new IssueSearchCriteriaModel();

            var issues = Repo<Issue>().Find();

            if (criteria.CreatedByUserId.HasValue)
                issues = issues.Where(i => i.CreatedByUserId == criteria.CreatedByUserId.Value);
            if (criteria.AssignedToUserId.HasValue)
                issues = issues.Where(i => i.AssignedToUserId == criteria.AssignedToUserId.Value);
            if (criteria.IssueTypeId.HasValue)
                issues = issues.Where(i => i.IssueTypeId == criteria.IssueTypeId.Value);
            if (criteria.IssueStatusId.HasValue)
                issues = issues.Where(i => i.IssueStatusId == criteria.IssueStatusId.Value);
            if (criteria.IssuePriorityId.HasValue)
                issues = issues.Where(i => i.IssuePriorityId == criteria.IssuePriorityId.Value);
            if (criteria.Summary != null)
                issues = issues.Where(i => i.Summary.Contains(criteria.Summary));

            if (criteria.SortField == "ModifiedOn") issues = issues.OrderBy(c => c.ModifiedOn);
            else issues = issues.OrderBy(u => u.CreatedOn);

            return issues.Skip(criteria.Skip ?? 0).Take(criteria.Take ?? 10).ToList();
        }
 public IEnumerable<IssueSummaryModel> Summary(IssueSearchCriteriaModel criteria)
 {
     return Service<IssueService>().GetIssueSummaries(criteria);
 }