Ejemplo n.º 1
0
        public virtual async Task <IActionResult> SetTaxType(int customerTaxType, string returnUrl = "")
        {
            var taxDisplayType = (TaxDisplayType)Enum.ToObject(typeof(TaxDisplayType), customerTaxType);
            await _workContext.SetTaxDisplayTypeAsync(taxDisplayType);

            //home page
            if (string.IsNullOrEmpty(returnUrl))
            {
                returnUrl = Url.RouteUrl("Homepage");
            }

            //prevent open redirection attack
            if (!Url.IsLocalUrl(returnUrl))
            {
                returnUrl = Url.RouteUrl("Homepage");
            }

            return(Redirect(returnUrl));
        }