Ejemplo n.º 1
0
        public ActionResult Index(string instance, int?width, int?height)
        {
            if (MainLayoutViewModel.IsSingleCourseStore)
            {
                ItemProductPageToken token;
                if (MainLayoutViewModel.NumCourses > 0 && MainLayoutViewModel.CategoriesList != null && MainLayoutViewModel.CategoriesList.Any())
                {
                    token = _widgetServices.GetWixDefaultItem(MainLayoutViewModel.CategoriesList.Select(x => x.WebStoreCategoryID).ToList(), CurrentUserId);
                }
                else
                {
                    token = _widgetServices.GetPlaceHolderItemInfoToken();
                }

                return(View("~/Areas/Widget/Views/Wix/PlaceHolder.cshtml", token));
            }

            var pagesize = _widgetServices.NumItemsInPage(width, height);

            const int page = 1;

            // var sort = "";

            string error;
            var    instanceDTO = instance.DecodeInstance2WixInstanceDTO(out error);

            if (instanceDTO == null)
            {
                return(View("~/Areas/Widget/Views/Shared/Error.cshtml"));
            }

            var currencyId = Constants.DEFAULT_CURRENCY_ID;

            if (MainLayoutViewModel != null && MainLayoutViewModel.WebStore != null && MainLayoutViewModel.WebStore.CurrencyId != null)
            {
                currencyId = (short)MainLayoutViewModel.WebStore.CurrencyId;
            }

            var model = _widgetServices.GetIndexModelView(currencyId, instanceDTO.instanceId.ToString(), page, "", pagesize, MainLayoutViewModel.Category != null ? MainLayoutViewModel.Category.WebStoreCategoryID : (int?)null, MainLayoutViewModel.CategoryName ?? "", CurrentUserId, MainLayoutViewModel.WixViewMode ?? "site");

            if (MainLayoutViewModel.WixViewMode == "editor")
            {
            }

            return(model == null?View("~/Areas/Widget/Views/Shared/Error.cshtml") : View("~/Areas/Widget/Views/Widget/Index.cshtml", model));
        }
Ejemplo n.º 2
0
        public ActionResult FacebookTab(string trackingId, int?width, int?height)
        {
            if (MainLayoutViewModel.IsSingleCourseStore)
            {
                ItemProductPageToken token;
                if (MainLayoutViewModel.NumCourses > 0 && MainLayoutViewModel.CategoriesList != null && MainLayoutViewModel.CategoriesList.Any())
                {
                    token = _widgetServices.GetWixDefaultItem(MainLayoutViewModel.CategoriesList.Select(x => x.WebStoreCategoryID).ToList(), CurrentUserId);
                }
                else
                {
                    token = _widgetServices.GetPlaceHolderItemInfoToken();
                }
                return(View("FacebookPlaceHolder", token));
            }

            var       pagesize = _widgetServices.NumItemsInPage(width, height);
            const int page     = 1;

            var model = _widgetServices.GetIndexModelView(_webStorePortalServices.GetStoreCurrencyByTrackingId(trackingId), trackingId, page, "", pagesize, null, "", CurrentUserId, MainLayoutViewModel.WixViewMode);

            return(model == null?View("~/Areas/Widget/Views/Shared/Error.cshtml") : View("~/Areas/Widget/Views/Widget/Index.cshtml", model));
        }