private void Button2_Click(object sender, EventArgs e) { if (checkBox1.Enabled == true && checkBox1.Checked == true) { Showtimes showtimes = new Showtimes(); showtimes.HallId = Convert.ToInt32(comboBox1.SelectedValue); showtimes.Clock = 1; showtimes.Date = dateTimePicker1.Value; var a = HelperShowtimes.ShowtimesCUD(showtimes, System.Data.Entity.EntityState.Added); CreateChairs(a); checkBox1.Enabled = false; } if (checkBox2.Enabled == true && checkBox2.Checked == true) { Showtimes showtimes = new Showtimes(); showtimes.HallId = Convert.ToInt32(comboBox1.SelectedValue); showtimes.Clock = 2; showtimes.Date = dateTimePicker1.Value; var a = HelperShowtimes.ShowtimesCUD(showtimes, System.Data.Entity.EntityState.Added); CreateChairs(a); checkBox2.Enabled = false; } if (checkBox3.Enabled == true && checkBox3.Checked == true) { Showtimes showtimes = new Showtimes(); showtimes.HallId = Convert.ToInt32(comboBox1.SelectedValue); showtimes.Clock = 3; showtimes.Date = dateTimePicker1.Value; var a = HelperShowtimes.ShowtimesCUD(showtimes, System.Data.Entity.EntityState.Added); CreateChairs(a); checkBox3.Enabled = false; } if (checkBox4.Enabled == true && checkBox4.Checked == true) { Showtimes showtimes = new Showtimes(); showtimes.HallId = Convert.ToInt32(comboBox1.SelectedValue); showtimes.Clock = 4; showtimes.Date = dateTimePicker1.Value; var a = HelperShowtimes.ShowtimesCUD(showtimes, System.Data.Entity.EntityState.Added); CreateChairs(a); checkBox4.Enabled = false; } if (checkBox5.Enabled == true && checkBox5.Checked == true) { Showtimes showtimes = new Showtimes(); showtimes.HallId = Convert.ToInt32(comboBox1.SelectedValue); showtimes.Clock = 5; showtimes.Date = dateTimePicker1.Value; var a = HelperShowtimes.ShowtimesCUD(showtimes, System.Data.Entity.EntityState.Added); CreateChairs(a); checkBox5.Enabled = false; } MessageBox.Show("Seans veya seanslar başarıyla eklendi.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); if (checkBox1.Checked && checkBox2.Checked && checkBox3.Checked && checkBox4.Checked && checkBox5.Checked) { button2.Enabled = false; } }
private void Button1_Click(object sender, EventArgs e) { if (comboBox1.SelectedValue == null) { MessageBox.Show("İlk önce salon seçmeniz gerekmektedir.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { groupBox1.Visible = true; checkBox1.Checked = false; checkBox2.Checked = false; checkBox3.Checked = false; checkBox4.Checked = false; checkBox5.Checked = false; checkBox1.Enabled = true; checkBox2.Enabled = true; checkBox3.Enabled = true; checkBox4.Enabled = true; checkBox5.Enabled = true; button2.Enabled = true; List <Showtimes> showtimes = HelperShowtimes.GetShowtimesListByHallIdAndDate(Convert.ToInt32(comboBox1.SelectedValue), dateTimePicker1.Value); foreach (var item in showtimes) { if (item.Clock == 1) { checkBox1.Checked = true; checkBox1.Enabled = false; } if (item.Clock == 2) { checkBox2.Checked = true; checkBox2.Enabled = false; } if (item.Clock == 3) { checkBox3.Checked = true; checkBox3.Enabled = false; } if (item.Clock == 4) { checkBox4.Checked = true; checkBox4.Enabled = false; } if (item.Clock == 5) { checkBox5.Checked = true; checkBox5.Enabled = false; } } } if (checkBox1.Checked && checkBox2.Checked && checkBox3.Checked && checkBox4.Checked && checkBox5.Checked) { button2.Enabled = false; } }
private void button1_Click(object sender, EventArgs e) { flowLayoutPanel1.Controls.Clear(); List <Showtimes> showtimesHelper = HelperShowtimes.GetShowtimesListByHallIdAndDate(Convert.ToInt32(comboBox1.SelectedValue), dateTimePicker1.Value); List <Showtimes> showtimes = showtimesHelper.OrderBy(x => x.Clock).ToList(); List <ShowtimesModel> showtimesModels = HelperShowtimes.GetShowtimesModelPartialList(showtimes); foreach (var item in showtimesModels) { RadioButton radioButton = new RadioButton(); radioButton.Text = item.Clock; radioButton.ForeColor = Color.White; radioButton.CheckedChanged += RadioButton_CheckedChanged; flowLayoutPanel1.Controls.Add(radioButton); } }
private void button2_Click(object sender, EventArgs e) { groupBox4.Visible = true; groupBox2.Visible = true; panel2.Visible = true; Hall hall = HelperHall.GetHallById(Convert.ToInt32(comboBox1.SelectedValue)); movie = HelperMovie.GetMovieById(hall.MovieId); byte[] imageBytes = Convert.FromBase64String(movie.Banner.ToString()); MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length); ms.Write(imageBytes, 0, imageBytes.Length); pictureBox8.Image = Image.FromStream(ms, true); showtimes = HelperShowtimes.GetShowtimesByHallIdAndDateAndClock(Convert.ToInt32(comboBox1.SelectedValue), dateTimePicker1.Value, checkedRadioButton); RefreshTheSeats(); }