private void button3_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox4.Text) || string.IsNullOrEmpty(textBox2.Text)) { MessageBox.Show("Alanlar boş bırakılamaz. Düzenleyip tekrar deneyiniz.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Director director = HelperDirector.GetDirectorById(int.Parse(label3.Text)); director.Name = textBox4.Text; director.Surname = textBox2.Text; var a = HelperDirector.DirectorCUD(director, System.Data.Entity.EntityState.Modified); if (a.Item2) { RefreshTheDatabase(); textBox4.Clear(); textBox2.Clear(); label3.Text = null; groupBox3.Enabled = false; MessageBox.Show("Yönetmen düzenlendi.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Yönetmen düzenlenemedi.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void Button1_Click(object sender, EventArgs e) { if (user.Type == 0) { movie = HelperMovie.GetMovieById(Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value)); label13.Text = movie.MovieId.ToString(); textBox4.Text = movie.Name; comboBox4.Text = HelperCategory.GetCategoryById(movie.CategoryId).Name; comboBox3.Text = HelperDirector.GetDirectorById(movie.DirectorId).Name; textBox6.Text = movie.Minutes.ToString(); byte[] imageBytes = Convert.FromBase64String(movie.Banner); MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length); ms.Write(imageBytes, 0, imageBytes.Length); pictureBox2.Image = Image.FromStream(ms, true); textBox3.Text = movie.Description; groupBox3.Enabled = true; } }
private void FilmDetay_Load(object sender, EventArgs e) { MovieModel movieModel = new MovieModel(); movieModel.MovieId = movie.MovieId; movieModel.Name = movie.Name; movieModel.Category = HelperCategory.GetCategoryById(movie.CategoryId); movieModel.Director = HelperDirector.GetDirectorById(movie.DirectorId); movieModel.Description = movie.Description; movieModel.Banner = movie.Banner; movieModel.Minutes = movie.Minutes; label2.Text = movieModel.Name; label7.Text = movieModel.Category.Name; label8.Text = movieModel.Director.Name + " " + movieModel.Director.Surname; label9.Text = movieModel.Minutes.ToString() + "dk"; label10.Text = movieModel.Description; byte[] imageBytes = Convert.FromBase64String(movie.Banner.ToString()); MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length); ms.Write(imageBytes, 0, imageBytes.Length); pictureBox1.Image = Image.FromStream(ms, true); }