Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Luokkahuone luokkahuone = db.Luokkahuone.Find(id);

            db.Luokkahuone.Remove(luokkahuone);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "LuokkaID,LuokanNimi,LuokanKoodi")] Luokkahuone luokkahuone)
 {
     if (ModelState.IsValid)
     {
         db.Entry(luokkahuone).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(luokkahuone));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "LuokkaID,LuokanNimi,LuokanKoodi")] Luokkahuone luokkahuone)
        {
            if (ModelState.IsValid)
            {
                db.Luokkahuone.Add(luokkahuone);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(luokkahuone));
        }
Example #4
0
        // GET: Luokkahuoneet/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Luokkahuone luokkahuone = db.Luokkahuone.Find(id);

            if (luokkahuone == null)
            {
                return(HttpNotFound());
            }
            return(View(luokkahuone));
        }