コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                IncludeCss("LatestItems", "/Templates/" + TemplateName + "/css/MessageBox/style.css", "/Templates/" + TemplateName + "/css/ImageGallery/styles.css",
                           "/Templates/" + TemplateName + "/css/PopUp/style.css",
                           "/Templates/" + TemplateName + "/css/MessageBox/style.css",
                           "/Templates/" + TemplateName + "/css/FancyDropDown/fancy.css",
                           "/Templates/" + TemplateName + "/css/ToolTip/tooltip.css", "/Templates/" + TemplateName + "/css/PopUp/popbox.css");
                IncludeJs("LatestItems", "/js/DateTime/date.js", "/js/MessageBox/jquery.easing.1.3.js", "/js/MessageBox/alertbox.js",
                          "/Modules/AspxCommerce/AspxLatestItems/js/LatestItems.js", "/js/jquery.tipsy.js", "/js/ImageGallery/jquery.pikachoose.js", "/js/ImageGallery/jquery.jcarousel.js", "/js/ImageGallery/jquery.mousewheel.js",
                          "/js/jDownload/jquery.jdownload.js", "/js/MessageBox/alertbox.js", "/js/DateTime/date.js", "/js/PopUp/custom.js", "/js/PopUp/popbox.js",
                          "/js/FancyDropDown/itemFancyDropdown.js",
                          "/js/jquery.masonry.js");
                StoreID      = GetStoreID;
                PortalID     = GetPortalID;
                CustomerID   = GetCustomerID;
                UserName     = GetUsername;
                CultureName  = GetCurrentCultureName;
                aspxfilePath = ResolveUrl("~") + "Modules/AspxCommerce/AspxItemsManagement/";
                if (HttpContext.Current.Session.SessionID != null)
                {
                    SessionCode = HttpContext.Current.Session.SessionID.ToString();
                }
                if (HttpContext.Current.Session.SessionID != null)
                {
                    SessionCode = HttpContext.Current.Session.SessionID.ToString();
                }
                if (SageUserModuleID != "")
                {
                    UserModuleID = int.Parse(SageUserModuleID);
                }
                else
                {
                    UserModuleID = 0;
                }
                //StoreSettingInfo DefaultStoreSettings = (StoreSettingInfo)Session["DefaultStoreSettings"];
                //DefaultStoreSettings.AllowAnonymousCheckOut
                UserIp = HttpContext.Current.Request.UserHostAddress;
                IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();
                ipToCountry.GetCountry(UserIp, out CountryName);

                StoreSettingConfig ssc = new StoreSettingConfig();
                DefaultImagePath        = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, StoreID, PortalID, CultureName);
                NoOfLatestItems         = int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.NoOfLatestItemsDisplay, StoreID, PortalID, CultureName));
                EnableLatestItems       = ssc.GetStoreSettingsByKey(StoreSetting.EnableLatestItems, StoreID, PortalID, CultureName);
                AllowOutStockPurchase   = ssc.GetStoreSettingsByKey(StoreSetting.AllowOutStockPurchase, StoreID, PortalID, CultureName);
                MaxCompareItemCount     = int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.MaxNoOfItemsToCompare, StoreID, PortalID, CultureName));
                NoOfLatestItemsInARow   = int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.NoOfLatestItemsInARow, StoreID, PortalID, CultureName));
                AllowWishListLatestItem = ssc.GetStoreSettingsByKey(StoreSetting.EnableWishList, StoreID, PortalID, CultureName);
                AllowAddToCompareLatest = ssc.GetStoreSettingsByKey(StoreSetting.EnableCompareItems, StoreID, PortalID, CultureName);
                LatestItemRss           = ssc.GetStoreSettingsByKey(StoreSetting.LatestItemRss, StoreID, PortalID, CultureName);
                if (LatestItemRss.ToLower() == "true")
                {
                    RssFeedUrl = ssc.GetStoreSettingsByKey(StoreSetting.RssFeedURL, StoreID, PortalID, CultureName);
                }
            }
            IncludeLanguageJS();
            if (EnableLatestItems.ToLower() == "true" && NoOfLatestItems > 0)
            {
                GetLatestItemsByCount();
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                aspxCommonObj.StoreID     = GetStoreID;
                aspxCommonObj.PortalID    = GetPortalID;
                aspxCommonObj.UserName    = GetUsername;
                aspxCommonObj.CustomerID  = GetCustomerID;
                aspxCommonObj.CultureName = GetCurrentCultureName;
                IncludeCss("LatestBookItems", "/Templates/" + TemplateName + "/css/StarRating/jquery.rating.css");

                IncludeJs("LatestBookItems", "/Modules/AspxCommerce/AspxLatestItemsAnimation/js/LatestItemsAnimation.js", "/js/StarRating/jquery.rating.js"
                          );

                UserIp = HttpContext.Current.Request.UserHostAddress;
                IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();
                ipToCountry.GetCountry(UserIp, out CountryName);
                StoreSettingConfig ssc = new StoreSettingConfig();
                DefaultImagePath = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, aspxCommonObj.StoreID,
                                                             aspxCommonObj.PortalID, aspxCommonObj.CultureName);

                NoOfLatestItems =
                    int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.NoOfLatestItemsDisplay, aspxCommonObj.StoreID,
                                                        aspxCommonObj.PortalID, aspxCommonObj.CultureName));

                EnableLatestItems = ssc.GetStoreSettingsByKey(StoreSetting.EnableLatestItems, aspxCommonObj.StoreID,
                                                              aspxCommonObj.PortalID, aspxCommonObj.CultureName);

                AllowOutStockPurchase = ssc.GetStoreSettingsByKey(StoreSetting.AllowOutStockPurchase,
                                                                  aspxCommonObj.StoreID,
                                                                  aspxCommonObj.PortalID, aspxCommonObj.CultureName);

                NoOfLatestItemsInARow =
                    int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.NoOfLatestItemsInARow, aspxCommonObj.StoreID,
                                                        aspxCommonObj.PortalID, aspxCommonObj.CultureName));

                AllowWishListLatestItem = ssc.GetStoreSettingsByKey(StoreSetting.EnableWishList, aspxCommonObj.StoreID,
                                                                    aspxCommonObj.PortalID, aspxCommonObj.CultureName);

                LatestItemRss = ssc.GetStoreSettingsByKey(StoreSetting.LatestItemRss, aspxCommonObj.StoreID,
                                                          aspxCommonObj.PortalID, aspxCommonObj.CultureName);
                AllowAddToCompareLatest = ssc.GetStoreSettingsByKey(StoreSetting.EnableCompareItems, aspxCommonObj.StoreID,
                                                                    aspxCommonObj.PortalID, aspxCommonObj.CultureName);
                MaxCompareItemCount = int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.MaxNoOfItemsToCompare, aspxCommonObj.StoreID,
                                                                          aspxCommonObj.PortalID, aspxCommonObj.CultureName));
                if (LatestItemRss.ToLower() == "true")
                {
                    RssFeedUrl = ssc.GetStoreSettingsByKey(StoreSetting.RssFeedURL, aspxCommonObj.StoreID,
                                                           aspxCommonObj.PortalID, aspxCommonObj.CultureName);
                }
            }
            if (EnableLatestItems.ToLower() == "true" && NoOfLatestItems > 0)
            {
                // GetLatestItemAnimation();
            }

            IncludeLanguageJS();
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }