Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            IncludeLanguageJS();

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

            List <CouponSession> cs = new List <CouponSession>();
            cs     = CheckOutSessions.Get <List <CouponSession> >("CouponSession");
            Coupon = json_serializer.Serialize(cs);

            List <GiftCardUsage> gc = CheckOutSessions.Get <List <GiftCardUsage> >("UsedGiftCard");
            GiftCard = json_serializer.Serialize(gc);

            Discount = CheckOutSessions.Get <Decimal>("DiscountAmount", 0);

            string templateName = TemplateName;
            IncludeCss("CheckOutInformationContent", "/Templates/" + templateName + "/css/MessageBox/style.css", "/Templates/" + templateName + "/css/JQueryUIFront/jquery.ui.all.css",
                       "/Templates/" + templateName + "/css/ToolTip/tooltip.css", "/Modules/AspxCommerce/AspxCheckoutWithSingleAddress/css/module.css");
            IncludeJs("CheckOutInformationContent", "/js/encoder.js", "/js/FormValidation/jquery.validate.js", "/js/jquery.cookie.js", "/js/MessageBox/jquery.easing.1.3.js", "/js/MessageBox/alertbox.js", "/js/jquery.tipsy.js", "/Modules/AspxCommerce/AspxCheckoutWithSingleAddress/js/SingleCheckOut.js");

            ssc.GetStoreSettingParamEleven(StoreSetting.DefaultProductImageURL, StoreSetting.ShoppingCartURL, StoreSetting.MyAccountURL,
                                           StoreSetting.AllowedShippingCountry, StoreSetting.AllowedBillingCountry, StoreSetting.SingleCheckOutURL,
                                           StoreSetting.DimensionUnit, StoreSetting.WeightUnit, StoreSetting.AskCustomerToSubscribe, StoreSetting.ShipDetailPageURL,
                                           StoreSetting.AllowUsersToCreateMultipleAddress, out noImageCheckOutInfoPath, out ShoppingCartURL, out myAccountURL,
                                           out AllowededShippingCountry, out AllowededBillingCountry, out SingleAddressCheckOutURL, out DimentionalUnit,
                                           out WeightUnit, out ShowSubscription, out ShippingDetailPage, out allowMultipleAddress, storeID, portalID, cultureName);

            if (!IsPostBack)
            {
                HideSignUp();
                PasswordAspx.Attributes.Add("onkeypress", "return clickButton(event,'" + LoginButton.ClientID + "')");

                if (!IsParent)
                {
                    hypForgotPassword.NavigateUrl =
                        ResolveUrl(GetParentURL + "/portal/" + GetPortalSEOName + "/sf/" +
                                   pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalForgotPassword) + SageFrameSettingKeys.PageExtension);
                }
                else
                {
                    hypForgotPassword.NavigateUrl =
                        ResolveUrl("~/sf/" + pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalForgotPassword) +
                                   SageFrameSettingKeys.PageExtension);
                }
                string registerUrl =
                    ResolveUrl("~/sf/" + pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalUserRegistration) +
                               SageFrameSettingKeys.PageExtension);
                signup.Attributes.Add("href", ResolveUrl("~/sf/sfUser-Registration" + SageFrameSettingKeys.PageExtension));
                signup1.Attributes.Add("href", ResolveUrl("~/sf/sfUser-Registration" + SageFrameSettingKeys.PageExtension));

                if (Boolean.Parse(pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.RememberCheckbox)))
                {
                    RememberMe.Visible = true;
                    lblrmnt.Visible    = true;
                }
                else
                {
                    RememberMe.Visible = false;
                    lblrmnt.Visible    = false;
                }

                object serverVars = new
                {
                    noImageCheckOutInfoPath  = noImageCheckOutInfoPath,
                    ShoppingCartURL          = ShoppingCartURL,
                    myAccountURL             = myAccountURL,
                    singleAddressCheckOutURL = SingleAddressCheckOutURL,
                    CartUrl = ShoppingCartURL,
                    AllowedShippingCountry = AllowededShippingCountry,
                    AllowedBillingCountry  = AllowededBillingCountry,
                    dimentionalUnit        = DimentionalUnit,
                    weightunit             = WeightUnit,
                    showSubscription       = ShowSubscription,
                    allowMultipleAddress   = allowMultipleAddress,
                    shippingDetailPage     = ShippingDetailPage,
                    Discount = Discount
                };

                ServerVars = json_serializer.Serialize(serverVars);
                LoadCartDetails(aspxCommonObj);
                LoadCountry();
                LoadAddress(aspxCommonObj);
                LoadPaymentGateway(aspxCommonObj);
                LoadRewardPoints(aspxCommonObj);
            }


            if (HttpContext.Current.User != null)
            {
                SecurityPolicy            objSecurity = new SecurityPolicy();
                FormsAuthenticationTicket ticket      = objSecurity.GetUserTicket(GetPortalID);
                if (ticket != null && ticket.Name != ApplicationKeys.anonymousUser)
                {
                    int                  LoggedInPortalID = int.Parse(ticket.UserData.ToString());
                    string[]             sysRoles         = SystemSetting.SUPER_ROLE;
                    MembershipController member           = new MembershipController();
                    UserInfo             userDetail       = member.GetUserDetails(GetPortalID, GetUsername);
                    if (GetPortalID == LoggedInPortalID || Roles.IsUserInRole(userDetail.UserName, sysRoles[0]))
                    {
                        RoleController _role       = new RoleController();
                        string         userinroles = _role.GetRoleNames(GetUsername, LoggedInPortalID);
                        if (userinroles != "" || userinroles != null)
                        {
                            MultiView1.ActiveViewIndex = 1;
                        }
                        else
                        {
                            MultiView1.ActiveViewIndex = 0;
                        }
                    }
                    else
                    {
                        MultiView1.ActiveViewIndex = 0;
                    }
                }
                else
                {
                    MultiView1.ActiveViewIndex = 0;
                }
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }