当前位置: 首页>>代码示例>>C#>>正文


C# UrlHelper.RouteERPStoreUrl方法代码示例

本文整理汇总了C#中System.Web.Mvc.UrlHelper.RouteERPStoreUrl方法的典型用法代码示例。如果您正苦于以下问题:C# UrlHelper.RouteERPStoreUrl方法的具体用法?C# UrlHelper.RouteERPStoreUrl怎么用?C# UrlHelper.RouteERPStoreUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.Mvc.UrlHelper的用法示例。


在下文中一共展示了UrlHelper.RouteERPStoreUrl方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AccountConfirmation

        public ViewResult AccountConfirmation(Models.User user, string emailUrl)
        {
            var host = Request.Url.Host;
            var accountKey = CryptoService.EncryptAccountConfirmation(user.Email, user.Id);
            var urlHelper = new UrlHelper(ControllerContext.RequestContext);
            var accountConfirmationUrl = urlHelper.RouteERPStoreUrl(ERPStoreRoutes.ACCOUNT_CONFIRMATION, null);
            string confirmationUrl = string.Format("http://{0}{1}{2}", host, accountConfirmationUrl, accountKey);

            ViewData.Model = user;
            ViewData["confirmationUrl"] = confirmationUrl;
            ViewBag.ConfirmationUrl = confirmationUrl;
            ViewData["encryptedUrl"] = emailUrl;
            ViewBag.EncryptedUrl = emailUrl;
            ViewBag.User = user;
            ViewBag.WebSiteSettings = ERPStore.ERPStoreApplication.WebSiteSettings;
            return View();
        }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:17,代码来源:EmailerController.cs

示例2: ChangePassword

 public ViewResult ChangePassword(string personFullName, string callbackUrl, string encryptedUrl)
 {
     var urlHelper = new UrlHelper(ControllerContext.RequestContext);
     ViewData["FullName"] = personFullName;
     ViewBag.FullName = personFullName;
     ViewData["EncryptedUrl"] = callbackUrl;
     ViewBag.CallbackUrl = callbackUrl;
     ViewData["EncryptedUrl2"] = encryptedUrl;
     ViewBag.EncryptedUrl = encryptedUrl;
     ViewData["accountUrl"] = urlHelper.RouteERPStoreUrl(ERPStoreRoutes.ACCOUNT, null);
     ViewBag.WebSiteSettings = ERPStore.ERPStoreApplication.WebSiteSettings;
     return View();
 }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:13,代码来源:EmailerController.cs

示例3: NewCustomerOrderConfirmation

        public ViewResult NewCustomerOrderConfirmation(Models.ISaleDocument order, string encrypteUrl, string password)
        {
            var urlHelper = new UrlHelper(ControllerContext.RequestContext);
            string accountUrl = string.Format("http://{0}{1}", Request.Url.Host, urlHelper.RouteERPStoreUrl(ERPStoreRoutes.ACCOUNT));

            ViewData["accountUrl"] = accountUrl;
            ViewData["encryptedUrl"] = encrypteUrl;
            ViewData["password"] = password;
            ViewData.Model = order;
            return View();
        }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:11,代码来源:EmailerController.cs

示例4: OrderConfirmation

        public ViewResult OrderConfirmation(Models.ISaleDocument order, string emailUrl)
        {
            var host = Request.Url.Host;

            var urlHelper = new UrlHelper(ControllerContext.RequestContext);
            string accountUrl = string.Format("http://{0}{1}", host, urlHelper.RouteERPStoreUrl(ERPStoreRoutes.ACCOUNT));

            ViewData["accountUrl"] = accountUrl;
            ViewData["encryptedUrl"] = emailUrl;
            ViewData.Model = order;
            return View();
        }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:12,代码来源:EmailerController.cs

示例5: DirectNewCustomerOrderConfirmation

        public ActionResult DirectNewCustomerOrderConfirmation(string key)
        {
            if (key.IsNullOrTrimmedEmpty())
            {
                return new EmptyResult();
            }
            var mailKey = new
            {
                Code = string.Empty,
                Type = string.Empty,
                Password = string.Empty,
                Salt = DateTime.Now,
            };
            var result = CryptoService.Decrypt(key, mailKey);
            var code = Convert.ToString(result[0]);
            var type = Convert.ToString(result[1]);
            var password = Convert.ToString(result[2]);
            var salt = Convert.ToDateTime(result[3]);

            Models.ISaleDocument order = null;
            switch (type)
            {
                case "order":
                    order = SalesService.GetOrderByCode(code);
                    break;
                case "quote":
                    order = SalesService.GetQuoteByCode(code);
                    break;
                default:
                    break;
            }

            var host = this.Request.Url.Host;
            var encryptedTicket = CryptoService.EncryptOrderConfirmation(order.Code, DateTime.Now.AddDays(10), false);

            var urlHelper = new UrlHelper(this.ControllerContext.RequestContext);
            string accountUrl = string.Format("http://{0}{1}", host, urlHelper.RouteERPStoreUrl(ERPStoreRoutes.ACCOUNT));
            string encryptedUrl = string.Format("http://{0}{1}{2}", host, urlHelper.RouteERPStoreUrl(ERPStoreRoutes.ORDER_DETAIL), encryptedTicket);

            ViewData["accountUrl"] = accountUrl;
            ViewData["encryptedUrl"] = encryptedUrl;
            ViewData["password"] = password;

            ViewData.Model = order;
            return View("NewCustomerOrderConfirmation");
        }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:46,代码来源:EmailerController.cs

示例6: DirectOrderConfirmation

        public ActionResult DirectOrderConfirmation(string key)
        {
            var mailKey = new
            {
                Code = string.Empty,
                Type = string.Empty,
                Salt = DateTime.Now,
            };
            var result = CryptoService.Decrypt(key, mailKey);
            var code = Convert.ToString(result[0]);
            var type = Convert.ToString(result[1]);
            var salt = Convert.ToDateTime(result[2]);

            Models.ISaleDocument order = null;
            switch (type)
            {
                case "order":
                    order = SalesService.GetOrderByCode(code);
                    break;
                case "quote":
                    order = SalesService.GetQuoteByCode(code);
                    break;
                default:
                    break;
            }

            var urlHelper = new UrlHelper(ControllerContext.RequestContext);
            string accountUrl = string.Format("http://{0}{1}", Request.Url.Host, urlHelper.RouteERPStoreUrl(ERPStoreRoutes.ACCOUNT));

            var encryptedTicket = CryptoService.EncryptOrderConfirmation(order.Code, DateTime.Now.AddDays(10), false);
            string encryptedUrl = string.Format("http://{0}{1}{2}", Request.Url.Host, urlHelper.RouteERPStoreUrl(ERPStoreRoutes.ORDER_DETAIL), encryptedTicket);

            ViewData.Model = order;

            ViewData["accountUrl"] = accountUrl;
            ViewData["encryptedUrl"] = encryptedUrl;
            ViewBag.EncryptedUrl = encryptedUrl;
            ViewBag.User = order.User;
            ViewBag.FullName = order.User.FullName;
            ViewBag.WebSiteSettings = ERPStoreApplication.WebSiteSettings;
            ViewBag.EncryptedUrl = encryptedUrl;

            return View("OrderConfirmation");
        }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:44,代码来源:EmailerController.cs

示例7: DirectChangePassword

        public ActionResult DirectChangePassword(string key)
        {
            var mailKey = new
            {
                UserId = 0,
                ExpirationDate = DateTime.MinValue,
            };

            var result = CryptoService.Decrypt(key, mailKey);
            var userId = Convert.ToInt32(result[0]);
            var expirationDate = Convert.ToDateTime(result[1]);

            if (expirationDate < DateTime.Today)
            {
                return Content("Clé invalide", "text/plain");
            }

            var user = AccountService.GetUserById(userId);

            var host = Request.Url.Host;
            var callbackKey = CryptoService.EncryptChangePassword(user.Id, user.Email);
            var urlHelper = new UrlHelper(ControllerContext.RequestContext);
            var callbackUrl = string.Format("http://{0}{1}/{2}", host, urlHelper.RouteERPStoreUrl(ERPStoreRoutes.ACCOUNT_CHANGE_PASSWORD), callbackKey);

            var view = ChangePassword(user.FullName, callbackUrl, "#");
            view.ViewName = "ChangePassword";
            return view;
        }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:28,代码来源:EmailerController.cs

示例8: RecoverPassword

        public ActionResult RecoverPassword(string loginOrEmail)
        {
            var user = AccountService.GetUserByEmailOrLogin(loginOrEmail);
            if (user == null)
            {
                ModelState.AddModelError("_FORM", "Identifiant inconnu");
                return View();
            }

            var host = Request.Url.Host;
            var key = CryptoService.EncryptChangePassword(user.Id, user.Email);
            var urlHelper = new UrlHelper(ControllerContext.RequestContext);
            var url = string.Format("http://{0}{1}/{2}", host, urlHelper.RouteERPStoreUrl(ERPStoreRoutes.ACCOUNT_CHANGE_PASSWORD), key);
            ViewData["key"] = key;

            try
            {
                EmailerService.SendChangePassword(this, user, url);
                ViewData["PasswordSent"] = true;
            }
            catch(Exception ex)
            {
                LogError(Logger, ex);
                ModelState.AddModelError("_FORM", "Un problème technique empeche l'execution de cette opération");
            }

            return View();
        }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:28,代码来源:AccountController.cs

示例9: SendOrderConfirmation

        public virtual void SendOrderConfirmation(System.Web.Mvc.Controller controller, ERPStore.Models.ISaleDocument order)
        {
            if (order.User.Email.IsNullOrTrimmedEmpty())
            {
                return;
            }

            var urlHelper = new UrlHelper(controller.ControllerContext.RequestContext);

            var mailKey = new
            {
                Code = order.Code,
                Type = (order is Models.Order) ? "order" : "quote",
                Salt = DateTime.Now,
            };
            var encrytpedMailKey = CryptoService.Encrypt(mailKey);
            string encrytpedEmailUrl = string.Format("http://{0}{1}", controller.HttpContext.Request.Url.Host, urlHelper.RouteERPStoreUrl(ERPStoreRoutes.EMAILER, new { action = "DirectOrderConfirmation", key = encrytpedMailKey, }));

            var body = controller.GetActionOutput<ERPStore.Controllers.EmailerController>(i => i.OrderConfirmation(order, encrytpedEmailUrl));
            if (body == null)
            {
                return;
            }

            var message = new MailMessage();
            message.Body = body;
            message.To.Add(new MailAddress(order.User.Email, order.User.FullName));
            message.Subject = string.Format("[{0}] Votre commande N°{1}", ERPStoreApplication.WebSiteSettings.SiteName, order.Code);
            message.IsBodyHtml = true;

            Send(message);
        }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:32,代码来源:EmailerService.cs

示例10: SendChangePassword

        public virtual void SendChangePassword(System.Web.Mvc.Controller controller, ERPStore.Models.User user, string callbackUrl)
        {
            var urlHelper = new UrlHelper(controller.ControllerContext.RequestContext);

            var mailKey = new
            {
                UserId = user.Id,
                ExpirationDate = DateTime.Now,
            };
            var encrytpedMailKey = CryptoService.Encrypt(mailKey);
            string encrytpedEmailUrl = string.Format("http://{0}{1}", controller.HttpContext.Request.Url.Host, urlHelper.RouteERPStoreUrl(ERPStoreRoutes.EMAILER, new { action = "DirectSendChangePassword", key = encrytpedMailKey, }));

            var body = controller.GetActionOutput<Controllers.EmailerController>(i => i.ChangePassword(user.FullName, callbackUrl, encrytpedEmailUrl));

            var email = new MailMessage();
            email.Body = body;
            email.To.Add(new MailAddress(user.Email, user.FullName));
            email.Subject = string.Format("[{0}] Demande de changement de mot de passe", ERPStoreApplication.WebSiteSettings.SiteName);
            email.IsBodyHtml = true;

            Send(email);
        }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:22,代码来源:EmailerService.cs

示例11: SendAccountConfirmation

        public virtual void SendAccountConfirmation(System.Web.Mvc.Controller controller, ERPStore.Models.User user)
        {
            var urlHelper = new UrlHelper(controller.ControllerContext.RequestContext);

            var mailKey = new
            {
                UserId = user.Id,
                Salt = Guid.NewGuid().ToString(),
            };
            var encrytpedMailKey = CryptoService.Encrypt(mailKey);
            string encrytpedEmailUrl = string.Format("http://{0}{1}", controller.HttpContext.Request.Url.Host, urlHelper.RouteERPStoreUrl(ERPStoreRoutes.EMAILER, new { action = "DirectAccountConfirmation", key = encrytpedMailKey, }));

            var body = controller.GetActionOutput<Controllers.EmailerController>(i => i.AccountConfirmation(user, encrytpedEmailUrl));
            if (body == null)
            {
                return;
            }

            var message = new MailMessage();
            message.Body = body;
            message.To.Add(new MailAddress(user.Email, user.FullName));
            message.Subject = string.Format("[{0}] Confirmation de votre compte", ERPStoreApplication.WebSiteSettings.SiteName);
            message.IsBodyHtml = true;

            Send(message);
        }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:26,代码来源:EmailerService.cs


注:本文中的System.Web.Mvc.UrlHelper.RouteERPStoreUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。