Example #1
0
 public ActionResult Edit([Bind(Include = "Huone_id,Huone")] Huoneet huoneet)
 {
     if (ModelState.IsValid)
     {
         db.Entry(huoneet).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(huoneet));
 }
Example #2
0
 public ActionResult Edit([Bind(Include = "Lampotila_id,Huone,NykyLampotila,TavoiteLampotila")] Lampotilat lampotilat)
 {
     if (ModelState.IsValid)
     {
         db.Entry(lampotilat).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Huone = new SelectList(db.Huoneet, "Huone_id", "Huone", lampotilat.Huone);
     return(View(lampotilat));
 }
 public ActionResult Edit([Bind(Include = "Valo_id,Huone,Valaisin,ValonTila,ValonMaara")] Valot valot)
 {
     if (ModelState.IsValid)
     {
         db.Entry(valot).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Huone = new SelectList(db.Huoneet, "Huone_id", "Huone", valot.Huone);
     return(View(valot));
 }