public ActionResult DeleteConfirmed(int id) { LokaalType lokaalType = db.LokaalTypes.Find(id); db.LokaalTypes.Remove(lokaalType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "LokaalTypeId,LokaalTypeNaam")] LokaalType lokaalType) { if (ModelState.IsValid) { db.Entry(lokaalType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lokaalType)); }
public ActionResult Create([Bind(Include = "LokaalTypeId,LokaalTypeNaam")] LokaalType lokaalType) { if (ModelState.IsValid) { db.LokaalTypes.Add(lokaalType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lokaalType)); }
// GET: LokaalTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LokaalType lokaalType = db.LokaalTypes.Find(id); if (lokaalType == null) { return(HttpNotFound()); } return(View(lokaalType)); }
//constructor die overeenkomt met lokalen in databank public Lokaal(String lokaalcode, int aantalPlaatsen, string type) //string type { switch (type) { case "Vergaderzaal": lokaalType = LokaalType.Vergaderzaal; break; case "Leslokaal": lokaalType = LokaalType.Leslokaal; break; case "PC-klas": lokaalType = LokaalType.PCklas; break; case "Auditorium": lokaalType = LokaalType.Auditorium; break; } Lokaalcode = lokaalcode; AantalPlaatsen = aantalPlaatsen; }