public IActionResult Save(MuseumTypes type) { if (!ModelState.IsValid) { return(View("Add", type)); } museumtypeRepository.InsertMuseumType(type); museumtypeRepository.Save(); return(RedirectToAction("Index")); }
public IActionResult Edit(MuseumTypes type) { if (!ModelState.IsValid) { return(View("Edit", type)); } museumtypeRepository.UpdateMuseumType(type); museumtypeRepository.Save(); return(RedirectToAction("Index")); }
public void DeleteMuseumType(int typeId) { MuseumTypes type = context.MuseumTypes.Find(typeId); context.MuseumTypes.Remove(type); }
public void UpdateMuseumType(MuseumTypes type) { context.Entry(type).State = EntityState.Modified; }
public void InsertMuseumType(MuseumTypes type) { context.MuseumTypes.Add(type); }
public IActionResult Add() { MuseumTypes model = new MuseumTypes(); return(View(model)); }
public IActionResult GetType(int id) { MuseumTypes model = museumtypeRepository.GetMuseumType(id); return(View("Edit", model)); }