public ActionResult Edit(Hall data) { var entity = context.Entry(data); entity.State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); return(RedirectToAction("Index")); }
public User Update(User obj) { var updatedEntry = _cinemaContext.Users.Attach(obj).Entity; _cinemaContext.Entry(obj).State = EntityState.Modified; return(updatedEntry); }
public async Task <Movie> ActivateCurrentMovie(Guid id) { var movie = await _cinemaContext.Movies.FindAsync(id); movie.Current = true; _cinemaContext.Entry(movie).State = EntityState.Modified; return(movie); }
public User AddPointsForUser(Guid userId, int numOfPoints) { var user = _cinemaContext.Users.Find(userId); user.Points = user.Points + numOfPoints; _cinemaContext.Entry(user).State = EntityState.Modified; return(user); }
public ActionResult Edit(Film film, int[] Countries, int[] Janrs) { var entity = context.Entry(film); entity.State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); DeleteRelationShip(film); foreach (var i in Countries) { FilmCountry filmCountry = new FilmCountry(); filmCountry.FilmId = film.Id; filmCountry.CountryId = i; context.FilmCountry.Add(filmCountry); context.SaveChanges(); } foreach (var i in Janrs) { FilmJanr janr = new FilmJanr(); janr.FilmId = film.Id; janr.JanrId = i; context.FilmJanr.Add(janr); context.SaveChanges(); } return(RedirectToAction("Index")); }
public Ticket Update(Ticket obj) { var updateEntry = _cinemaContext.Tickets.Attach(obj).Entity; _cinemaContext.Entry(obj).State = EntityState.Modified; return(updateEntry); }
public async Task <IActionResult> PutCinema(int id, Cinema cinema) { if (id != cinema.Id) { return(BadRequest()); } _context.Entry(cinema).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CinemaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult> UpdateSeats([FromBody] List <Seat> seats) { foreach (var seat in seats) { seat.IsBooked = true; _context.Entry(seat).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SeatExists(seat.Id)) { return(NotFound()); } else { throw; } } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "ID,Title,Genre,ReleaseDate,Length,Directors,Actor,Intro,TrailerURL")] Movie movie, HttpPostedFileBase upload) { if (ModelState.IsValid) { var movieToUpdate = db.Movies.Find(movie.ID); if (upload != null && upload.ContentLength > 0) { db.Files.Remove(movieToUpdate.Files.First()); var avatar = new File { FileName = System.IO.Path.GetFileName(upload.FileName), ContentType = upload.ContentType }; using (var reader = new System.IO.BinaryReader(upload.InputStream)) { avatar.Content = reader.ReadBytes(upload.ContentLength); } movieToUpdate.Files = new List <File> { avatar }; } db.Entry(movieToUpdate).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(movie)); }
public IHttpActionResult PutDirector(int id, Director director) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != director.Id) { return(BadRequest()); } db.Entry(director).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!DirectorExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public City Update(City obj) { var updatedEntry = _cinemaContext.Cities.Attach(obj); _cinemaContext.Entry(obj).State = EntityState.Modified; return(updatedEntry.Entity); }
public Auditorium Update(Auditorium obj) { var updatedEntry = _cinemaContext.Auditoriums.Attach(obj); _cinemaContext.Entry(obj).State = EntityState.Modified; return(updatedEntry.Entity); }
public Seat Update(Seat obj) { var updatedEntry = _cinemaContext.Seats.Attach(obj).Entity; _cinemaContext.Entry(obj).State = EntityState.Modified; return(updatedEntry); }
public Reservation Update(Reservation obj) { var updatedEntry = _cinemaContext.Reservations.Attach(obj); _cinemaContext.Entry(obj).State = EntityState.Modified; return(updatedEntry.Entity); }
public Tag Update(Tag obj) { var updatedEntry = _cinemaContext.Tags.Attach(obj); _cinemaContext.Entry(obj).State = EntityState.Modified; return(updatedEntry.Entity); }
public Role Update(Role obj) { var updatedEntry = _cinemaContext.Roles.Attach(obj); _cinemaContext.Entry(obj).State = EntityState.Modified; return(updatedEntry.Entity); }
public Actor Update(Actor obj) { var updatedEntry = _cinemaContext.Actors.Attach(obj); _cinemaContext.Entry(obj).State = EntityState.Modified; return(updatedEntry.Entity); }
public Data.Cinema Update(Data.Cinema obj) { var updatedEntry = _cinemaContext.Cinemas.Attach(obj); _cinemaContext.Entry(obj).State = EntityState.Modified; return(updatedEntry.Entity); }
public Movie Update(Movie obj) { var updatedEntry = _cinemaContext.Movies.Attach(obj).Entity; _cinemaContext.Entry(obj).State = EntityState.Modified; return(updatedEntry); }
public Projection Update(Projection obj) { var updatedEntry = _cinemaContext.Projections.Attach(obj).Entity; _cinemaContext.Entry(obj).State = EntityState.Modified; return(updatedEntry); }
public ActionResult Edit([Bind(Include = "SalaId,Numero,Capacidade,Descricao")] Sala sala) { if (ModelState.IsValid) { db.Entry(sala).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sala)); }
public ActionResult Edit([Bind(Include = "FilmeId,Titulo,Duracao")] Filme filme) { if (ModelState.IsValid) { db.Entry(filme).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(filme)); }
public ActionResult Edit([Bind(Include = "Id,Godzina,Data,Opis,FilmId,SalaId")] Seans seans) { if (ModelState.IsValid) { db.Entry(seans).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(seans)); }
public ActionResult Edit([Bind(Include = "OrderID,TotalPrice,Date_Of_Order")] Order order) { if (ModelState.IsValid) { db.Entry(order).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(order)); }
public ActionResult Edit([Bind(Include = "MovieID,Title,Length,Genra,year,ImageURI")] Movie movie) { if (ModelState.IsValid) { db.Entry(movie).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(movie)); }
public ActionResult Edit([Bind(Include = "movieID,movieName,movieRating,movieAgeLimit,actors,movieScheduleID,ticketID")] Movie movie) { if (ModelState.IsValid) { db.Entry(movie).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(movie)); }
public ActionResult Edit([Bind(Include = "ScreenID,ScreenNumber,Seats")] Screen screen) { if (ModelState.IsValid) { db.Entry(screen).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(screen)); }
public ActionResult Edit([Bind(Include = "IngressoId,Tipo")] Ingresso ingresso) { if (ModelState.IsValid) { db.Entry(ingresso).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ingresso)); }
public ActionResult Edit([Bind(Include = "AtorId,AtorNome,FilmeId")] Ator ator) { if (ModelState.IsValid) { db.Entry(ator).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ator)); }
public ActionResult Edit([Bind(Include = "FilmeID,Film,Regizor,Rating,Ora,Data_Premiera,Data_Finala")] Filme filme) { if (ModelState.IsValid) { db.Entry(filme).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(filme)); }