Пример #1
0
        public ActionResult RegisterPost(FormCollection form)
        {
            Gebruiker newUser = new Gebruiker(form["Email"], form["Password"], form["Name"], form["Lastname"], false, form["Street"], form["HouseNumber"], form["Zipcode"], form["Country"], form["City"]);

            string id = newUser.SaveOrUpdate();

            if (id == null)
            {
                ViewBag.RegisterResult = false;
                return(View("~/Views/Auth/Register.cshtml"));
            }
            else
            {
                return(Login());
            }
        }
Пример #2
0
        public ActionResult Changepassword(FormCollection form)
        {
            Gebruiker g = (Gebruiker)Session["AuthGebruiker"];

            if (g.Wachtwoord == form["oldPassword"] && (form["newPassword"] == form["validateNewPassword"]))
            {
                g.Wachtwoord = form["newPassword"];

                g.SaveOrUpdate();
                ViewBag.UpdateResult = "true";
            }
            else
            {
                ViewBag.UpdateResult = "false";
            }

            return(View("~/Views/Account/Settings.cshtml"));
        }
Пример #3
0
        public ActionResult Update(FormCollection form)
        {
            Gebruiker g = (Gebruiker)Session["AuthGebruiker"];

            g.Email      = form["Email"];
            g.Voornaam   = form["Name"];
            g.Achternaam = form["Lastname"];
            g.Straat     = form["Street"];
            g.Huisnummer = form["HouseNumber"];
            g.Postcode   = form["Zipcode"];
            g.Woonplaats = form["Country"];
            g.Land       = form["City"];

            string id = g.SaveOrUpdate();

            if (id != null)
            {
                ViewBag.UpdateResult = "true";
            }

            return(View("~/Views/Account/Settings.cshtml"));
        }