Пример #1
0
        private IEnumerable <UserHubModel> GetUserHubs(string userName)
        {
            var warehouses = from v in _userHubService.GetAllUserHub()
                             where v.UserProfile.UserName == userName
                             select v.HubID;

            var userHubs = from v in _hubService.GetAllHub()
                           select new UserHubModel {
                HubID = v.HubID, Name = v.Name + " : " + v.HubOwner.Name, Selected = warehouses.Contains(v.HubID)
            };

            return(userHubs.ToList());
        }
Пример #2
0
        private IEnumerable <HubUserViewModel> GetUserHub()
        {
            var result        = _userHubService.GetAllUserHub();
            var viewModelList = new List <HubUserViewModel>();

            foreach (var hubOwner in result)
            {
                var ownerViewModel = new HubUserViewModel();

                ownerViewModel.HubID         = hubOwner.HubID;
                ownerViewModel.UserHubID     = hubOwner.UserHubID;
                ownerViewModel.UserProfileID = hubOwner.UserProfileID;


                viewModelList.Add(ownerViewModel);
            }

            return(viewModelList);
        }
Пример #3
0
        //
        // GET: /UserWarehouse/

        public ViewResult Index()
        {
            var userwarehouses = _userHubService.GetAllUserHub();

            return(View(userwarehouses.ToList()));
        }