Exemple #1
0
        private void button_FilmKaydet_Click(object sender, EventArgs e)
        {
            SINEMAEntities sinema_ctx = new SINEMAEntities();

            Film film1 = new Film();

            film1.FilmAdi         = textBox_FilmAdi.Text;
            film1.FilmKisaBilgi   = textBox_FilmKB.Text;
            film1.FilmFragmanLink = textBox1_Fragman.Text;

            sinema_ctx.Films.Add(film1);
            sinema_ctx.SaveChanges();
            TabloGuncelle();
        }
Exemple #2
0
        private void button_FilmSil_Click(object sender, EventArgs e)
        {
            SINEMAEntities ctx = new SINEMAEntities();

            Film film1 = new Film();

            int ID = Convert.ToInt32(textBox_FilmAdi.Tag);

            film1 = ctx.Films.Find(ID);

            ctx.Films.Remove(film1);
            ctx.SaveChanges();

            TabloGuncelle();
        }
Exemple #3
0
        private void button_FilmGuncelle_Click(object sender, EventArgs e)
        {
            SINEMAEntities ctx = new SINEMAEntities();

            Film film1 = new Film();

            int ID = Convert.ToInt32(textBox_FilmAdi.Tag);

            film1 = ctx.Films.Find(ID);


            film1.FilmAdi         = textBox_FilmAdi.Text;
            film1.FilmKisaBilgi   = textBox_FilmKB.Text;
            film1.FilmFragmanLink = textBox1_Fragman.Text;

            ctx.SaveChanges();
            TabloGuncelle();
        }
Exemple #4
0
        private void TabloGuncelle()
        {
            SINEMAEntities sinema_context = new SINEMAEntities();

            dataGridView1.DataSource = sinema_context.Films.ToList();
        }