public static string GetCheckoutPageUrl(PageData startPage, string stepName)
        {
            StartPageType home            = (StartPageType)startPage;
            var           checkoutPage    = home.Settings.CheckoutPage;
            string        checkoutPageUrl = RouteTable.Routes.GetVirtualPath(checkoutPage, ContentLanguage.PreferredCulture.Name).GetUrl();

            UrlBuilder bldr = new UrlBuilder(checkoutPageUrl);

            bldr.QueryCollection.Add("step", stepName);
            return(bldr.ToString());;
        }
        protected void btnPrevious_Click(object sender, EventArgs e)
        {
            OrderAddress add = SaveAddress();

            AddShipment(add);

            StartPageType home        = (StartPageType)GetPage(ContentReference.StartPage);
            var           cartPage    = home.Settings.CartPage;
            string        cartPageUrl = RouteTable.Routes.GetVirtualPath(cartPage, ContentLanguage.PreferredCulture.Name).GetUrl();

            Response.Redirect(cartPageUrl);
        }
        protected void AddToCart_Click(object sender, EventArgs e)
        {
            CartHelper ch       = new CartHelper(Cart.DefaultName);
            int        quantity = int.Parse(txtQuantity.Text);

            ch.AddEntry(entry, quantity, false, new CartHelper[] { });

            StartPageType home     = (StartPageType)GetPage(ContentReference.StartPage);
            var           cartPage = home.Settings.CartPage;

            string cartPageUrl = UrlResolver.Current.GetUrl(cartPage);

            Response.Redirect(cartPageUrl);
        }
Beispiel #4
0
        public IEnumerable <ValidationError> ValidateStartPage(StartPageType instance)
        {
            var condition1 = false;
            var condition2 = false;
            var condition3 = false;
            var condition4 = false;

            if (condition1)
            {
                yield return(new ValidationError()
                {
                    ErrorMessage = "Error message1",
                    PropertyName = instance.GetPropertyName(property => property.PageName),
                    Severity = ValidationErrorSeverity.Error,             //None, Info, Worning, Error
                    ValidationType = ValidationErrorType.AttributeMatched //Unspecified, AttributeM
                });
            }
            if (condition2)
            {
                yield return(new ValidationError()
                {
                    ErrorMessage = "Error message2",
                    PropertyName = instance.GetPropertyName(property => property.PageName),
                    Severity = ValidationErrorSeverity.Error,             //None, Info, Worning, Error
                    ValidationType = ValidationErrorType.AttributeMatched //Unspecified, AttributeM
                });
            }
            if (condition3)
            {
                yield return(new ValidationError()
                {
                    ErrorMessage = "Error message3",
                    PropertyName = instance.GetPropertyName(property => property.PageName),
                    Severity = ValidationErrorSeverity.Info,              //None, Info, Worning, Error
                    ValidationType = ValidationErrorType.AttributeMatched //Unspecified, AttributeM
                });
            }
            if (condition4)
            {
                yield return(new ValidationError()
                {
                    ErrorMessage = "Error message4",

                    PropertyName = instance.GetPropertyName(property => property.PageName),
                    Severity = ValidationErrorSeverity.Warning,           //None, Info, Worning, Error
                    ValidationType = ValidationErrorType.AttributeMatched //Unspecified, AttributeM
                });
            }
        }