예제 #1
0
 public ActionResult Edit([Bind(Include = "ID,FirstName,LastName,UserName,Password")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
예제 #2
0
 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));
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "ID,CourseName,Duration")] Course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(course));
 }
 public ActionResult Edit([Bind(Include = "ID,FirstName,LastName,nic,Course_ID,Batch_ID,Phone")] Regstration regstration)
 {
     if (ModelState.IsValid)
     {
         db.Entry(regstration).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Batch_ID  = new SelectList(db.Batches, "ID", "Batch1", regstration.Batch_ID);
     ViewBag.Course_ID = new SelectList(db.Courses, "ID", "CourseName", regstration.Course_ID);
     return(View(regstration));
 }