public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Geometry,Addition,Subtraction,TotalScore,Username")] Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
Exemple #2
0
        public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Email,Username,Password,ConfirmPassword")] Teacher teacher)
        {
            while (db.Students.Find(teacher.Id) != null)
            {
                teacher.Id++;
            }

            if (ModelState.IsValid)
            {
                db.Entry(teacher).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(teacher));
        }