public ActionResult Create(Guid spectacleId) { var spectacle = mSpectacleService.GetById(spectacleId); if (spectacle == null) return HttpNotFound(); SeanceDTO dto = new SeanceDTO(true){SpectacleId = spectacleId, SpectacleName = spectacle.Name}; return View(dto); }
public ActionResult Create(SeanceDTO seance) { if (ModelState.IsValid) { mSeanceService.Add(seance); return RedirectToAction("Seances", "Spectacle", new { id = seance.SpectacleId }); } return View(seance); }
public ActionResult EditConfirm(SeanceDTO seance) { if (ModelState.IsValid) { mNotificationService.NotificateOnUpdate(seance.Id, seance.Date); mSeanceService.Update(seance); return RedirectToAction("Seances", "Spectacle", new {id = seance.SpectacleId}); } return View(seance); }
public void RemoveSeance(SeanceDTO seance) { var seanceDb = mDb.Seances.Get(seance.Id); if (seanceDb == null) return; NotificateUsersOnSeanceDelete(seanceDb); mDb.Seances.Delete(seance.Id); mDb.SaveChanges(); }
public void AddSeance(SeanceDTO seance) { var spectacle = mDb.Spectacles.Get(seance.SpectacleId); if (spectacle == null) return; var newSeance = seance.Convert(); newSeance.Id = Guid.NewGuid(); spectacle.Seances.Add(newSeance); mDb.SaveChanges(); }
public void ChangeSeance(SeanceDTO seance) { var dbEntitiy = mDb.Seances.Get(seance.Id); if (dbEntitiy == null) return; var changed = seance.Convert(); NotificateUsersOnSeanceChanging(dbEntitiy, changed.Date); mDb.Seances.Update(changed); mDb.SaveChanges(); }
public void Add(SeanceDTO seance) { mContext.Seances.Add(seance.Convert()); mContext.SaveChanges(); }
public void Update(SeanceDTO seance) { mContext.Seances.Update(seance.Convert()); mContext.SaveChanges(); }