public ICollection <AppUser> GetAllExistingSubcribers()
        {
            //   var users = _userManager.GetUsersInRoleAsync("VENDOR").Result;

            var users = _context.Users
                        .Include(x => x.NextOfKin);


            foreach (var user in users)
            {
                var subscriptions =
                    _context
                    .Subscriptions
                    .Include(x => x.Offer)
                    .Include(x => x.Offer.Plot)
                    .Include(x => x.Offer.OfferStatus)
                    .Include(x => x.OrganizationType)
                    .Include(x => x.SubscriptionStatus)
                    .Where(x => x.AppUserId == user.Id).ToList();

                user.Subscriptions = subscriptions;
                user.Plots         = _plotRepository.GetPlots().Where(x => x.AppUserId == user.Id).ToList();
            }

            return(users.ToList());
            //return users.Where(x => x.IsExisting == true).ToList();
        }
Exemple #2
0
        private async Task <ActionResult> PlotList(int projectId, Func <PlotFolder, bool> predicate)
        {
            var allFolders = await _plotRepository.GetPlots(projectId);

            var folders = allFolders.Where(predicate).ToList(); //Sadly, we have to do this, as we can't query using complex properties
            var project = await GetProjectFromList(projectId, folders);

            return(View("Index", new PlotFolderListViewModel(folders, project, CurrentUserIdOrDefault)));
        }
Exemple #3
0
 /// <summary>
 /// Get All Plots In The System
 /// </summary>
 /// <returns></returns>
 public IEnumerable <Plot> AllPlots()
 {
     return(_plotRepository.GetPlots());
 }