Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "c_id,sem,section")] Class @class)
 {
     if (ModelState.IsValid)
     {
         db.Entry(@class).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(@class);
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "organization,category,amount")] Sponsor sponsor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sponsor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sponsor));
 }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "e_id,name,date,time,venue,prize,description")] Event @event)
 {
     if (ModelState.IsValid)
     {
         db.Entry(@event).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(@event));
 }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "d_id,d_name")] Department department)
 {
     if (ModelState.IsValid)
     {
         db.Entry(department).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(department));
 }
Ejemplo n.º 5
0
 public ActionResult Edit([Bind(Include = "usn,name,d_id,c_id")] Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.c_id = new SelectList(db.Classes, "c_id", "section", student.c_id);
     ViewBag.d_id = new SelectList(db.Departments, "d_id", "d_name", student.d_id);
     return(View(student));
 }