コード例 #1
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));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "id,course1,duration")] course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(course));
 }
コード例 #3
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));
 }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "id,firstname,lastname,nic,course_id,batch_id,telno")] registation registation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(registation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.batch_id  = new SelectList(db.batches, "id", "batch1", registation.batch_id);
     ViewBag.course_id = new SelectList(db.courses, "id", "course1", registation.course_id);
     return(View(registation));
 }