Ejemplo n.º 1
0
 public ActionResult VerificationEmail(string strRandom)
 {
     if (Session["RandomText"] != null && Session["Account"] != null)
     {
         string code = Session["RandomText"].ToString();
         if (code.Equals(strRandom))
         {
             var account = (OAccount)Session["Account"];
             accountService.Active(account);
             return(RedirectToAction("Index", "Home"));
         }
     }
     return(View("~/Views/Shared/Error.cshtml"));
 }
Ejemplo n.º 2
0
 public ActionResult HandleActive(ActiveModels active)
 {
     if (ModelState.IsValid)
     {
         var activeResult = AccountService.Active(active.Token);
         if (activeResult == "invalid")
         {
             ModelState.AddModelError("Token", "Mã kích hoạt tài khoản không đúng.");
             return(View("Account.Active", active));
         }
         if (activeResult == "expire")
         {
             var getTokenUrl = string.Format("{0}account/gettoken", ConfigHelper.WebDomain);
             ModelState.AddModelError("Token", string.Format("Mã kích hoạt tài khoản đã hết hạn. Click vào <a style='color: #007FF0' href='{0}' title='Kích hoạt tài khoản'> đây</a> để lấy mã kích hoạt. ", getTokenUrl));
             return(View("Account.Active", active));
         }
         return(RedirectToAction("Login"));
     }
     return(View("Account.Active", active));
 }