Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,name,Plan")] Trip trip)
 {
     if (ModelState.IsValid)
     {
         db.Entry(trip).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(trip));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,login,password,role,name")] Users users)
 {
     if (ModelState.IsValid)
     {
         db.Entry(users).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(users));
 }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "Id,name,State")] Buss buss)
 {
     if (ModelState.IsValid)
     {
         db.Entry(buss).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(buss));
 }
Exemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "Id,Day,Id_trip,Id_driver,Id_worker,Id_buss")] TripPlan tripPlan)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tripPlan).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Id_buss   = new SelectList(db.Buss, "Id", "name", tripPlan.Id_buss);
     ViewBag.Id_trip   = new SelectList(db.Trip, "Id", "name", tripPlan.Id_trip);
     ViewBag.Id_driver = new SelectList(db.Users, "Id", "login", tripPlan.Id_driver);
     ViewBag.Id_worker = new SelectList(db.Users, "Id", "login", tripPlan.Id_worker);
     return(View(tripPlan));
 }