Пример #1
0
        // GET: Explore
        public ActionResult Index()
        {
            ExploreViewModel model = new ExploreViewModel();

            var categories = this.aimCategoryService.GetAimCategories();

            model.AimCategories = mapper.Map <IEnumerable <AimCategoryViewModel> >(categories);

            return(View(model));
        }
Пример #2
0
        public IActionResult Explore(int id)
        {
            var warehouse = _repository.Get <Warehouse>(id);

            List <string> aisles = new List <string>();
            List <string> bins   = new List <string>();

            if (warehouse.AisleOrder == Order.NUMERIC)
            {
                for (int i = 1; i <= warehouse.Aisles; i++)
                {
                    aisles.Add(i.ToString());
                }
            }
            else
            {
                var letter = (int)'a';
                for (int i = 0; i < warehouse.Aisles; i++)
                {
                    aisles.Add(((char)(letter + i)).ToString().ToUpper());
                }
            }

            if (warehouse.BinOrder == Order.NUMERIC)
            {
                for (int i = 1; i <= warehouse.BinsPerAisle; i++)
                {
                    bins.Add(i.ToString());
                }
            }
            else
            {
                var letter = (int)'a';
                for (int i = 0; i < warehouse.BinsPerAisle; i++)
                {
                    bins.Add(((char)(letter + i)).ToString().ToUpper());
                }
            }

            var vm = new ExploreViewModel()
            {
                Code   = warehouse.Code,
                Aisles = aisles,
                Bins   = bins
            };

            return(View(vm));
        }
Пример #3
0
        public IActionResult Explore(ProjectCategory category)
        {
            var listprojects = projectService_.SearchProjects(new SearchProjectOptions {
                Category = category
            }).ToList();
            var explore = new ExploreViewModel()
            {
                Category    = category,
                ProjectList = listprojects
            };

            //if (usermodel.P == null)
            //{
            //    return StatusCode((int)user.ErrorCode, user.ErrorText);
            //}

            return(View(explore));
        }
Пример #4
0
        public ActionResult Explore()
        {
            var posts = _context.Posts
                        .Include(p => p.User)
                        .OrderByDescending(p => p.DateTime)
                        .ToList();

            var userId    = User.Identity.GetUserId();
            var followees = _context.Follows.Where(f => f.FollowerId == userId).Select(f => f.Followee)
                            .ToLookup(u => u.Id);

            var viewModel = new ExploreViewModel
            {
                Posts     = posts,
                Followees = followees
            };

            return(View(viewModel));
        }
Пример #5
0
        public async Task <IActionResult> Index()
        {
            var userId = identityService.GetUserId();

            var model = new ExploreViewModel();

            model.Feeds = await feedRepository.GetFeeds()
                          .Select(f => new FeedViewModel
            {
                FeedId           = f.FeedId,
                FeedType         = f.FeedType,
                Description      = f.Description,
                Name             = f.Name,
                SubscribersCount = f.Subscribers.Count(),
                IsSubscribedTo   = f.Subscribers.Any(s => s.UserId == userId)
            })
                          .ToListAsync();

            return(View(model));
        }
Пример #6
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
            Loaded  += MainPage_Loaded;
            App.date = DateTime.Now.ToString("yyyyMMdd");
            //find location from gps
            FindLocation();

            //call new on view model
            exploreViewModel            = new ExploreViewModel();
            ExplorePanorama.DataContext = exploreViewModel;
            exploreViewModel.loadExplore(exploreProgressBar, exploreList);

            //visibility of progress bar
            exploreProgressBar.Visibility = System.Windows.Visibility.Visible;
            exploreProgressBar.IsEnabled  = true;
        }
Пример #7
0
        public ExplorePage()
        {
            InitializeComponent();

            BindingContext = viewModel = new ExploreViewModel();
        }
Пример #8
0
        public ExplorePage()
        {
            InitializeComponent();

            ViewModel = (ExploreViewModel)DataContext;
        }
 internal ExploreView(ExploreViewModel model)
 {
     model.Navigation = Navigation;
     BindingContext   = model;
     InitializeComponent();
 }