Ejemplo n.º 1
0
        public ActionResult Register()
        {
            RegisterModel rs = new RegisterModel();

            string Email    = Request.Form["Account"].ToString();
            string Password = Request.Form["Password"].ToString();
            string NickName = Request.Form["NickName"].ToString();
            string Name     = Request.Form["Name"].ToString();
            string Mobile   = Request.Form["Mobile"].ToString();
            string Address  = Request.Form["Address"].ToString();


            bool result = rs.RegisterCheck(Email);

            if (result)
            {
                users us = new users();
                us.email    = Email;
                us.password = Password;
                us.nickname = NickName;
                us.name     = Name;
                us.mobile   = Mobile;
                us.address  = Address;
                us.createAt = DateTime.Now;

                db.users.Add(us);
                db.SaveChanges();

                return(new RedirectResult("~"));
            }
            else
            {
                return(new RedirectResult("~"));
            }
        }