예제 #1
0
파일: Dal.cs 프로젝트: Zwem/Creatives
        public static void AddUser(RegisterModel model)
        {
            string confirmationToken =
                 WebSecurity.CreateUserAndAccount(model.Email, model.Password, new { FirstName = model.FirstName, LastName = model.LastName, About = model.About }, true);
            var user = model;

            BodyEmail.BodySend(user, confirmationToken);
        }
예제 #2
0
        public static void AddUser(RegisterModel model)
        {
            WebSecurity.CreateUserAndAccount(model.Email, model.Password,
                    new { FirstName = model.FirstName, LastName = model.LastName, About = model.About });

            WebSecurity.Login(model.Email, model.Password);

            //BodyEmail.BodySend(user, confirmationToken);
        }
예제 #3
0
파일: BodyEmail.cs 프로젝트: Zwem/Creatives
 public static void BodySend(RegisterModel model, string confirmationToken)
 {
     var uri = new Uri("http://" + System.Web.HttpContext.Current.Request.Url.Authority + "/Account/RegisterConfirmation/" + confirmationToken);
     string body = "<h4>" + "Your login:"******"<h4>" + "Your password:"******".</div> <div>" + "To activate your account please click on the link:"
      + "<a href=\"" + uri
      + "\">" + "Press here" + "</a>"
      + "<div></h4>";
     new SendEmail(model.Email,body);
 }
예제 #4
0
        public ActionResult Register(RegisterModel model, string[] selectedInterests)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    CreativesRepository.AddUser(model);

                    return RedirectToAction("Index","Home");
                }
                catch (MembershipCreateUserException e)
                {
                    ModelState.AddModelError("", ErrorCodeToString(e.StatusCode));
                }
            }

            return View(model);
        }