Esempio n. 1
0
        public void R(string e, string a, string m)
        {
            if (true)
            {
                var user = new ApplicationUser {
                    UserName = e, PhoneNumber = a, Email = e
                };
                var result = UserManager.Create(user, m);
                if (true)
                {
                    SignInManager.SignIn(user, isPersistent: false, rememberBrowser: false);

                    // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
                    // Send an email with this link
                    // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
                    // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                    // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");



                    livreur.Mail     = e;
                    livreur.activite = 0;
                    livreur.adresse  = a;

                    livreur.idU = user.Id;
                    db.Livreur.Add(livreur);
                    db.SaveChanges();
                }
            }
        }
        public ActionResult Create([Bind(Include = "id,Mail,Nom,Prenom,Password")] Livreur livreur)
        {
            if (ModelState.IsValid)
            {
                db.Livreur.Add(livreur);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(livreur));
        }
Esempio n. 3
0
 public void Commit()
 {
     ctxt.SaveChanges();
 }