Exemplo n.º 1
0
        private void giris_yap_Click(object sender, EventArgs e)
        {
            user     = kullaniciaditxt.Text;
            password = sifretxt.Text;

            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();

            SqlCommand cmd = new SqlCommand();

            cmd.Connection = baglantı.conn;

            cmd.CommandText = "SELECT * FROM Kasiyer_Bilgileri where KullaniciAdi='" + kullaniciaditxt.Text + "' AND Sifre='" + sifretxt.Text + "'";
            dr = cmd.ExecuteReader();

            if (dr.Read())
            {
                FrmAnasayfa giris = new FrmAnasayfa();
                giris.Show();
            }
            else
            {
                MessageBox.Show("Kullanıcı adı veya şifre yanlış");
            }
            baglantı.conn.Close();
        }
        private void film_güncelle_Click(object sender, EventArgs e)
        {
            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();
            string sorgu = "UPDATE Film_Bilgileri SET FilmAdi=@FilmAdi,Yonetmen=@Yonetmen,FilmTuru=@FilmTuru,FilmSuresi=@FilmSuresi,tarih=@tarih,YapimYili=@YapimYili,Resim=@Resim where FilmAdi=@FilmAdi";

            komut = new SqlCommand(sorgu, baglantı.conn);
            try
            {
                komut.Parameters.AddWithValue("@FilmAdi", filmaditxt.Text);
                komut.Parameters.AddWithValue("@Yonetmen", yonetmentxt.Text);
                komut.Parameters.AddWithValue("@FilmTuru", filmturutxt.Text);
                komut.Parameters.AddWithValue("@FilmSuresi", filmsuresitxt.Text);
                komut.Parameters.AddWithValue("@tarih", dateTimePicker1.Value);
                komut.Parameters.AddWithValue("@YapimYili", yapimyılıtxt.Text);
                komut.Parameters.AddWithValue("@Resim", resimtxt.Text);
                MessageBox.Show("Film Başarıyla Güncellendi");
            }
            catch (Exception hata)
            {
                MessageBox.Show("Kayıt Eklenemedi" + hata.Message, "Uyarı");
            }
            komut.ExecuteNonQuery();
            baglantı.conn.Close();
            Film_Listele();
        }
Exemplo n.º 3
0
        private void Film_Seansı_Getir()
        {
            comboFilmSeansı.Text = "";
            comboFilmSeansı.Items.Clear();


            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();

            SqlCommand    komut = new SqlCommand("select *from seans_bilgileri where FilmAdi='" + comboFilmAdi.SelectedItem + "' and SalonAdi='" + comboSalonAdi.SelectedItem + "' and Tarih='" + comboFilmTarihi.SelectedItem + "'", baglantı.conn);
            SqlDataReader read  = komut.ExecuteReader();

            while (read.Read())
            {
                if (DateTime.Parse(read["Tarih"].ToString()) == DateTime.Parse(DateTime.Now.ToShortDateString()))
                {
                    if (DateTime.Parse(read["Seans"].ToString()) > DateTime.Parse(DateTime.Now.ToShortTimeString()))
                    {
                        comboFilmSeansı.Items.Add(read["Seans"].ToString());
                    }
                }
                else if (DateTime.Parse(read["Tarih"].ToString()) > DateTime.Parse(DateTime.Now.ToShortDateString()))
                {
                    comboFilmSeansı.Items.Add(read["Seans"].ToString());
                }
            }
            baglantı.conn.Close();
        }
        private void SeansListesi(string sql)
        {
            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();
            SqlDataAdapter adtr = new SqlDataAdapter(sql, baglantı.conn);

            adtr.Fill(tablo);
            dataGridView1.DataSource = tablo;
            baglantı.conn.Close();
        }
        private void Film_Listele()
        {
            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();
            da = new SqlDataAdapter("SELECT *FROM Film_Bilgileri", baglantı.conn);
            DataTable tablo = new DataTable();

            da.Fill(tablo);
            dataGridView1.DataSource = tablo;
            baglantı.conn.Close();
        }
        private void film_sil_Click(object sender, EventArgs e)
        {
            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();
            string sorgu = "DELETE FROM Film_Bilgileri WHERE FilmAdi=@FilmAdi";

            komut = new SqlCommand(sorgu, baglantı.conn);
            komut.Parameters.AddWithValue("@FilmAdi", filmaditxt.Text);
            komut.ExecuteNonQuery();
            baglantı.conn.Close();
            Film_Listele();
        }
        private void salon_sil_Click(object sender, EventArgs e)
        {
            string sorgu = "DELETE FROM Salon_Bilgileri WHERE SalonAdi=@SalonAdi";

            komut = new SqlCommand(sorgu, baglantı.conn);
            komut.Parameters.AddWithValue("@SalonAdi", salonaditxt.Text);
            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();
            komut.ExecuteNonQuery();
            baglantı.conn.Close();
            Salon_Listele();
        }
Exemplo n.º 8
0
        private void FilmVeSalonGoster(ComboBox combo, string sql, string sql2)
        {
            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();
            SqlCommand    komut = new SqlCommand(sql, baglantı.conn);
            SqlDataReader read  = komut.ExecuteReader();

            while (read.Read() == true)
            {
                combo.Items.Add(read[sql2].ToString());
            }
            baglantı.conn.Close();
        }
        private void seans_sil_Click(object sender, EventArgs e)
        {
            string sorgu = "DELETE FROM Seans_Bilgileri WHERE SeansId=@SeansId";

            komut = new SqlCommand(sorgu, baglantı.conn);
            komut.Parameters.AddWithValue("@SeansId", seansid.Text);
            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();
            komut.ExecuteNonQuery();
            baglantı.conn.Close();
            tablo.Clear();
            SeansListesi("select *from Seans_bilgileri");
        }
Exemplo n.º 10
0
        private void FilmAfişiGoster()
        {
            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();
            SqlCommand    komut = new SqlCommand("Select *from film_bilgileri where FilmAdi='" + comboFilmAdi.SelectedItem + "'", baglantı.conn);
            SqlDataReader read  = komut.ExecuteReader();

            while (read.Read())
            {
                pictureBox1.ImageLocation = read["Resim"].ToString();
            }
            baglantı.conn.Close();
        }
Exemplo n.º 11
0
        private void Tarihi_karsilastir()
        {
            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();
            SqlCommand    komut = new SqlCommand("select * from Seans_bilgileri where SalonAdi='" + comboSalon.Text + "'and Tarih='" + dateTimePicker1.Text + "'", baglantı.conn);
            SqlDataReader read  = komut.ExecuteReader();

            while (read.Read() == true)
            {
                foreach (Control item2 in groupBox2.Controls)
                {
                    if (read["Seans"].ToString() == item2.Text)
                    {
                        item2.Enabled = false;
                    }
                }
            }
            baglantı.conn.Close();
        }
        private void salon_güncelle_Click(object sender, EventArgs e)
        {
            string     salonAdiEski = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            SqlCommand komut        = new SqlCommand("UPDATE Salon_Bilgileri SET SalonAdi=@SalonAdi where SalonAdi=@SalonAdiEski", baglantı.conn);

            try
            {
                komut.Parameters.AddWithValue("@SalonAdi", salonaditxt.Text);
                komut.Parameters.AddWithValue("@SalonAdiEski", salonAdiEski);
            }
            catch (Exception hata)
            {
                MessageBox.Show("Uyarı" + hata.Message);
            }

            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();

            komut.ExecuteNonQuery();
            baglantı.conn.Close();
            MessageBox.Show("Salon Bilgileri Güncellendi");
            Salon_Listele();
        }
Exemplo n.º 13
0
        private void Veritabanı_Dolu_Koltuklar()
        {
            baglantı yeniBaglantı = new baglantı();

            yeniBaglantı.a1();

            SqlCommand    komut = new SqlCommand("select *from Satis_Bilgileri where FilmAdi='" + comboFilmAdi.SelectedItem + "' and SalonAdi='" + comboSalonAdi.SelectedItem + "' and Tarih='" + comboFilmTarihi.SelectedItem + "' and Saat='" + comboFilmSeansı.SelectedItem + " '", baglantı.conn);
            SqlDataReader read  = komut.ExecuteReader();

            while (read.Read())
            {
                foreach (Control item in panel1.Controls)
                {
                    if (item is Button)
                    {
                        if (read["KoltukNO"].ToString() == item.Text)
                        {
                            item.BackColor = Color.Red;
                        }
                    }
                }
            }
            baglantı.conn.Close();
        }