public MovieForm(Movie movie) { this.imageService = new ImageService(); this.townService = new TownService(); this.cinemaService = new CinemaService(); this.screeningService = new ScreeningService(); InitializeComponent(); if (AuthenticationManager.IsAuthenticated() && !AuthenticationManager.HasSuperRights()) { this.Controls.Add(this.ticketsButton); this.Controls.Add(this.townBox); this.Controls.Add(this.hourBox); this.Controls.Add(this.dateBox); this.Controls.Add(this.cinemaComboBox); } System.Drawing.Image image = imageService.byteArrayToImage(movie.Image.Content); this._movie = movie; this.pictureBox.Image = imageService.ScaleImage(image, 142, 224); this.titleBox.Text = _movie.Name; this.genreBox.Text = string.Join(", ", this._movie.Categories.Select(c => c.Name)); this.lengthBox.Text = _movie.Length.ToString() + " minutes"; this.yearBox.Text = _movie.ReleaseYear.ToString(); this.ratingBox.Text = _movie.Rating.ToString() + " / 10"; this.directorBox.Text = _movie.DirectorName; this.ageRestrictionBox.Text = _movie.AgeRestriction.ToString(); this.castBox.Text = string.Join(",", this._movie.Cast.Select(c => c.Name)); this.synopsisBox.Text = _movie.Synopsis; this.townBox.Text = "Select town"; this.townBox.Items.AddRange(townService.GetTownsNames()); this.FormBorderStyle = FormBorderStyle.None; }
private void EditTicketForm_Load(object sender, EventArgs e) { string[] towns = townService.GetTownsNames(); this.townComboBox.Items.AddRange(towns); string townCinema = ticket.Screening.Auditorium.Cinema.Town.Name; this.townComboBox.Text = townCinema; string cinemaName = ticket.Screening.Auditorium.Cinema.Name; this.cinemaComboBox.Text = cinemaName; string movieName = ticket.Screening.Movie.Name + "," + ticket.Screening.Movie.ReleaseYear; this.movieComboBox.Text = movieName; string ticketDate = ticketService.GetTicketDate(ticket.Id); this.dateComboBox.Text = ticketDate; string ticketTime = ticketService.GetTicketTime(ticket.Id); this.timeComboBox.Text = ticketTime; string ticketType = ticket.Type.ToString(); this.typeComboBox.Text = ticketType; string seatNumber = ticket.Seat.Number.ToString(); this.seatComboBox.Text = seatNumber; }
public MovieForm(Movie movie) { InitializeComponent(); System.Drawing.Image image = ImageService.byteArrayToImage(movie.Image.Content); this._movie = movie; this.pictureBox.Image = ImageService.ScaleImage(image, 142, 224); this.titleBox.Text = _movie.Name; this.genreBox.Text = string.Join(", ", this._movie.Categories.Select(c => c.Name)); this.lengthBox.Text = _movie.Length.ToString() + " minutes"; this.yearBox.Text = _movie.ReleaseYear.ToString(); this.ratingBox.Text = _movie.Rating.ToString() + " / 10"; this.directorBox.Text = _movie.DirectorName; this.ageRestrictionBox.Text = _movie.AgeRestriction.ToString(); this.castBox.Text = string.Join(",", this._movie.Cast.Select(c => c.Name)); this.synopsisBox.Text = _movie.Synopsis; this.townBox.Text = "Select town"; this.townBox.Items.AddRange(TownService.GetTownsNames()); this.FormBorderStyle = FormBorderStyle.None; }
private void CinemasForm_Load(object sender, EventArgs e) { this.TownsList.Items.AddRange(TownService.GetTownsNames()); }
private void ShowScreeningsForm_Load(object sender, EventArgs e) { this.townComboBox.Items.AddRange(TownService.GetTownsNames()); }
private void TicketForm_Load(object sender, EventArgs e) { this.townComboBox.Items.AddRange(townService.GetTownsNames()); }