public void SaveLaundery(LaunderyRoom launderyRoom) { db.Entry(launderyRoom).State = EntityState.Modified; db.SaveChanges(); }
public ActionResult EditLaundery(LaunderyRoom launderyRoom) { if (IsAdmin() != true) { return RedirectToAction("Index", "Dashboard"); } try { if (ModelState.IsValid) { _ldryService.SaveLaundery(launderyRoom); return RedirectToAction("LaunderyList"); } return RedirectToAction("LaunderyList"); } catch { return View(); } }
public void CreateLaundery(LaunderyRoom launderyRoom) { db.LaunderyRoom.Add(launderyRoom); db.SaveChanges(); }