Exemplo n.º 1
0
 public ActionResult Register(RegistrationInfo info)
 {
     HttpCookie c = new HttpCookie("user", "");
     c.Expires = DateTime.Now.AddMinutes(1);
     c["name"] = info.Username;
     c["profession"] = info.Profession;
     c["userid"] = info.UserID.ToString();
     info.IsRegistered = true;
     Response.Cookies.Add(c);
     return View(info);
 }
Exemplo n.º 2
0
        //
        // GET: /Registration/

        public ActionResult Register()
        {
            RegistrationInfo info = new RegistrationInfo();
            HttpCookie c = Request.Cookies["user"];
            if (c != null)
            {
                info.Usr = c["name"];
                info.Profession = c["profession"];
                info.UserID = int.Parse(c["userid"]);
                info.IsRegistered = true;
            }
            return View(info);
        }
Exemplo n.º 3
0
 public ActionResult Register()
 {
     string currentUrl = CookiesCheck();
     if (currentUrl != "")
         return new RedirectResult(currentUrl);
     RegistrationInfo info = new RegistrationInfo();
     HttpCookie c = Request.Cookies["user"];
     if (c != null)
     {
         info.Username = c["name"];
         info.Profession = c["profession"];
         info.UserID = int.Parse(c["userid"]);
         info.IsRegistered = true;
     }
     return View(info);
 }