private void MusteriKategori_Load(object sender, EventArgs e)
        {
            FbConnection baglanti = new FbConnection(fk.Baglanti_Kodu());

            baglanti.Open();

            FbDataAdapter ad    = new FbDataAdapter("select * from Musteri_kategori", baglanti);
            FbCommand     ad2   = new FbCommand("select * from Musteri_kategori", baglanti);
            object        sonuc = ad2.ExecuteScalar();

            if (sonuc != null)
            {
                DataTable dt = new DataTable();
                ad.Fill(dt);
                dataGridView1.DataSource = dt;
            }
            else
            {
                MessageBox.Show("Müşteri kategorisi ekleyin", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                MusteriKategoriEkle mke = new MusteriKategoriEkle();
                mke.ShowDialog();
                this.Close();
            }
            baglanti.Close();
        }
示例#2
0
        private void MusteriEkle_Load(object sender, EventArgs e)
        {
            try
            {
                ToolTip Aciklama = new ToolTip();
                Aciklama.SetToolTip(katekle, "Müşteri Kategorisi Ekle");
                FbConnection komut_baglan = new FbConnection(fk.Baglanti_Kodu());
                FbDataReader oku;
                FbCommand    cmd = new FbCommand();

                object sonuc;

                komut_baglan.Open();
                cmd.Connection  = komut_baglan;
                cmd.CommandText = "SELECT * FROM Musteri_kategori";
                sonuc           = cmd.ExecuteScalar();
                if (sonuc != null)
                {
                    oku = cmd.ExecuteReader();

                    while (oku.Read())
                    {
                        Musteri_kategori.Items.Add(oku[1].ToString());
                    }

                    Musteri_kategori.SelectedIndex = 0;
                    oku.Close();
                    Musteri_kategori.Enabled = true;
                    ButonEkle.Enabled        = true;
                }
                else
                {
                    Musteri_kategori.Enabled = false;
                    ButonEkle.Enabled        = false;
                    MessageBox.Show("Müşteri kategorisi bulunamadı, müşteri kategorisi ekleyiniz", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                    MusteriKategoriEkle mke = new MusteriKategoriEkle();
                    mke.ShowDialog();
                }
                komut_baglan.Close();
            }
            catch (Exception me1)
            {
                MessageBox.Show(me1.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#3
0
        private void MusteriGuncelle2_Load(object sender, EventArgs e)
        {
            ToolTip Aciklama = new ToolTip();

            Aciklama.SetToolTip(katekle, "Müşteri Kategorisi Ekle");
            // Bağlantı //
            FbConnection baglanti = new FbConnection(fk.Baglanti_Kodu());
            // Bağlantı //

            // Kategorileri çek //
            FbDataReader KategoriGetir;
            FbCommand    KategoriSorgu = new FbCommand("SELECT * FROM Musteri_kategori", baglanti);

            baglanti.Open();
            Musteri_kategori.Items.Clear();
            object Kssor = KategoriSorgu.ExecuteScalar();

            if (Kssor != null)
            {
                KategoriGetir = KategoriSorgu.ExecuteReader();
                while (KategoriGetir.Read())
                {
                    Musteri_kategori.Items.Add(KategoriGetir["Kategori_adi"].ToString());
                }
            }
            else
            {
                MessageBox.Show("Müşteri kategorisi ekleyiniz", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                MusteriKategoriEkle mke = new MusteriKategoriEkle();
                this.Close();
                mke.ShowDialog();
            }
            baglanti.Close();

            // Kategorileri çek //
        }
示例#4
0
        private void katekle_Click(object sender, EventArgs e)
        {
            MusteriKategoriEkle mke = new MusteriKategoriEkle();

            mke.Show();
        }
        private void yeniEkleToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            MusteriKategoriEkle mke = new MusteriKategoriEkle();

            mke.ShowDialog();
        }