Ejemplo n.º 1
0
    private void LoadRewardPoints(AspxCommonInfo aspxCommonObj)
    {
        List <GeneralSettingInfo> lstGeneralSet = RewardPointsController.GetGeneralSetting(aspxCommonObj);

        StringBuilder scriptrewardPoint = new StringBuilder();

        if (lstGeneralSet.Count > 0)
        {
            RewardSettings = new JavaScriptSerializer().Serialize(lstGeneralSet.FirstOrDefault()).ToString();
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        servicePath = ResolveUrl(this.TemplateSourceDirectory);

        rewardpoint = CheckOutSessions.Get <double>("RewardPoints", 0);

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

        List <GeneralSettingInfo> lstGeneralSet = RewardPointsController.GetGeneralSetting(aspxCommonObj);

        StringBuilder scriptrewardPoint = new StringBuilder();

        if (lstGeneralSet.Count > 0)
        {
            GeneralSettings = new JavaScriptSerializer().Serialize(lstGeneralSet.FirstOrDefault()).ToString();
        }
    }
Ejemplo n.º 3
0
    private string LoadRewardPoints()
    {
        StoreSettingConfig ssc   = new StoreSettingConfig();
        bool isEnableRewardPoint = true;

        //ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, storeID, portalID, cultureName);


        if (isEnableRewardPoint)
        {
            List <GeneralSettingInfo> lstGeneralSet = RewardPointsController.GetGeneralSetting(aspxCommonObj);

            StringBuilder scriptrewardPoint = new StringBuilder();

            if (lstGeneralSet.Count > 0)
            {
                foreach (GeneralSettingInfo generalSettingInfo in lstGeneralSet)
                {
                    if (generalSettingInfo.IsActive)
                    {
                        decimal maxRewardPoints = generalSettingInfo.TotalRewardPoints;
                        //$(".divRange").append('<p><b style="color: #006699;margin-left:10px">' + "Range:" + '<span id="amount"></span></b></p>');
                        scriptrewardPoint.Append("  isRewardPointEnbled = true; $('#hdnRate').val(eval(" +
                                                 generalSettingInfo.RewardExchangeRate / generalSettingInfo.RewardPoints +
                                                 "));");
                        if (generalSettingInfo.AmountSpent != 0 && generalSettingInfo.AmountSpent != null)
                        {
                            scriptrewardPoint.Append(" $('#hdnRewardRate').val(eval(" +
                                                     generalSettingInfo.RewardPointsEarned / generalSettingInfo.AmountSpent +
                                                     "));");
                        }
                        else
                        {
                            scriptrewardPoint.Append(" $('#hdnRewardRate').val(eval(" + 0 + "));");
                        }
                        scriptrewardPoint.Append("   $('#hdnTotalRewardAmount').val(eval(" +
                                                 generalSettingInfo.TotalRewardAmount * rate + "));");
                        scriptrewardPoint.Append("  $('#hdnTotalRewardPoints').val(eval(" +
                                                 generalSettingInfo.TotalRewardPoints + "));");
                        scriptrewardPoint.Append("  $('#hdnMinRedeemBalance').val(eval(" +
                                                 generalSettingInfo.MinRedeemBalance + "));");
                        scriptrewardPoint.Append("  $('#hdnCapped').val(eval(" + generalSettingInfo.BalanceCapped +
                                                 "));");
                        scriptrewardPoint.Append("  $('#spanCapped').html(eval(" + generalSettingInfo.BalanceCapped +
                                                 "));");
                        scriptrewardPoint.Append("  $('#spanTotalRewardPoints').html('" +
                                                 generalSettingInfo.TotalRewardPoints + "');");
                        scriptrewardPoint.Append("  $('#spanTotalRewardAmount').html('" +
                                                 generalSettingInfo.TotalRewardAmount * rate + "');");
                        scriptrewardPoint.Append("   $('#spanRPExchangePoints').html('" +
                                                 generalSettingInfo.RewardPoints + "');");
                        scriptrewardPoint.Append("  $('#spanRPExchangeAmount').html('" +
                                                 generalSettingInfo.RewardExchangeRate * rate + "');");
                        scriptrewardPoint.Append("  $('#spanTotalRP').html('" + generalSettingInfo.TotalRewardPoints +
                                                 "');");
                        scriptrewardPoint.Append("  $('#spanTotalRA').html('" + generalSettingInfo.TotalRewardAmount * rate +
                                                 "');");
                        //AspxCart.SetSessionValue('earningRewardPoints', true);
                        scriptrewardPoint.Append("   $('.divRange').show();");
                        scriptrewardPoint.Append("  $('#dvUsePoints').show();");
                        scriptrewardPoint.Append("   $('#dvRewardPointsMain').show();");
                        scriptrewardPoint.Append("   $('#trDiscountReward').show();");
                        //AspxCart.RewardRuleIsActive();
                        bool IsPurchaseActive = RewardPointsController.IsPurchaseActive(aspxCommonObj);
                        scriptrewardPoint.Append("isPurchaseActive=" + IsPurchaseActive.ToString().ToLower() + ";");
                        if (IsPurchaseActive)
                        {
                            scriptrewardPoint.Append(" $('#dvRPCurrent').show();");
                        }
                        //to set slider value  $("#slider-range").slider("option", "values", [10, 200]);

                        scriptrewardPoint.Append(
                            "$('#slider-range').slider({range: true,min: 0,max:" + maxRewardPoints + ",values: [0, " +
                            maxRewardPoints +
                            "],slide: function(event, ui) {$('#amount').html('<span>' + ui.values[0] + '</span>' + ' - ' + '<span>' + ui.values[1] + '</span>');},change: function(event, ui) { $('#amount').html('<span>' + ui.values[0] + '</span>' + '-' + '<span>' + ui.values[1] + '</span>');}});");
                        scriptrewardPoint.Append(
                            "$('#amount').html('<span>' + $('#slider-range').slider('values', 0) + '</span>' +' - ' + '<span>' + $('#slider-range').slider('values', 1) + '</span>');");

                        scriptrewardPoint.Append(" $('.cssClassFormatCurrency').formatCurrency({ colorize: true, region: '' + region + '' });");

                        // string script = GetStringScript(.ToString());
                        return(scriptrewardPoint.ToString());
                    }
                }
            }
        }
        return("");
    }
Ejemplo n.º 4
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);
        }
    }
Ejemplo n.º 5
0
    private string LoadRewardPoints()
    {
        StoreSettingConfig ssc   = new StoreSettingConfig();
        bool isEnableRewardPoint = true;


        if (isEnableRewardPoint)
        {
            List <GeneralSettingInfo> lstGeneralSet = RewardPointsController.GetGeneralSetting(aspxCommonObj);

            StringBuilder scriptrewardPoint = new StringBuilder();

            if (lstGeneralSet.Count > 0)
            {
                foreach (GeneralSettingInfo generalSettingInfo in lstGeneralSet)
                {
                    if (generalSettingInfo.IsActive)
                    {
                        decimal maxRewardPoints = generalSettingInfo.TotalRewardPoints;
                        scriptrewardPoint.Append("  isRewardPointEnbled = true; $('#hdnRate').val(eval(" +
                                                 generalSettingInfo.RewardExchangeRate / generalSettingInfo.RewardPoints +
                                                 "));");
                        if (generalSettingInfo.AmountSpent != 0 && generalSettingInfo.AmountSpent != null)
                        {
                            scriptrewardPoint.Append(" $('#hdnRewardRate').val(eval(" +
                                                     generalSettingInfo.RewardPointsEarned / generalSettingInfo.AmountSpent +
                                                     "));");
                        }
                        else
                        {
                            scriptrewardPoint.Append(" $('#hdnRewardRate').val(eval(" + 0 + "));");
                        }
                        scriptrewardPoint.Append("   $('#hdnTotalRewardAmount').val(eval(" +
                                                 generalSettingInfo.TotalRewardAmount + "));");
                        scriptrewardPoint.Append("  $('#hdnTotalRewardPoints').val(eval(" +
                                                 generalSettingInfo.TotalRewardPoints + "));");
                        scriptrewardPoint.Append("  $('#hdnMinRedeemBalance').val(eval(" +
                                                 generalSettingInfo.MinRedeemBalance + "));");
                        scriptrewardPoint.Append("  $('#hdnCapped').val(eval(" + generalSettingInfo.BalanceCapped +
                                                 "));");
                        scriptrewardPoint.Append("  $('#spanCapped').html(eval(" + generalSettingInfo.BalanceCapped +
                                                 "));");
                        scriptrewardPoint.Append("  $('#spanTotalRewardPoints').html('" +
                                                 generalSettingInfo.TotalRewardPoints + "');");
                        scriptrewardPoint.Append("  $('#spanTotalRewardAmount').html('" +
                                                 generalSettingInfo.TotalRewardAmount + "');");
                        scriptrewardPoint.Append("   $('#spanRPExchangePoints').html('" +
                                                 generalSettingInfo.RewardPoints + "');");
                        scriptrewardPoint.Append("  $('#spanRPExchangeAmount').html('" +
                                                 generalSettingInfo.RewardExchangeRate + "');");
                        scriptrewardPoint.Append("  $('#spanTotalRP').html('" + generalSettingInfo.TotalRewardPoints +
                                                 "');");
                        scriptrewardPoint.Append("  $('#spanTotalRA').html('" + generalSettingInfo.TotalRewardAmount +
                                                 "');");
                        scriptrewardPoint.Append("   $('.divRange').show();");
                        scriptrewardPoint.Append("  $('#dvUsePoints').show();");
                        scriptrewardPoint.Append("   $('#dvRewardPointsMain').show();");
                        scriptrewardPoint.Append("   $('#trDiscountReward').show();");
                        bool IsPurchaseActive = RewardPointsController.IsPurchaseActive(aspxCommonObj);
                        scriptrewardPoint.Append("isPurchaseActive=" + IsPurchaseActive.ToString().ToLower() + ";");
                        if (IsPurchaseActive)
                        {
                            scriptrewardPoint.Append(" $('#dvRPCurrent').show();");
                        }

                        scriptrewardPoint.Append(
                            "$('#slider-range').slider({range: true,min: 0,max:" + maxRewardPoints + ",values: [0, " +
                            maxRewardPoints +
                            "],slide: function(event, ui) {$('#amount').html('<span>' + ui.values[0] + '</span>' + ' - ' + '<span>' + ui.values[1] + '</span>');},change: function(event, ui) { $('#amount').html('<span>' + ui.values[0] + '</span>' + '-' + '<span>' + ui.values[1] + '</span>');}});");
                        scriptrewardPoint.Append(
                            "$('#amount').html('<span>' + $('#slider-range').slider('values', 0) + '</span>' +' - ' + '<span>' + $('#slider-range').slider('values', 1) + '</span>');");


                        return(scriptrewardPoint.ToString());
                    }
                }
            }
        }
        return("");
    }
Ejemplo n.º 6
0
    private void LoadRewardPoints()
    {
        StoreSettingConfig ssc   = new StoreSettingConfig();
        bool isEnableRewardPoint = true;//ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, storeID, portalID, cultureName);

        if (isEnableRewardPoint)
        {
            List <GeneralSettingInfo> lstGeneralSet      = RewardPointsController.GetGeneralSetting(aspxCommonObj);
            StringBuilder             rewardPointBuilder = new StringBuilder();
            StringBuilder             scriptrewardPoint  = new StringBuilder();

            if (lstGeneralSet.Count > 0)
            {
                foreach (GeneralSettingInfo generalSettingInfo in lstGeneralSet)
                {
                    if (generalSettingInfo.IsActive)
                    {
                        if (generalSettingInfo.AmountSpent != 0 && generalSettingInfo.AmountSpent != null)
                        {
                            scriptrewardPoint.Append(" $(\"#hdnRewardRate\").val(eval(" +
                                                     generalSettingInfo.RewardPointsEarned / generalSettingInfo.AmountSpent +
                                                     "));");
                        }
                        else
                        {
                            scriptrewardPoint.Append(" $(\"#hdnRewardRate\").val(eval(" + 0 + "));");
                        }

                        scriptrewardPoint.Append("$(\"#hdnRate\").val(eval(" +
                                                 generalSettingInfo.RewardExchangeRate / generalSettingInfo.RewardPoints +
                                                 "));");

                        bool IsPurchaseActive = RewardPointsController.IsPurchaseActive(aspxCommonObj);
                        scriptrewardPoint.Append("CheckOut.UserCart.IsPurchaseActive=" +
                                                 IsPurchaseActive.ToString().ToLower() + ";");

                        RewardPointsController.RewardPointsSelectedValue("btnRewardPointsValue");



                        decimal rewardPointsSliderSelectedValue =
                            RewardPointsController.RewardPointsSelectedValue("btnRewardPointsValue");

                        if (rewardPointsSliderSelectedValue > 0)
                        {
                            scriptrewardPoint.Append("CheckOut.UserCart.RewardPointsDiscount = eval(" +
                                                     rewardPointsSliderSelectedValue +
                                                     "* parseFloat($(\"#hdnRate\").val()).toFixed(2));");
                            scriptrewardPoint.Append("CheckOut.UserCart.UsedRewardPoints =" +
                                                     rewardPointsSliderSelectedValue + ";");
                            scriptrewardPoint.Append(
                                " $(\"#txtRewardAmount\").val(CheckOut.UserCart.RewardPointsDiscount);");
                        }
                        else
                        {
                            scriptrewardPoint.Append(
                                "CheckOut.UserCart.RewardPointsDiscount = 0;CheckOut.UserCart.UsedRewardPoints = 0;");
                        }
                        scriptrewardPoint.Append(" $(\"#trDiscountReward\").show();");
                        ScriptsToRun += scriptrewardPoint.ToString();
                    }
                }
            }
        }
    }