Ejemplo n.º 1
0
        public List <User> GetQuoteUsers(int quoteid)
        {
            var userids = DummyQuoteUsersData.addQuoteUsers().Where(q => q.QuoteId == quoteid).Select(q => q.UserId).ToArray();
            var users   = DummyUserData.addUsers().Where(u => userids.Contains(u.Id)).ToList();

            return(users);
        }
Ejemplo n.º 2
0
        public List <UserQuoteViewModel> GetSearchUsers(string firstName, string lastName, int quoteId)
        {
            List <UserQuoteViewModel> userQuoteModel = new List <UserQuoteViewModel>();
            var userids = DummyQuoteUsersData.addQuoteUsers().Where(q => q.QuoteId == quoteId).Select(q => q.UserId).ToArray();
            var users   = DummyUserData.addUsers().Where(u => firstName.ToLower().Contains(u.FirstName.ToLower()) || lastName.ToLower().Contains(u.LastName.ToLower())).ToList();

            foreach (var user in users)
            {
                userQuoteModel.Add(new UserQuoteViewModel {
                    user = user, IsExistingUser = userids.Contains(user.Id) ? true: false
                });
            }

            return(userQuoteModel);
        }