public ActionResult Edit([Bind(Include = "Id,Name,Carrera")] Course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(course));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Surname,UserName,Password")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
 public ActionResult Edit([Bind(Include = "Id,Batch1,Year")] Batch batch)
 {
     if (ModelState.IsValid)
     {
         db.Entry(batch).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(batch));
 }
 public ActionResult Edit([Bind(Include = "Id,Name,Surname,CourseId,BatchId,Tel")] Registation registation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(registation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BatchId  = new SelectList(db.Batches, "Id", "Batch1", registation.BatchId);
     ViewBag.CourseId = new SelectList(db.Courses, "Id", "Name", registation.CourseId);
     return(View(registation));
 }
 public void UpdateStudent(Student student)
 {
     db.Entry(student).State = EntityState.Modified;
 }