Esempio n. 1
0
    private void LoadCountry()
    {
        StringBuilder      blCountry     = new StringBuilder();
        StringBuilder      spCountry     = new StringBuilder();
        StringBuilder      optionCountry = new StringBuilder();
        List <CountryInfo> lstCountry    = AspxCommonController.BindCountryList();

        blCountry.Append("<select id=\"ddlBLCountry\">");
        spCountry.Append("<select id=\"ddlSPCountry\">");
        foreach (var countryInfo in lstCountry)
        {
            optionCountry.Append("<option class=\"cssBillingShipping\" value=\"");
            optionCountry.Append(countryInfo.Value);
            optionCountry.Append("\"> ");
            optionCountry.Append(countryInfo.Text);
            optionCountry.Append("</option>");
        }
        blCountry.Append(optionCountry);
        spCountry.Append(optionCountry);
        blCountry.Append("</select>");
        spCountry.Append("</select>");

        ltSPCountry.Text = spCountry.ToString();
        ltBLCountry.Text = blCountry.ToString();
    }
        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);
            }
        }
    public void GetAllCountry()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = GetStoreID;
        aspxCommonObj.PortalID    = GetPortalID;
        aspxCommonObj.UserName    = GetUsername;
        aspxCommonObj.CultureName = GetCurrentCultureName;
        string             pageExtension = SageFrameSettingKeys.PageExtension;
        List <CountryInfo> lstCountry    = AspxCommonController.BindCountryList();

        if (lstCountry != null && lstCountry.Count > 0)
        {
            StringBuilder countryElements = new StringBuilder();
            countryElements.Append("<select id=\"ddlCountry\" class=\"sfListmenu\">");
            foreach (CountryInfo value in lstCountry)
            {
                countryElements.Append("<option value=");
                countryElements.Append(value.Value);
                countryElements.Append(">");
                countryElements.Append(value.Text);
                countryElements.Append("</option>");
            }
            countryElements.Append("</select>");
            ltrCountry.Text = countryElements.ToString();
        }
    }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    StoreID, PortalID;
        int    CustomerID;
        string UserName, CultureName, SessionCode;

        SetCustomerID();
        GetPortalCommonInfo(out StoreID, out PortalID, out CustomerID, out UserName,
                            out CultureName, out SessionCode);
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo(StoreID, PortalID, UserName,
                                                          CultureName, CustomerID, SessionCode);

        StoreSettingConfig ssc = new StoreSettingConfig();
        string             timeToDeleteCartItems, timeToAbandonCart;

        ssc.GetStoreSettingParamTwo(StoreSetting.TimeToDeleteAbandonedCart, StoreSetting.CartAbandonedTime,
                                    out timeToDeleteCartItems, out timeToAbandonCart,
                                    StoreID, PortalID, CultureName);

        ctl.DeleteAbandonedCartItems(StoreID, PortalID, decimal.Parse(timeToDeleteCartItems),
                                     decimal.Parse(timeToAbandonCart));

        StoreAccessDetailsInfo storeAccessTracker = new StoreAccessDetailsInfo();

        storeAccessTracker.PortalID = PortalID;
        storeAccessTracker.StoreID  = StoreID;
        storeAccessTracker.Username = UserName;

        StartUpInfoCollection objStartInfo        = new StartUpInfoCollection();
        AspxCommonController  objCommonCont       = new AspxCommonController();

        objStartInfo = objCommonCont.GetStartUpInformation("AspxKPI", "AspxABTesting", storeAccessTracker);

        CheckStoreAccessible(aspxCommonObj, objStartInfo.IsStoreAccess, objStartInfo.IsStoreClosed);
        CreateGlobalVariables(aspxCommonObj, objStartInfo.IsKPIInstalled, objStartInfo.IsABTestInstalled);
        IncludeCoreLanguageJS();
        IncludeTemplateLanguageJS();
        IncludeRssFeedLanguageJS();
        if (HttpContext.Current.Session["IsLoginClick" + UserName] != null)
        {
            if (bool.Parse(HttpContext.Current.Session["IsLoginClick" + UserName].ToString()))
            {
                objCommonCont.UpdateCartAnonymoususertoRegistered(StoreID, PortalID, CustomerID, SessionCode);
                HttpContext.Current.Session["IsLoginClick" + UserName] = false;
            }
        }

        List <CurrrencyRateInfo> ratelist        = GetCountryCodeRates(aspxCommonObj);
        JavaScriptSerializer     json_serializer = new JavaScriptSerializer();
        string jsonRates = json_serializer.Serialize(ratelist);

        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ratelist", " var currencyRate='" + jsonRates + "';", true);
    }
    private void BindCountryList()
    {
        StringBuilder      blCountry    = new StringBuilder();
        StringBuilder      spCountry    = new StringBuilder();
        StringBuilder      lstBLCountry = new StringBuilder();
        StringBuilder      lstSPCountry = new StringBuilder();
        List <CountryInfo> lstCountry   = AspxCommonController.BindCountryList();
        Array bArray = BillingCountry.Split(',');
        Array sArray = ShippingDetail.Split(',');

        blCountry.Append("<div id=\"ddlBLCountry\"><h2>List Of Billing Available Country</h2><ul>");
        spCountry.Append("<div id=\"ddlSPCountry\"><h2>List Of Shipping Available Country</h2></ul>");
        foreach (var countryInfo in lstCountry)
        {
            if (BillingCountry.ToLower() == "all")
            {
                lstBLCountry.Append("<li class=\"cssCountryList\"> " +
                                    countryInfo.Text + "</li>");
            }
            else
            {
                if (Array.IndexOf(bArray, countryInfo.Value) >= 0)
                {
                    lstBLCountry.Append("<li class=\"cssCountryList\"> " +
                                        countryInfo.Text + "</li>");
                }
            }
        }
        foreach (var countryInfo in lstCountry)
        {
            if (ShippingDetail.ToLower() == "all")
            {
                lstSPCountry.Append("<li class=\"cssCountryList\"> " +
                                    countryInfo.Text + "</li>");
            }
            else
            {
                if (Array.IndexOf(sArray, countryInfo.Value) >= 0)
                {
                    lstSPCountry.Append("<li class=\"cssCountryList\"> " +
                                        countryInfo.Text + "</li>");
                }
            }
        }
        blCountry.Append(lstBLCountry);
        spCountry.Append(lstSPCountry);
        blCountry.Append("</ul></div>");
        spCountry.Append("</ul></div>");
        ltrShippingDetails.Text = blCountry.ToString() + spCountry.ToString();
    }
    public int GetCartItemCount()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        aspxCommonObj.CustomerID  = CustomerID;
        aspxCommonObj.SessionCode = SessionCode;
        int cartItemCount = AspxCommonController.GetCartItemsCount(aspxCommonObj);

        return(cartItemCount);
    }
Esempio n. 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            IncludeCss("ItemDetails",
                       "/Templates/" + TemplateName + "/css/PopUp/style.css",
                       "/Templates/" + TemplateName + "/css/StarRating/jquery.rating.css",
                       "/Templates/" + TemplateName + "/css/JQueryUIFront/jquery-ui.all.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",
                       "/Modules/AspxCommerce/AspxItemDetails/css/module.css"
                       );

            IncludeJs("ItemDetails",
                      "/js/jDownload/jquery.jdownload.js", "/js/MessageBox/alertbox.js", "/js/DateTime/date.js",
                      "/js/PopUp/custom.js", "/js/FormValidation/jquery.validate.js",
                      "/js/StarRating/jquery.rating.js",
                      "/Modules/AspxCommerce/AspxItemDetails/js/ItemDetails.js",
                      "/Modules/AspxCommerce/AspxItemDetails/js/jquery.currencydropdown.js",
                      "/js/PopUp/popbox.js",
                      "/js/FancyDropDown/itemFancyDropdown.js", "/js/jquery.tipsy.js",
                      "/js/jquery.labelify.js");
        }
        aspxCommonObj.UserName    = GetUsername;
        aspxCommonObj.PortalID    = GetPortalID;
        aspxCommonObj.StoreID     = GetStoreID;
        aspxCommonObj.CustomerID  = GetCustomerID;
        aspxCommonObj.CultureName = GetCurrentCultureName;
        aspxCommonObj.SessionCode = sessionCode;
        IncludeLanguageJS();
        ItemCommonInfo objItemInfo = AspxCommonController.GetItemInfoFromSKU(itemSKU, aspxCommonObj);

        if (objItemInfo != null)
        {
            itemTypeId = objItemInfo.ItemTypeID;
        }
        BindItemQuantityDiscountByUserName(itemSKU);
        BindItemAverageRating();
        if (itemTypeId != 5)
        {
            GetPriceHistory();
        }
        BindRatingCriteria();
        AddUpdateRecentlyViewedItem();
        CheckReviewByUser();
        CheckReviewByIP();
    }
    public void GetAllCountry()
    {
        string             pageExtension = SageFrameSettingKeys.PageExtension;
        List <CountryInfo> lstCountry    = AspxCommonController.BindCountryList();

        if (lstCountry != null && lstCountry.Count > 0)
        {
            StringBuilder countryElements = new StringBuilder();
            countryElements.Append("<select id=\"ddlCountry\" class=\"sfListmenu\">");
            foreach (CountryInfo value in lstCountry)
            {
                countryElements.Append("<option value=");
                countryElements.Append(value.Value);
                countryElements.Append(">");
                countryElements.Append(value.Text);
                countryElements.Append("</option>");
            }
            countryElements.Append("</select>");
            ltrCountry.Text = countryElements.ToString();
        }
    }
Esempio n. 9
0
    public void GetAllCountry()
    {
        List <CountryInfo> lstCountry = AspxCommonController.BindCountryList();

        if (lstCountry != null && lstCountry.Count > 0)
        {
            StringBuilder countryElements = new StringBuilder();
            countryElements.Append("<select id=\"ddlCountry\" class=\"sfListmenu\">");
            countryElements.Append("<option value=\"0\">" + "- Select one -" + "</option>");
            foreach (CountryInfo value in lstCountry)
            {
                countryElements.Append("<option name=\"Test\" value=");
                countryElements.Append(value.Value);
                countryElements.Append(">");
                countryElements.Append(value.Text);
                countryElements.Append("</option>");
            }
            countryElements.Append("</select>");
            ltrCountry.Text = countryElements.ToString();
        }
    }
Esempio n. 10
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. 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SageFrameConfig pagebase = new SageFrameConfig();
            IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
            SecurityPolicy            objSecurity = new SecurityPolicy();
            FormsAuthenticationTicket ticket      = objSecurity.GetUserTicket(GetPortalID);
            if (ticket != null && ticket.Name != ApplicationKeys.anonymousUser)
            {
                if (!IsPostBack)
                {
                    Page.ClientScript.RegisterClientScriptInclude("Paging", ResolveUrl("~/js/Paging/jquery.pagination.js"));
                    IncludeCss("UserDashBoard", "/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("UserDashBoard", "/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/StarRating/jquery.rating.js", "/js/PopUp/custom.js", "/js/jquery.tipsy.js");


                    storeID        = GetStoreID;
                    portalID       = GetPortalID;
                    customerID     = GetCustomerID;
                    userName       = GetUsername;
                    cultureName    = GetCurrentCultureName;
                    userModuleIDUD = int.Parse(SageUserModuleID);
                    ModulePath     = ResolveUrl(this.AppRelativeTemplateSourceDirectory);
                    StoreSettingConfig ssc           = new StoreSettingConfig();
                    UserInfo           sageUser      = m.GetUserDetails(GetPortalID, GetUsername);
                    AspxCommonInfo     aspxCommonObj = new AspxCommonInfo();
                    aspxCommonObj.PortalID = portalID;
                    aspxCommonObj.UserName = userName;
                    AspxCommonController objUser     = new AspxCommonController();
                    UsersInfo            userDetails = objUser.GetUserDetails(aspxCommonObj);
                    if (HttpContext.Current.Session.SessionID != null)
                    {
                        sessionCode = HttpContext.Current.Session.SessionID.ToString();
                    }
                    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);
                    }



                    allowMultipleAddress = ssc.GetStoreSettingsByKey(StoreSetting.AllowUsersToCreateMultipleAddress, storeID, portalID, cultureName);
                    CurrencyCodeSlected  = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, storeID, portalID, cultureName);
                    BindUserDetails();
                }
                IncludeLanguageJS();
            }
            else
            {
                if (IsUseFriendlyUrls)
                {
                    if (!IsParent)
                    {
                        Response.Redirect(ResolveUrl(GetParentURL + "/portal/" + GetPortalSEOName + "/" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage)) + ".aspx?ReturnUrl=" + Request.Url.ToString(), false);
                    }
                    else
                    {
                        Response.Redirect(ResolveUrl("~/" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage)) + ".aspx?ReturnUrl=" + Request.Url.ToString(), false);
                    }
                }

                else
                {
                    Response.Redirect(ResolveUrl("~/Default.aspx?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage)) + "?ReturnUrl=" + Request.Url.ToString(), false);
                }
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Esempio n. 12
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);
        }
    }
Esempio n. 13
0
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        MembershipController member = new MembershipController();
        RoleController       role   = new RoleController();
        UserInfo             user   = member.GetUserDetails(GetPortalID, UserName.Text);

        if (user.UserExists && user.IsApproved)
        {
            if (!(string.IsNullOrEmpty(UserName.Text) && string.IsNullOrEmpty(PasswordAspx.Text)))
            {
                if (PasswordHelper.ValidateUser(user.PasswordFormat, PasswordAspx.Text, user.Password, user.PasswordSalt))
                {
                    string userRoles = role.GetRoleNames(user.UserName, GetPortalID);
                    strRoles += userRoles;
                    if (strRoles.Length > 0)
                    {
                        SetUserRoles(strRoles);
                        //SessionTracker sessionTracker = (SessionTracker)Session[SessionKeys.Tracker];
                        //SessionTracker sessionTracker = (SessionTracker)Session[SessionKeys.Tracker];
                        //sessionTracker.PortalID = GetPortalID.ToString();
                        //sessionTracker.Username = UserName.Text;
                        //Session[SessionKeys.Tracker] = sessionTracker;
                        SageFrame.Web.SessionLog SLog = new SageFrame.Web.SessionLog();
                        SLog.SessionTrackerUpdateUsername(UserName.Text, GetPortalID.ToString());

                        StringBuilder             redirectURL = new StringBuilder();
                        SecurityPolicy            objSecurity = new SecurityPolicy();
                        FormsAuthenticationTicket ticket      = new FormsAuthenticationTicket(1,
                                                                                              user.UserName,
                                                                                              DateTime.Now,
                                                                                              DateTime.Now.AddMinutes(30),
                                                                                              true,
                                                                                              GetPortalID.ToString(),
                                                                                              FormsAuthentication.FormsCookiePath);

                        string encTicket = FormsAuthentication.Encrypt(ticket);

                        string randomCookieValue = GenerateRandomCookieValue();
                        Session[SessionKeys.RandomCookieValue] = randomCookieValue;
                        HttpCookie      cookie    = new HttpCookie(objSecurity.FormsCookieName(GetPortalID), encTicket);
                        SageFrameConfig objConfig = new SageFrameConfig();
                        string          ServerCookieExpiration = objConfig.GetSettingValueByIndividualKey(SageFrameSettingKeys.ServerCookieExpiration);
                        int             expiryTime             = Math.Abs(int.Parse(ServerCookieExpiration));
                        expiryTime     = expiryTime < 5 ? 5 : expiryTime;
                        cookie.Expires = DateTime.Now.AddMinutes(expiryTime);
                        Response.Cookies.Add(cookie);
                        ServiceSecurity.IssueToken(GetPortalID);
                        if (Request.QueryString["ReturnUrl"] != null)
                        {
                            string PageNotFoundPage      = PortalAPI.PageNotFoundURLWithRoot;
                            string UserRegistrationPage  = PortalAPI.RegistrationURLWithRoot;
                            string PasswordRecoveryPage  = PortalAPI.PasswordRecoveryURLWithRoot;
                            string ForgotPasswordPage    = PortalAPI.ForgotPasswordURL;
                            string PageNotAccessiblePage = PortalAPI.PageNotAccessibleURLWithRoot;

                            string ReturnUrlPage = Request.QueryString["ReturnUrl"].Replace("%2f", "-").ToString();

                            if (ReturnUrlPage == PageNotFoundPage || ReturnUrlPage == UserRegistrationPage || ReturnUrlPage == PasswordRecoveryPage || ReturnUrlPage == ForgotPasswordPage || ReturnUrlPage == PageNotAccessiblePage)
                            {
                                redirectURL.Append(GetParentURL);
                                redirectURL.Append(PortalAPI.DefaultPageWithExtension);
                            }
                            else
                            {
                                redirectURL.Append(ResolveUrl(Request.QueryString["ReturnUrl"].ToString()));
                            }
                        }
                        else
                        {
                            if (!IsParent)
                            {
                                redirectURL.Append(GetParentURL);
                                redirectURL.Append("/portal/");
                                redirectURL.Append(GetPortalSEOName);
                                redirectURL.Append("/");
                                redirectURL.Append(ssc.GetStoreSettingsByKey(StoreSetting.SingleCheckOutURL, GetStoreID, GetPortalID, GetCurrentCultureName));
                                redirectURL.Append(SageFrameSettingKeys.PageExtension);
                            }
                            else
                            {
                                redirectURL.Append(GetParentURL);
                                redirectURL.Append("/");
                                redirectURL.Append(ssc.GetStoreSettingsByKey(StoreSetting.SingleCheckOutURL, GetStoreID, GetPortalID, GetCurrentCultureName));
                                redirectURL.Append(SageFrameSettingKeys.PageExtension);
                            }
                        }

                        int customerID = GetCustomerID;
                        if (customerID == 0)
                        {
                            CustomerGeneralInfo sageUserCust = CustomerGeneralInfoController.CustomerIDGetByUsername(user.UserName, storeID, portalID);
                            if (sageUserCust != null)
                            {
                                customerID = sageUserCust.CustomerID;
                            }
                        }
                        AspxCommonController objCommonCont = new AspxCommonController();
                        objCommonCont.UpdateCartAnonymoususertoRegistered(storeID, portalID, customerID, sessionCode);
                        Response.Redirect(redirectURL.ToString(), false);
                    }
                    else
                    {
                        FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("UserLogin", "Youarenotauthenticatedtothisportal"));
                    }
                }
                else
                {
                    FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("UserLogin", "UsernameandPasswordcombinationdoesntmatched"));//"Username and Password combination doesn't matched!";
                }
            }
        }
        else
        {
            FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("UserLogin", "UserDoesnotExist"));
        }
    }