public IEnumerable <QuoteItem> GetQuoteItemsForJobItem(Guid jobItemId) { if (!CurrentUser.HasRole(UserRole.Member)) { throw new DomainValidationException(Messages.InsufficientSecurity, "CurrentUser"); } return(_quoteItemRepository.GetQuoteItemsForJobItem(jobItemId)); }
private QuoteItem GetQuoteItem(Guid jobItemId) { var quoteItem = _quoteItemRepository.GetQuoteItemsForJobItem(jobItemId).OrderByDescending(qi => qi.Quote.DateCreated).FirstOrDefault(); if (quoteItem == null) { throw new DomainValidationException(Messages.QuoteItemNull, "JobItemId"); } if (quoteItem.Status.Type == ListItemType.StatusQuotedPrepared) { throw new DomainValidationException(Messages.QuoteStatusInvalid, "JobItemId"); } return(quoteItem); }
private QuoteItem GetQuoteItem(Guid jobItemId) { return(_quoteItemRepository.GetQuoteItemsForJobItem(jobItemId).OrderByDescending(qi => qi.Quote.DateCreated).FirstOrDefault()); }