Ejemplo n.º 1
0
        public ActionResult Edit(Student student)
        {
            if (ModelState.IsValid)
            {
                db.Entry(student).State = EntityState.Modified;
                db.SaveChanges();
                return this.RedirectToLoginIfNotAuthenticated(RedirectToAction("Index"));
            }

            return this.RedirectToLoginIfNotAuthenticated(View(student));
        }
Ejemplo n.º 2
0
        public ActionResult Create(Student student)
        {
            if (ModelState.IsValid)
            {
                db.Students.Add(student);
                db.SaveChanges();
                return this.RedirectToLoginIfNotAuthenticated(RedirectToAction("Index"));
            }

            return this.RedirectToLoginIfNotAuthenticated(View(student));
        }