public static void Update(int id, string?name) { using var db = new DbCinema(); var role = Get(id); if (name != null) { role.Name = name; } db.Update(role); }
public static void Update(int id, string?name) { using var db = new DbCinema(); var hall = Get(id); if (name != null) { hall.Name = name; } db.Update(hall); }
public static void Update(int id, string?password = null, int?roleId = null) { using var db = new DbCinema(); var user = Get(id); if (password != null) { user.Password = PasswordCipher.ConvertPassword(password); } if (roleId != null) { user.RoleId = (int)roleId; } db.Update(user); }
public static void Update(int id, string?name, double?length) { using var db = new DbCinema(); var movie = Get(id); if (name != null) { movie.Name = name; } if (length != null) { movie.Length = (double)length; } db.Update(movie); }
public static void Update(int id, int?seat = null, bool?isConfirmed = null) { using var db = new DbCinema(); var reservation = Get(id); if (seat != null) { reservation.Seat = (int)seat; } if (isConfirmed != null) { reservation.IsConfirmed = (bool)isConfirmed; } db.Update(reservation); }
public static void Update(int id, int?movieId = null, int?hallId = null, DateTime?time = null) { using var db = new DbCinema(); var seance = Get(id); if (movieId != null) { seance.MovieId = (int)movieId; } if (hallId != null) { seance.HallId = (int)hallId; } if (time != null) { seance.Time = (DateTime)time; } db.Update(seance); }