Beispiel #1
0
        public ActionResult Create(Person person)
        {
            if (ModelState.IsValid)
            {
                person.Password = EncryptionUtilities.CreatePasswordSalt(person.Password);

                db.People.Add(person);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(person));
        }
Beispiel #2
0
        public ActionResult Edit(Person person)
        {
            if (ModelState.IsValid)
            {
                //if(person.SaltHash.Length.Equals(0))
                //    person.SaltHash = GenerateSaltValue();

                person.Password = EncryptionUtilities.CreatePasswordSalt(person.Password);

                db.Entry(person).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(person));
        }