Пример #1
0
        public SideMenuControl()
        {
            InitializeComponent();

            // Set the data context to dedicated view model
            DataContext = new SideMenuViewModel();
        }
        public ActionResult SideMenu()
        {
            SideMenuViewModel sideMenu = new SideMenuViewModel();
            sideMenu.Courses = this.coursesService
                .GetAll()
                .OrderByDescending(c => c.CreatedOn)
                .Take(5)
                .To<CourseViewModel>()
                .ToList();

            sideMenu.Specialties = this.specialtiesService
                .GetAll()
                .OrderByDescending(c => c.CreatedOn)
                .Take(5)
                .To<SpecialtyViewModel>()
                .ToList();

            var trainerRole = this.usersService.GetRoles().FirstOrDefault(r => r.Name == RoleConstants.Trainer);
            if (trainerRole != null)
            {
                sideMenu.Trainers = this.usersService
                        .GetAll()
                        .Where(u => u.Roles.Any(r => r.RoleId == trainerRole.Id))
                        .OrderByDescending(c => c.CreatedOn)
                        .Take(5)
                        .To<UserViewModel>()
                        .ToList();
            }  

            return this.PartialView("_SideMenu", sideMenu);
        }
Пример #3
0
        public MenuWithSubMenuControl()
        {
            InitializeComponent();

            //Binding our ViewModel with the datacontext to read the Menu & SubMenuItemsData
            DataContext = new SideMenuViewModel();
        }
        public ActionResult SideMenu()
        {
            SideMenuViewModel model = new SideMenuViewModel();

            model.ProductCount  = _productManager.GetCount();
            model.CategoryCount = _categoryManager.GetCount();
            return(PartialView("_SideMenu", model));
        }
 public SideMenu()
 {
     InitializeComponent();
     Xamarin.Forms.NavigationPage.SetHasNavigationBar(this, false);
     Xamarin.Forms.NavigationPage.SetHasBackButton(this, false);
     On <Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true);
     BindingContext = sideMenuViewModel = new SideMenuViewModel();
 }
Пример #6
0
        public dynamic GetViewModel()
        {
            var sideMenuViewModel = new SideMenuViewModel();

            sideMenuViewModel.Menu = productCategoryRepository.FindAllBy(productCategory =>
                                                                         productCategory.Active &&
                                                                         !productCategory.IdRootCategory.HasValue);
            FilterActiveChields(sideMenuViewModel);
            return(sideMenuViewModel);
        }
Пример #7
0
 private void FilterActiveChields(SideMenuViewModel sideMenuViewModel)
 {
     sideMenuViewModel.Menu.ToList().ForEach(pc =>
     {
         if (pc.ProductCategoryChields != null)
         {
             pc.ProductCategoryChields = pc.ProductCategoryChields.Where(c => c.Active).ToList();
         }
     });
 }
Пример #8
0
        public MainPage()
        {
            InitializeComponent();

            Detail = new NavigationPage(new TabbedPage1());
            NavigationPage.SetHasNavigationBar(this, true);

            viewModel      = new SideMenuViewModel();
            BindingContext = viewModel;
        }
Пример #9
0
        public PartialViewResult SideMenu(string activeMenu = "")
        {
            var model = new SideMenuViewModel()
            {
                SideMenu           = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync("SideMenu", AbpSession.ToUserIdentifier())),
                ActiveMenuItemName = activeMenu
            };

            return(PartialView("_SideMenu", model));
        }
Пример #10
0
        public SideMenuView()
        {
            DataContext = new SideMenuViewModel();

            var stackPanel = new StackPanel();

            AddSortButton(stackPanel);
            AddSortPropertiesChooser(stackPanel);

            Content = stackPanel;
        }
Пример #11
0
        public IActionResult Index()
        {
            var sideMenu = new SideMenuViewModel();
            var response = _jokeGeneratorService.GetCategories();

            if (response.Result.IsSuccess)
            {
                sideMenu.Categories = response.Result.Result;
            }
            return(View(sideMenu));
        }
Пример #12
0
        public PartialViewResult SideMenu(string currentPageName = "")
        {
            var isGrantedPermission = PermissionChecker.IsGranted(AbpSession.ToUserIdentifier(), UserPermissions.User);
            var model = new SideMenuViewModel
            {
                MainMenu        = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync("Mpa", AbpSession.ToUserIdentifier())),
                CurrentPageName = currentPageName
            };

            return(PartialView("_SideMenu", model));
        }
        public object CreateViewModel(DependencyObject sender)
        {
            var vm = new SideMenuViewModel();

            /*if (Designer.IsDesignMode)
             *  vm.ServiceLocator.RegisterServiceObject<ISideMenuDataAccess>(new ModelsDesignTime.DesignTimePeopleDataAccess());
             * else
             *  vm.ServiceLocator.RegisterServiceObject<ISideMenuDataAccess>(new SideMenuDataAccess());*/
            vm.ServiceLocator.RegisterServiceObject <ISideMenuDataAccess>(new SideMenuDataAccess());
            return(vm);
        }
Пример #14
0
        public ActionResult Index()
        {
            var model = new SideMenuViewModel {
                Title = "Top Weekly Sellers"
            };

            var _StartDate = DateTime.Now;
            var _EndDate   = DateTime.Now;
            var c          = DateTime.Now;

            CalculateDates(c, ref _StartDate, ref _EndDate);
            model.Items = LoadProducts(_StartDate, _EndDate);

            return(View(model));
        }
Пример #15
0
        //
        // GET: /ContentBlocks/TopWeeklySellers/

        public ActionResult Index(ContentBlock b)
        {
            SideMenuViewModel model = new SideMenuViewModel();

            model.Title = "Top Weekly Sellers";


            DateTime _StartDate = DateTime.Now;
            DateTime _EndDate   = DateTime.Now;

            System.DateTime c = DateTime.Now;
            CalculateDates(c, _StartDate, _EndDate);
            model.Items = LoadProducts(_StartDate, _EndDate);

            return(View(model));
        }
Пример #16
0
        public ActionResult SideMenu()
        {
            ProductManager _productManager = new ProductManager();

            CategoryManager _categoryManager = new CategoryManager();

            CustomerManager _customerManager = new CustomerManager();
            SupplierManager _supplierManager = new SupplierManager();

            SideMenuViewModel model = new SideMenuViewModel();

            model.ProductCount  = _productManager.GetCount();
            model.CategoryCount = _categoryManager.GetCount();
            model.CustomerCount = _customerManager.GetCount();
            model.SupplierCount = _supplierManager.GetCount();
            return(PartialView("_SideMenu", model));
        }
        public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
        {
            SideMenuViewModel model = new SideMenuViewModel();

            model.Title = "Top Weekly Sellers";

            DateTime _StartDate = DateTime.Now;
            DateTime _EndDate   = DateTime.Now;

            System.DateTime c = DateTime.Now;
            CalculateDates(c, _StartDate, _EndDate);
            model.Items = LoadProducts(app, _StartDate, _EndDate);

            model.Title = "Top Sellers";

            return(RenderModel(model));
        }
Пример #18
0
        /// <summary>
        ///     ctor().
        /// </summary>
        public SideMenuView()
        {
            InitializeComponent();

            int wd = DependencyService.Get <IDisplaySize>().GetWidthDiP();

            WidthRequest = wd * 0.65;

            MenuOrientations = MenuOrientation.LeftToRight;

            IsFullScreen = true;
            AnimationDurationMillisecond = 250;

            BackgroundViewColor = GetPlatformColor();
            BackgroundColor     = Color.FromHex("#ffffff");

            BindingContext = _viewModel = new SideMenuViewModel();
        }
Пример #19
0
        public string RenderModel(SideMenuViewModel model)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("<div class=\"sidemenu topsellers\">");
            sb.Append("<div class=\"decoratedblock\">");
            sb.Append("<h3>" + HttpUtility.HtmlEncode(model.Title) + "</h3>");
            sb.Append("<ol>");
            foreach (var item in model.Items)
            {
                sb.Append("<li><a href=\"" + item.Url + "\" title=\"" + HttpUtility.HtmlEncode(item.Title) + "\">" + HttpUtility.HtmlEncode(item.Name) + "</a></li>");
            }
            sb.Append("</ol>");
            sb.Append("</div>");
            sb.Append("</div>");

            return(sb.ToString());
        }
Пример #20
0
        private static void MenuMapRoute(RouteCollection routes)
        {
            SideMenuService   menuService       = new SideMenuService(new GenericRepository <ProductCategory>());
            SideMenuViewModel sideMenuViewModel = menuService.GetViewModel();

            foreach (var menu in sideMenuViewModel.Menu)
            {
                foreach (var item in menu.ProductCategoryChields)
                {
                    routes.MapRoute(
                        name: string.Format("{0}{1}", item.RootCategory.Name, item.Name),
                        url: string.Concat(item.RootCategory.NameForRoute, "/{nameCategory}/{searchText}"),
                        defaults: new { controller = "Home", action = "Index", nameRootCategory = item.RootCategory.Name, nameCategory = UrlParameter.Optional, SearchText = UrlParameter.Optional });
                }
                ;
            }
            ;
        }
Пример #21
0
        public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
        {
            SideMenuViewModel model = new SideMenuViewModel();

            if (block != null)
            {
                model.Title = block.BaseSettings.GetSettingOrEmpty("Title");

                List <ContentBlockSettingListItem> links = block.Lists.FindList("Links");
                if (links != null)
                {
                    foreach (ContentBlockSettingListItem l in links)
                    {
                        model.Items.Add(AddSingleLink(l));
                    }
                }
            }

            return(RenderModel(model));
        }
Пример #22
0
        //
        // GET: /ContentBlocks/SideMenu/

        public ActionResult Index(ContentBlock block)
        {
            SideMenuViewModel model = new SideMenuViewModel();

            if (block != null)
            {
                model.Title = block.BaseSettings.GetSettingOrEmpty("Title");

                List <ContentBlockSettingListItem> links = block.Lists.FindList("Links");
                if (links != null)
                {
                    foreach (ContentBlockSettingListItem l in links)
                    {
                        model.Items.Add(AddSingleLink(l));
                    }
                }
            }

            return(View(model));
        }
        //
        // GET: /ContentBlocks/Top10Products/

        public ActionResult Index(ContentBlock b)
        {
            SideMenuViewModel model = new SideMenuViewModel();

            System.DateTime s        = new System.DateTime(1900, 1, 1);
            System.DateTime e        = new System.DateTime(3000, 12, 31);
            List <Product>  products = MTApp.ReportingTopSellersByDate(s, e, 10);

            foreach (Product p in products)
            {
                SideMenuItem item = new SideMenuItem();
                item.Title = p.ProductName;
                item.Name  = p.ProductName;
                item.Url   = UrlRewriter.BuildUrlForProduct(p, MTApp.CurrentRequestContext.RoutingContext, string.Empty);
                item.Name += " - " + p.SitePrice.ToString("C");
                model.Items.Add(item);
            }

            model.Title = "Top Sellers";
            return(View(model));
        }
Пример #24
0
        public ActionResult SideMenu()
        {
            var user     = Mapper.Map <UserViewModel>(this.UserProfile);
            var partners = this.Organizations.GetPartners(this.UserProfile.OrganizationId ?? 0)
                           .Project()
                           .To <PartnersViewModel>()
                           .ToList();

            var categories = this.Categories.GetAll()
                             .Project()
                             .To <CategoryViewModel>()
                             .ToList();

            var model = new SideMenuViewModel
            {
                Partners      = partners,
                UserViewModel = user,
                Categories    = categories
            };

            return(this.PartialView("_SideMenuPartial", model));
        }
Пример #25
0
        public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
        {
            SideMenuViewModel model = new SideMenuViewModel();

            System.DateTime s = new System.DateTime(1900, 1, 1);
            System.DateTime e = new System.DateTime(3000, 12, 31);
            List <Product>  products;

            products = app.ReportingTopSellersByDate(s, e, 10);
            foreach (Product p in products)
            {
                SideMenuItem item = new SideMenuItem();
                item.Title = p.ProductName;
                item.Name  = p.ProductName;
                item.Url   = UrlRewriter.BuildUrlForProduct(p, app.CurrentRequestContext.RoutingContext, string.Empty);
                item.Name += " - " + p.SitePrice.ToString("C");
                model.Items.Add(item);
            }

            model.Title = "Top Sellers";

            return(RenderModel(model));
        }
Пример #26
0
        public string RenderModel(SideMenuViewModel model)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("<div class=\"sidemenu\">");
            sb.Append("<div class=\"decoratedblock\">");
            sb.Append("<h4>" + HttpUtility.HtmlEncode(model.Title) + "</h4>");
            sb.Append("<ul>");
            foreach (var item in model.Items)
            {
                sb.Append("<li><a href=\"" + item.Url + "\" class=\"" + HttpUtility.HtmlEncode(item.CssClass) + "\" title=\"" + HttpUtility.HtmlEncode(item.Title));
                if (item.OpenInNewWindow == true)
                {
                    sb.Append(" target=\"_blank\"");
                }
                sb.Append("\">" + HttpUtility.HtmlEncode(item.Name) + "</a></li>");
            }
            sb.Append("</ul>");
            sb.Append("</div>");
            sb.Append("</div>");

            return(sb.ToString());
        }
        public ActionResult Index()
        {
            var model = new SideMenuViewModel();

            var            s = new DateTime(1900, 1, 1);
            var            e = new DateTime(3000, 12, 31);
            List <Product> products;

            products = HccApp.ReportingTopSellersByDate(s, e, 10);
            foreach (var p in products)
            {
                var item = new SideMenuItem
                {
                    Title = p.ProductName,
                    Name  = p.ProductName,
                    Url   = UrlRewriter.BuildUrlForProduct(p)
                };
                item.Name += " - " + p.SitePrice.ToString("C");
                model.Items.Add(item);
            }

            model.Title = "Top Sellers";
            return(View(model));
        }
Пример #28
0
 public SideMenu()
 {
     this.InitializeComponent();
     DataContext = new SideMenuViewModel();
 }
        public SideMenuControl()
        {
            InitializeComponent();

            DataContext = new SideMenuViewModel();
        }
Пример #30
0
        public PartialViewResult SideBar()
        {
            SideMenuViewModel sideMenuViewModel = menuService.GetViewModel();

            return(PartialView("_SideBar", sideMenuViewModel));
        }
Пример #31
0
        private void Storyboard_Completed(object sender, EventArgs e)
        {
            SideMenuViewModel viewModel = this.DataContext as SideMenuViewModel;

            viewModel.CloseMenu.Execute(null);
        }