private void IsModuleInstalled(int rewardRuleID)
        {
            try
            {
                string         moduleFriendlyName = "AspxRewardPoints";
                AspxCommonInfo aspxCommonObj      = new AspxCommonInfo();
                aspxCommonObj.StoreID     = GetStoreID;
                aspxCommonObj.PortalID    = GetPortalID;
                aspxCommonObj.CultureName = GetCurrentCultureName;
                bool isInstalled = AspxCommonController.GetModuleInstallationInfo(moduleFriendlyName, aspxCommonObj);
                if (isInstalled == true)
                {
                    //rewardRuleID = 1; ///Signing Up
                    //rewardRuleID = 2; ///NewsLetter
                    string uName = string.Empty;
                    string email = string.Empty;
                    if (Email.Text != string.Empty || Email.Text != null)
                    {
                        email = Email.Text;
                    }
                    uName = UserName.Text;

                    AspxRewardPointsController.RewardPointsSaveByCore(rewardRuleID, uName, email, aspxCommonObj);
                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }
Esempio n. 2
0
    private void CreateGlobalVariables()
    {
        Page.ClientScript.RegisterClientScriptInclude("AspxCommereCore", ResolveUrl("~/js/SageFrameCorejs/aspxcommercecore.js"));
        Page.ClientScript.RegisterClientScriptInclude("AspxCommereTemplateJs", ResolveUrl("~/js/Templating/tmpl.js"));
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.PortalID = GetPortalID;
        bool isModuleInstalled = AspxCommonController.GetModuleInstallationInfo("AspxABTesting", aspxCommonObj);

        if (isModuleInstalled)
        {
            IncludeJs("AspxABTesting", "/Modules/AspxCommerce/AspxABTesting/js/ABTest.js");
            IncludeJs("AspxABTesting", "/Modules/AspxCommerce/AspxABTesting/Language/AspxABTesting.js");
        }

        bool isKPIMoudleInstalled = AspxCommonController.GetModuleInstallationInfo("AspxKPI", aspxCommonObj);

        if (isKPIMoudleInstalled)
        {
            IncludeJs("AspxKPI", "/Modules/AspxCommerce/AspxKPI/js/KPICommon.js");
            IncludeJs("AspxKPI", "/Modules/AspxCommerce/AspxKPI/Language/AspxKPILanguage.js");
        }
        IncludeJs("Session", "/js/Session.js");
        IncludeJs("CurrencyConvert", "/js/CurrencyFormat/jquery.currencies.js");
        IncludeJs("Masonry", "/js/jquery.masonry.js");
        IncludeCss("ui", "/js/jquery-ui-1.8.14.custom/css/redmond/jquery-ui-1.8.16.custom.css");
        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(), "templateName", " var templateName='" + 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             myCartURL    = ssc.GetStoreSettingsByKey(StoreSetting.ShoppingCartURL, GetStoreID, GetPortalID, GetCurrentCultureName);
        string             currencyCode = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetStoreID, GetPortalID, GetCurrentCultureName);

        SendEcommerceEmailsFrom = ssc.GetStoreSettingsByKey(StoreSetting.SendEcommerceEmailsFrom, GetStoreID, GetPortalID, GetCurrentCultureName);
        string sortByOptions        = ssc.GetStoreSettingsByKey(StoreSetting.SortByOptions, GetStoreID, GetPortalID, GetCurrentCultureName);
        string sortByOptionsDefault = ssc.GetStoreSettingsByKey(StoreSetting.SortByOptionsDefault, GetStoreID, GetPortalID, GetCurrentCultureName);
        string viewAsOptions        = ssc.GetStoreSettingsByKey(StoreSetting.ViewAsOptions, GetStoreID, GetPortalID, GetCurrentCultureName);
        string viewAsOptionsDefault = ssc.GetStoreSettingsByKey(StoreSetting.ViewAsOptionsDefault, GetStoreID, GetPortalID, GetCurrentCultureName);

        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "sortByOptions", " var sortByOptions='" + sortByOptions + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "sortByOptionsDefault", " var sortByOptionsDefault='" + sortByOptionsDefault + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "viewAsOptions", " var viewAsOptions='" + viewAsOptions + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "viewAsOptionsDefault", " var viewAsOptionsDefault='" + viewAsOptionsDefault + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "BaseCurrency", " var BaseCurrency='" + currencyCode + "';", true);
        Session["SendEcommerceEmailsFrom"] = SendEcommerceEmailsFrom;
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myCartURL", " var myCartURL='" + myCartURL + "';", true);
        string userFullName = ctl.GetFullName(GetPortalID, GetUsername);

        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "userFullName", " var userFullName='" + userFullName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "homeURL", " var homeURL='" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + "';", 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='" + 0 + "';", true);
        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=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
            sageNavigateUrl  = ResolveUrl("~/Default" + PageExtension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
        }
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalRedirectPath", " var aspxRedirectPath='" + sageRedirectPath + "';", true);
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SageFrameConfig           pagebase        = new SageFrameConfig();
            string                    PortalLoginpage = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage);//Ask santosh to get portal login page
            SecurityPolicy            objSecurity     = new SecurityPolicy();
            FormsAuthenticationTicket ticket          = objSecurity.GetUserTicket(GetPortalID);

            AspxCommonInfo aspxCommonObj = new AspxCommonInfo();
            base.GetPortalCommonInfo(out storeID, out portalID, out customerID, out userName, out cultureName, out sessionCode);
            aspxCommonObj = new AspxCommonInfo(storeID, portalID, userName, cultureName, customerID, sessionCode);

            RewardPointsGeneralSettingsIsActive = RewardPointsController.RewardPointsGeneralSettingsIsActive(aspxCommonObj).ToString();

            StoreSettingConfig ssc = new StoreSettingConfig();
            ssc.GetStoreSettingParamThree(StoreSetting.AllowUsersToCreateMultipleAddress,
                                          StoreSetting.MainCurrency,
                                          StoreSetting.ShowAddToCartButton,
                                          out allowMultipleAddress,
                                          out CurrencyCodeSlected,
                                          out AllowAddToCart,
                                          storeID,
                                          portalID,
                                          cultureName
                                          );

            IsRewardInstl = AspxCommonController.GetModuleInstallationInfo("AspxRewardPoints", aspxCommonObj).ToString();

            if (ticket != null && ticket.Name != ApplicationKeys.anonymousUser)
            {
                if (!IsPostBack)
                {
                    string templateName = TemplateName;

                    IncludeCss("UserDashBoardCSS", "/Templates/" + templateName + "/css/GridView/tablesort.css", "/Templates/" + templateName + "/css/StarRating/jquery.rating.css", "/Templates/" + templateName + "/css/MessageBox/style.css",
                               "/Templates/" + templateName + "/css/PopUp/style.css", "/Templates/" + templateName + "/css/JQueryUIFront/jquery.ui.all.css", "/Templates/" + templateName + "/css/PasswordValidation/jquery.validate.password.css", "/Templates/" + templateName + "/css/ToolTip/tooltip.css");
                    IncludeJs("UserDashBoardJS", "/Modules/AspxCommerce/AspxWishList/js/WishItemList.js", "/js/jDownload/jquery.jdownload.js", "/js/DateTime/date.js", "/js/MessageBox/jquery.easing.1.3.js",
                              "/js/MessageBox/alertbox.js", "/js/StarRating/jquery.MetaData.js", "/js/FormValidation/jquery.validate.js", "/js/PasswordValidation/jquery.validate.password.js",
                              "/js/GridView/jquery.grid.js", "/js/GridView/SagePaging.js", "/js/GridView/jquery.global.js", "/js/GridView/jquery.dateFormat.js", "/js/GridView/jquery.tablesorter.min.js", "/js/StarRating/jquery.rating.pack.js", "/js/encoder.js",
                              "/js/StarRating/jquery.rating.js", "/js/PopUp/custom.js", "/js/jquery.tipsy.js", "/Modules/AspxCommerce/AspxUserDashBoard/js/userdashboard.js", "/js/Paging/jquery.pagination.js", "/js/FormValidation/jquery.form-validation-and-hints.js");

                    userModuleIDUD = int.Parse(SageUserModuleID);
                    ModulePath     = ResolveUrl(this.AppRelativeTemplateSourceDirectory);

                    MembershipController m        = new MembershipController();
                    UserInfo             sageUser = m.GetUserDetails(GetPortalID, GetUsername);

                    AspxCommonController objUser     = new AspxCommonController();
                    UsersInfo            userDetails = objUser.GetUserDetails(aspxCommonObj);

                    if (userDetails.UserName != null)
                    {
                        userEmail         = userDetails.Email;
                        userFirstName     = userDetails.FirstName;
                        userLastName      = userDetails.LastName;
                        userPicture       = userDetails.ProfilePicture;
                        userEmailWishList = userEmail;//userDetail.Email;//added later for wishlist
                        userIP            = HttpContext.Current.Request.UserHostAddress;
                        IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();
                        ipToCountry.GetCountry(userIP, out countryName);
                    }


                    BindUserDetails();
                }
                IncludeAllLanguageJS();
            }
            else
            {
                if (!IsParent)
                {
                    Response.Redirect(ResolveUrl(GetParentURL + "/portal/" + GetPortalSEOName + "/" + PortalLoginpage) + ".aspx?ReturnUrl=" + Request.Url.ToString(), false);
                }
                else
                {
                    Response.Redirect(ResolveUrl("~/" + PortalLoginpage) + ".aspx?ReturnUrl=" + Request.Url.ToString(), false);
                }
            }
            IncludeAllLanguageJS();

            GetUserRecentActivity(aspxCommonObj);
            GetAddressBookDetails(aspxCommonObj);
            GetAllCountry();

            GetMyOrders(aspxCommonObj);
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }