Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            AspxCommonInfo aspxCommonObj = new AspxCommonInfo();
            aspxCommonObj.StoreID     = GetStoreID;
            aspxCommonObj.PortalID    = GetPortalID;
            aspxCommonObj.UserName    = GetUsername;
            aspxCommonObj.CultureName = GetCurrentCultureName;
            if (!IsPostBack)
            {
                StoreSettingConfig ssc = new StoreSettingConfig();
                if (Session["CurrencyCode"] != null && Session["CurrencyCode"] != "")
                {
                    SelectedCurrency = Session["CurrencyCode"].ToString();
                }
                else
                {
                    SelectedCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetStoreID, GetPortalID, GetCurrentCultureName);
                }
                IncludeJs("Currencyconversion", "/js/CurrencyFormat/jquery.formatCurrency-1.4.0.js", "/js/CurrencyFormat/jquery.formatCurrency.all.js", "/js/FancyDropDown/fancyDropDown.js", "/Modules/AspxCommerce/AspxCurrencyConverter/js/AspxCurrencyConverter.js");//
                IncludeCss("Currencyconversion", "/Templates/" + TemplateName + "/css/FancyDropDown/fancy.css");
                StoreID      = GetStoreID;
                PortalID     = GetPortalID;
                CultureName  = GetCurrentCultureName;
                MainCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, StoreID, PortalID, CultureName);

                MyAccoutURL = ssc.GetStoreSettingsByKey(StoreSetting.MyAccountURL, StoreID, PortalID, CultureName);
                SingleAddressCheckOutURL = ssc.GetStoreSettingsByKey(StoreSetting.SingleCheckOutURL, StoreID, PortalID, CultureName);
                CompareItemListURL       = ssc.GetStoreSettingsByKey(StoreSetting.CompareItemURL, StoreID, PortalID, CultureName);
                MyCartURL       = ssc.GetStoreSettingsByKey(StoreSetting.ShoppingCartURL, StoreID, PortalID, CultureName);
                AdditionalCVR   = ssc.GetStoreSettingsByKey(StoreSetting.AdditionalCVR, StoreID, PortalID, CultureName);
                ItemMgntPageURL = ssc.GetStoreSettingsByKey(StoreSetting.ItemMgntPageURL, StoreID, PortalID, CultureName);
                if (Session["Region"] != null && Session["Region"] != "")
                {
                    Region = Session["Region"].ToString();
                }
                else
                {
                    Region = StoreSetting.GetRegionFromCurrencyCode(SelectedCurrency, StoreID, PortalID);
                }

                AspxCommerceWebService aws = new AspxCommerceWebService();
                aws.GetCurrencyRateOnChange(aspxCommonObj, MainCurrency, SelectedCurrency, Region);
                if (Session["CurrencyRate"] != null && Session["CurrencyRate"] != "")
                {
                    currencyRate = Math.Round(double.Parse(Session["CurrencyRate"].ToString()), 4);
                }
            }
            IncludeLanguageJS();
            //BindCurrencyList();
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         AspxCommonInfo aspxCommonObj = new AspxCommonInfo();
         aspxCommonObj.StoreID     = GetStoreID;
         aspxCommonObj.PortalID    = GetPortalID;
         aspxCommonObj.UserName    = GetUsername;
         aspxCommonObj.CultureName = GetCurrentCultureName;
         if (!IsPostBack)
         {
             StoreSettingConfig ssc = new StoreSettingConfig();
             if (Session["CurrencyCode"] != null && Session["CurrencyCode"] != "")
             {
                 SelectedCurrency = Session["CurrencyCode"].ToString();
             }
             else
             {
                 SelectedCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetStoreID, GetPortalID, GetCurrentCultureName);
             }
             IncludeJs("Currencyconversion", "/js/FancyDropDown/fancyDropDown.js");//
             IncludeCss("Currencyconversion", "/Templates/" + TemplateName + "/css/FancyDropDown/fancy.css", "/Modules/AspxCommerce/AspxCurrencyConverter/css/module.css");
             StoreID      = GetStoreID;
             PortalID     = GetPortalID;
             CultureName  = GetCurrentCultureName;
             MainCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, StoreID, PortalID, CultureName);
             if (Session["Region"] != null && Session["Region"] != "")
             {
                 Region = Session["Region"].ToString();
             }
             else
             {
                 Region = StoreSetting.GetRegionFromCurrencyCode(SelectedCurrency, StoreID, PortalID);
             }
             AspxCoreController acc = new AspxCoreController();
             acc.GetCurrencyRateOnChange(aspxCommonObj, MainCurrency, SelectedCurrency, Region);
             if (Session["CurrencyRate"] != null && Session["CurrencyRate"] != "")
             {
                 currencyRate = Math.Round(double.Parse(Session["CurrencyRate"].ToString()), 4);
             }
         }
         IncludeLanguageJS();
         BindCurrencyList();
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
Beispiel #3
0
    private void LoadGlobalVariables()
    {
        StoreSettingConfig ssc          = new StoreSettingConfig();
        string             currencyCode = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetStoreID, GetPortalID, GetCurrentCultureName);

        if (currencyCode != null)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "region",
                                                    " var region='" +
                                                    StoreSetting.GetRegionFromCurrencyCode(currencyCode, GetStoreID,
                                                                                           GetPortalID) + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "curSymbol",
                                                    " var curSymbol='" +
                                                    StoreSetting.GetSymbolFromCurrencyCode(currencyCode, GetStoreID,
                                                                                           GetPortalID) + "';", true);
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             IncludeJs("Currencyconversion", "/js/Session.js", "/js/CurrencyFormat/jquery.formatCurrency-1.4.0.js", "/js/CurrencyFormat/jquery.formatCurrency.all.js", "/js/FancyDropDown/fancyDropDown.js",
                       "/Modules/AspxCommerce/AspxCurrencyConverter/js/Currencyconversion.js");
             StoreID     = GetStoreID;
             PortalID    = GetPortalID;
             CultureName = GetCurrentCultureName;
             StoreSettingConfig ssc = new StoreSettingConfig();
             MainCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, StoreID, PortalID, CultureName);
             Region       = StoreSetting.GetRegionFromCurrencyCode(MainCurrency, StoreID, PortalID);
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            AspxCommonInfo aspxCommonObj = new AspxCommonInfo();
            aspxCommonObj.StoreID     = GetStoreID;
            aspxCommonObj.PortalID    = GetPortalID;
            aspxCommonObj.UserName    = GetUsername;
            aspxCommonObj.CultureName = GetCurrentCultureName;

            if (!IsPostBack)
            {
                if (Session["OrderID"] != null)
                {
                    orderID = int.Parse(Session["OrderID"].ToString());
                }

                StoreSettingConfig ssc = new StoreSettingConfig();
                AspxCoreController acc = new AspxCoreController();
                MainCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetPortalID, GetPortalID, GetCurrentCultureName);

                if (Session["CurrencyCode"] != null && Session["CurrencyCode"] != "")
                {
                    SelectedCurrency = Session["CurrencyCode"].ToString();
                }
                else
                {
                    SelectedCurrency = MainCurrency;
                }
                if (Session["Region"] != null && Session["Region"] != "")
                {
                    Region = Session["Region"].ToString();
                }
                else
                {
                    Region = StoreSetting.GetRegionFromCurrencyCode(SelectedCurrency, GetStoreID, GetPortalID);
                }

                currencyRate = Convert.ToDecimal(acc.GetCurrencyRateOnChange(aspxCommonObj, MainCurrency, SelectedCurrency, Region));



                var sfConfig = new SageFrameConfig();
                _isUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
                PageExtension      = SageFrameSettingKeys.PageExtension;
                if (_isUseFriendlyUrls)
                {
                    if (!IsParent)
                    {
                        _sageRedirectPath = ResolveUrl(GetParentURL + "/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
                        _addressPath      = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/portal/" + GetPortalSEOName + "/";
                    }
                    else
                    {
                        _sageRedirectPath = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
                        _addressPath      = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/";
                    }
                }
                else
                {
                    _sageRedirectPath = ResolveUrl("{~/Default" + PageExtension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
                }

                var imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress");
                if (imgProgress != null)
                {
                    imgProgress.ImageUrl = GetTemplateImageUrl("ajax-loader.gif", true);
                }
                hlnkHomePage.NavigateUrl = _sageRedirectPath;
                SendEmailFrom            = ssc.GetStoreSettingsByKey(StoreSetting.SendEcommerceEmailsFrom, GetStoreID, GetPortalID, GetCurrentCultureName);
                SendOrderNotice          = ssc.GetStoreSettingsByKey(StoreSetting.SendOrderNotification, GetStoreID, GetPortalID, GetCurrentCultureName);

                if (Session["mb_IsCheckoutFromMobile"] != null)
                {
                    MobileSuccess(_sageRedirectPath);
                }
                else
                {
                    SendConfrimMessage(_sageRedirectPath);
                }
            }
            IncludeLanguageJS();
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Beispiel #6
0
        public void LoadGlobalVariables()
        {
            IsUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalServicePath", " var aspxservicePath='" + ResolveUrl("~/") + "Modules/AspxCommerce/AspxCommerceServices/" + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalRootPath", " var aspxRootPath='" + ResolveUrl("~/") + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalTemplateFolderPath", " var aspxTemplateFolderPath='" + ResolveUrl("~/") + "Templates/" + TemplateName + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "storeID", " var storeID='" + GetStoreID + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "portalID", " var portalID='" + GetPortalID + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "culturename", " var cultureName='" + GetCurrentCultureName + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "templatename", " var templateName='" + TemplateName + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "customerid", " var customerID='" + GetCustomerID + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "username", " var userName='******';", true);
            //  ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "noimagepath", " var aspxTemplateFolderPath='" + ResolveUrl("~/") + "Templates/" + TemplateName + "';", true);
            //  ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "defaultlogourl", " var aspxTemplateFolderPath='" + ResolveUrl("~/") + "Templates/" + TemplateName + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "isfriendlyurl", " var IsUseFriendlyUrls='" + IsUseFriendlyUrls + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "sessioncode", " var sessionCode='" + HttpContext.Current.Session.SessionID.ToString() + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientIPAddress", " var clientIPAddress='" + HttpContext.Current.Request.UserHostAddress + "';", true);
            string userIP      = HttpContext.Current.Request.UserHostAddress;
            string countryName = "";
            IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();

            ipToCountry.GetCountry(userIP, out countryName);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientCountry", " var aspxCountryName='" + countryName + "';", true);
            StoreSettingConfig ssc          = new StoreSettingConfig();
            string             currencyCode = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetStoreID, GetPortalID, GetCurrentCultureName);

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "region", " var region='" + StoreSetting.GetRegionFromCurrencyCode(currencyCode, GetStoreID, GetPortalID) + "';", true);
            if (IsUseFriendlyUrls)
            {
                if (GetPortalID > 1)
                {
                    sageRedirectPath = ResolveUrl("~/portal/" + GetPortalSEOName + "/");
                    sageNavigateUrl  = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + ".aspx");
                }
                else
                {
                    sageRedirectPath = ResolveUrl("~/");
                    sageNavigateUrl  = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + ".aspx");
                }
            }
            else
            {
                sageRedirectPath = ResolveUrl("{~/Default.aspx?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=");
                sageNavigateUrl  = ResolveUrl("~/Default.aspx?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
            }
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalRedirectPath", " var aspxRedirectPath='" + sageRedirectPath + "';", true);
        }
    public void LoadGlobalVariables()
    {
        Page.ClientScript.RegisterClientScriptInclude("AspxCommereCore", ResolveUrl("~/js/SageFrameCorejs/aspxcommercecormin.js"));
        IncludeJs("Session", "/js/Session.js");
        IncludeJs("Encoder", "/js/encoder.js");
        bool isIE = HttpContext.Current.Request.Browser.Type.ToUpper().Contains("IE");

        if (isIE)
        {
            IncludeJs("Base64", "/js/Base64/base64.js");
        }
        IsUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
        PageExtension     = SageFrameSettingKeys.PageExtension;
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalServicePath", " var aspxservicePath='" + ResolveUrl("~/") + "Modules/AspxCommerce/AspxCommerceServices/" + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalRootPath", " var aspxRootPath='" + ResolveUrl("~/") + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalTemplateFolderPath", " var aspxTemplateFolderPath='" + ResolveUrl("~/") + "Templates/" + TemplateName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "pageExtension", " var pageExtension='" + PageExtension + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "storeID", " var storeID='" + GetStoreID + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "portalID", " var portalID='" + GetPortalID + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "culturename", " var cultureName='" + GetCurrentCultureName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "templatename", " var templateName='" + TemplateName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "customerid", " var customerID='" + GetCustomerID + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "username", " var userName='******';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "isfriendlyurl", " var IsUseFriendlyUrls='" + IsUseFriendlyUrls + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "sessioncode", " var sessionCode='" + HttpContext.Current.Session.SessionID.ToString() + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientIPAddress", " var clientIPAddress='" + HttpContext.Current.Request.UserHostAddress + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "LoginURL", " var LoginURL='" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage) + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "itemImagePath", " var itemImagePath='Modules/AspxCommerce/AspxItemsManagement/uploads/';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "categoryImagePath", " var categoryImagePath='Modules/AspxCommerce/AspxCategoryManagement/uploads/';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "section", " var section='" + 1 + "';", true);
        string userIP      = HttpContext.Current.Request.UserHostAddress;
        string countryName = "";
        IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();

        ipToCountry.GetCountry(userIP, out countryName);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientCountry", " var aspxCountryName='" + countryName + "';", true);
        StoreSettingConfig ssc          = new StoreSettingConfig();
        string             currencyCode = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetStoreID, GetPortalID, GetCurrentCultureName);

        if (currencyCode != null)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "region",
                                                    " var region='" +
                                                    StoreSetting.GetRegionFromCurrencyCode(currencyCode, GetStoreID,
                                                                                           GetPortalID) + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "curSymbol",
                                                    " var curSymbol='" +
                                                    StoreSetting.GetSymbolFromCurrencyCode(currencyCode, GetStoreID,
                                                                                           GetPortalID) + "';", true);
        }
        if (HttpContext.Current.Session["CurrencyRate"] == null)
        {
            HttpContext.Current.Session["CurrencyRate"] = 1;
        }
        if (HttpContext.Current.Session["CurrencyCode"] == null)
        {
            HttpContext.Current.Session["CurrencyCode"] = currencyCode;
        }
        if (IsUseFriendlyUrls)
        {
            if (!IsParent)
            {
                sageRedirectPath = ResolveUrl(GetParentURL + "/portal/" + GetPortalSEOName + "/");
                sageNavigateUrl  = ResolveUrl(GetParentURL + "/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
            }
            else
            {
                sageRedirectPath = ResolveUrl("~/");
                sageNavigateUrl  = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
            }
        }
        else
        {
            sageRedirectPath = ResolveUrl("{~/Default" + PageExtension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=");
            sageNavigateUrl  = ResolveUrl("~/Default" + PageExtension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
        }
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalRedirectPath", " var aspxRedirectPath='" + sageRedirectPath + "';", true);
    }