Esempio n. 1
0
        public ActionResult Register(FormCollection f)
        {
            string email       = f["Email"];
            Member checkMember = repository.CheckMember(email);

            if (checkMember == null)
            {
                Member member = new Member();
                member.Account          = f["Account"];
                member.Email            = f["Email"];
                member.Name             = f["Name"];
                member.Address          = f["Address"];
                member.Password         = f["Password"];
                member.Phone            = f["Phone"];
                member.Question         = f["Question"];
                member.Answer           = f["Answer"];
                member.MemberShipTypeId = 3;
                repository.AddMember(member);
                TempData["Status"]  = "Register Sucess!";
                TempData["Message"] = "Go To Login.";
                TempData["Style"]   = "alert-success";
            }

            TempData["Status"]  = "Register Fail!";
            TempData["Message"] = "Email already exists.";
            TempData["Style"]   = "alert-danger";
            return(RedirectToAction("Index"));
        }