Пример #1
0
        public void bakiyeGuncelle()
        {
            t.getBaglanti().Close();
            t = new Baglanti();
            NpgsqlCommand kartBakiyeGuncelle = new NpgsqlCommand("update bankakartı set hesapbakiye=hesapbakiye - '" + Convert.ToInt32(txt_urunfiyati.Text) + "' where kart_no='" + txt_kartno.Text + "'", t.getBaglanti());

            kartBakiyeGuncelle.ExecuteNonQuery();
            NpgsqlCommand hesapBakiyeGuncelle = new NpgsqlCommand(" update hesap set hesapbakiye=hesapbakiye - '" + Convert.ToInt32(txt_urunfiyati.Text) + "' where hesapno=(select hesapno from bankakartı where kart_no='" + txt_kartno.Text + "')", t.getBaglanti());

            hesapBakiyeGuncelle.ExecuteNonQuery();
        }
Пример #2
0
        public bool tcnoKontrol()
        {
            Baglanti         t       = new Baglanti();
            NpgsqlCommand    tcBilgi = new NpgsqlCommand("Select * from musteri where tcno='" + txt_tcno.Text + "'", t.getBaglanti());
            NpgsqlDataReader dr      = tcBilgi.ExecuteReader();

            if (dr.Read())
            {
                return(true);
            }
            else
            {
                if (txt_tcno.Text == "Admin" && txt_sifre.Text == "12345" || txt_tcno.Text == "Admin2" && txt_sifre.Text == "1")
                {
                    YöneticiPanel yöneticiPanel = new YöneticiPanel();
                    yöneticiPanel.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Kullanıcı Adı veya Şifre Yanlış");
                    t.getBaglanti().Close();
                    return(false);
                }
                return(false);
            }
        }
Пример #3
0
        public void KrediKartı_Load(object sender, EventArgs e)
        {
            t = new Baglanti();
            NpgsqlCommand    cmdveri = new NpgsqlCommand("Select * from kredikartı", t.getBaglanti());
            NpgsqlDataReader dr      = cmdveri.ExecuteReader();
            DataTable        dt      = new DataTable();

            dt.Load(dr);
            dataGridView1.DataSource = dt;
        }
Пример #4
0
        public void HesapListele_Load(object sender, EventArgs e)
        {
            Baglanti         t       = new Baglanti();
            NpgsqlCommand    cmdveri = new NpgsqlCommand("Select * from hesap", t.getBaglanti());
            NpgsqlDataReader dr      = cmdveri.ExecuteReader();
            DataTable        dt      = new DataTable();

            dt.Load(dr);
            dataGridView1.DataSource = dt;
        }
Пример #5
0
 public int bakiyeSorgu()
 {
     form1 = new Form1();
     t     = new Baglanti();
     hesap = new Hesap();
     form1.txt_musterino.Text = txt_musterino.Text;
     hesap.txt_musterino.Text = txt_musterino.Text;
     hesap.txt_hesapno.Text   = txt_hesapno.Text;
     if (hesap.hesapSayısıKontrol())
     {
         txt_hesapno.ReadOnly = true;
         txt_hesapno.Text     = form1.hesapNoCek();
         NpgsqlCommand    bakiyeSorgu = new NpgsqlCommand("select hesapbakiye from hesap where musteri_no='" + txt_musterino.Text + "'", t.getBaglanti());
         NpgsqlDataReader dr          = bakiyeSorgu.ExecuteReader();
         dr.Read();
         int bakiye;
         bakiye = dr[0].GetHashCode();
         t.getBaglanti().Close();
         return(bakiye);
     }
     else
     {
         if (txt_hesapno.Text != "")
         {
             NpgsqlCommand    bakiyeSorgu = new NpgsqlCommand("select hesapbakiye from hesap where musteri_no='" + txt_musterino.Text + "' and hesapno='" + txt_hesapno.Text + "'", t.getBaglanti());
             NpgsqlDataReader dr          = bakiyeSorgu.ExecuteReader();
             dr.Read();
             int bakiye;
             bakiye = dr[0].GetHashCode();
             t.getBaglanti().Close();
             return(bakiye);
         }
         else
         {
             MessageBox.Show("Lütfen Hesap Numarası Giriniz");
             btn_newkart.Visible            = true;
             txt_sonkullanmatarihi.ReadOnly = true;
             txt_cvv.ReadOnly = true;
             return(0);
         }
     }
 }
Пример #6
0
        public void Banka_Load(object sender, EventArgs e)
        {
            t = new Baglanti();
            NpgsqlCommand    cmdveri = new NpgsqlCommand("Select * from banka", t.getBaglanti());
            NpgsqlDataReader dr      = cmdveri.ExecuteReader();
            DataTable        dt      = new DataTable();

            dt.Load(dr);
            dataGridView1.DataSource = dt;
            txt_faizorani.Text       = "";
        }
Пример #7
0
        public string MusteriNoCek(string tcno)
        {
            Baglanti         t  = new Baglanti();
            NpgsqlCommand    ad = new NpgsqlCommand("select musteri_no from musteri where tcno='" + tcno + "'", t.getBaglanti());
            NpgsqlDataReader dr = ad.ExecuteReader();

            dr.Read();
            String musterino = dr[0].ToString();

            t.getBaglanti().Close();
            return(musterino);
        }
Пример #8
0
        public string AdCek(string tcno)
        {
            Baglanti         t  = new Baglanti();
            NpgsqlCommand    ad = new NpgsqlCommand("select adi from musteri where tcno='" + tcno + "'", t.getBaglanti());
            NpgsqlDataReader dr = ad.ExecuteReader();

            dr.Read();
            String isim = dr[0].ToString() + ";";

            t.getBaglanti().Close();
            return(isim);
        }
Пример #9
0
        public string hesapNoCek()
        {
            Baglanti         t       = new Baglanti();
            NpgsqlCommand    hesapno = new NpgsqlCommand("select hesapno from hesap where musteri_no='" + txt_musterino.Text + "'", t.getBaglanti());
            NpgsqlDataReader dr      = hesapno.ExecuteReader();

            dr.Read();
            String sonHesapNo = dr[0].ToString();

            t.getBaglanti().Close();
            return(sonHesapNo);
        }
Пример #10
0
        private void Transfer_Load(object sender, EventArgs e)
        {
            t = new Baglanti();


            NpgsqlCommand    cmdveri = new NpgsqlCommand("Select * from havaleft", t.getBaglanti());
            NpgsqlDataReader dr      = cmdveri.ExecuteReader();
            DataTable        dt      = new DataTable();

            dt.Load(dr);
            //dataGridView1.DataSource = dt;
        }
Пример #11
0
        public string SoyAdCek(string musterino)
        {
            Baglanti         t       = new Baglanti();
            NpgsqlCommand    hesapno = new NpgsqlCommand("select soyadi from musteri where musteri_no='" + musterino + "'", t.getBaglanti());
            NpgsqlDataReader dr      = hesapno.ExecuteReader();

            dr.Read();
            String bakiye = dr[0].ToString();

            t.getBaglanti().Close();
            return(bakiye);
        }
Пример #12
0
        public string kartNoUret()
        {
            Baglanti         t       = new Baglanti();
            NpgsqlCommand    hesapno = new NpgsqlCommand("select max(kart_no) from bankakartı", t.getBaglanti());
            NpgsqlDataReader dr      = hesapno.ExecuteReader();

            dr.Read();
            string sonKartno;

            sonKartno = dr[0].ToString();
            char[] dizi = sonKartno.ToCharArray();
            if (dizi[15] == '9')
            {
                dizi[15] = '0';
                if (dizi[14] == '9')
                {
                    dizi[14] = '0';
                    if (dizi[13] == '9')
                    {
                        dizi[13] = '0';
                        if (dizi[12] == '9')
                        {
                            dizi[12] = '0';
                            dizi[11]++;
                        }
                        else
                        {
                            dizi[12]++;
                        }
                    }
                    else
                    {
                        dizi[13]++;
                    }
                }
                else
                {
                    dizi[14]++;
                }
            }
            else
            {
                dizi[15]++;
            }

            string k = new string(dizi);

            t.getBaglanti().Close();
            return(k);
        }
Пример #13
0
        public int he_id_uret()
        {
            Baglanti         t         = new Baglanti();
            NpgsqlCommand    musterino = new NpgsqlCommand("select max(he_id) from havaleft", t.getBaglanti());
            NpgsqlDataReader dr        = musterino.ExecuteReader();

            dr.Read();
            int sonNumara;

            sonNumara = dr[0].GetHashCode();
            sonNumara++;
            t.getBaglanti().Close();
            return(sonNumara);
        }
Пример #14
0
        public void Hesap_Load(object sender, EventArgs e)
        {
            Baglanti         t       = new Baglanti();
            NpgsqlCommand    cmdveri = new NpgsqlCommand("Select * from hesap", t.getBaglanti());
            NpgsqlDataReader dr      = cmdveri.ExecuteReader();
            DataTable        dt      = new DataTable();

            dt.Load(dr);
            dataGridView1.DataSource = dt;
            btn_save.Visible         = false;
            txt_iban.ReadOnly        = true;
            txt_hesapno.ReadOnly     = true;
            txt_tarih.ReadOnly       = true;
            txt_tarih.Text           = DateTime.Now.ToString();
        }
Пример #15
0
        public void BankaKartıBilgileri_Load(object sender, EventArgs e)
        {
            t = new Baglanti();
            btn_save.Visible = false;
            NpgsqlCommand    cmdveri = new NpgsqlCommand("Select * from bankakartı", t.getBaglanti());
            NpgsqlDataReader dr      = cmdveri.ExecuteReader();
            DataTable        dt      = new DataTable();

            dt.Load(dr);
            dataGridView1.DataSource = dt;


            txt_sonkullanmatarihi.ReadOnly = true;
            txt_cvv.ReadOnly    = true;
            txt_bakiye.ReadOnly = true;
        }
Пример #16
0
 public void Guncelle()
 {
     if (txt_faizorani.Text != "")
     {
         NpgsqlCommand guncelle = new NpgsqlCommand("update banka set faiz_oranı='" + txt_faizorani.Text + "' ", t.getBaglanti());
         guncelle.ExecuteNonQuery();
         MessageBox.Show("Faiz Oranı Güncellendi Ve Bütün Müşterilere Bildirim Gönderildi.");
         txt_faizorani.Text = "";
         f.ShowDialog();
     }
     else
     {
         t.getBaglanti().Close();
         MessageBox.Show("Bu Alan Boş Olamaz");
     }
 }
Пример #17
0
        public bool idKontrol()
        {
            Baglanti         t       = new Baglanti();
            NpgsqlCommand    mnBilgi = new NpgsqlCommand("Select * from alısveris where av_id='" + txt_av_id.Text + "'", t.getBaglanti());
            NpgsqlDataReader dr      = mnBilgi.ExecuteReader();

            if (dr.Read())
            {
                return(true);
            }
            else
            {
                MessageBox.Show("Böyle Bir ID Bulunmamaktadır");
                t.getBaglanti().Close();
                return(false);
            }
        }
Пример #18
0
        public bool musteriNoKontrol()
        {
            Baglanti         t       = new Baglanti();
            NpgsqlCommand    mnBilgi = new NpgsqlCommand("Select * from musteri where musteri_no='" + txt_musterino.Text + "'", t.getBaglanti());
            NpgsqlDataReader dr      = mnBilgi.ExecuteReader();

            if (dr.Read())
            {
                return(true);
            }
            else
            {
                MessageBox.Show("Böyle Bir Müşteri Numarası Bulunmamaktadır");
                t.getBaglanti().Close();
                return(false);
            }
        }
Пример #19
0
        public void Alısveris_Load(object sender, EventArgs e)
        {
            t = new Baglanti();
            NpgsqlCommand    cmdveri = new NpgsqlCommand("Select * from alısveris", t.getBaglanti());
            NpgsqlDataReader dr      = cmdveri.ExecuteReader();
            DataTable        dt      = new DataTable();

            dt.Load(dr);
            dataGridView1.DataSource = dt;

            txt_av_id.ReadOnly      = true;
            txt_urunkodu.ReadOnly   = false;
            txt_urunadi.ReadOnly    = false;
            txt_urunfiyati.ReadOnly = false;
            txt_kartno.ReadOnly     = false;
            txt_sktarihi.ReadOnly   = false;
            txt_cvv.ReadOnly        = false;
        }
Пример #20
0
        public string hesapNoCek()
        {
            Baglanti         t       = new Baglanti();
            NpgsqlCommand    hesapno = new NpgsqlCommand("select hesapno from hesap where musteri_no='" + txt_musterino.Text + "'", t.getBaglanti());
            NpgsqlDataReader dr      = hesapno.ExecuteReader();

            dr.Read();
            if (dr.HasRows == false)
            {
                MessageBox.Show("Bu Müşteri Numarasına Tanımlı Hesap Bulunamamaktadır");
                return(null);
            }
            else
            {
                string sonHesapNo = dr[0].ToString();
                t.getBaglanti().Close();
                return(sonHesapNo);
            }
        }
Пример #21
0
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            Baglanti t = new Baglanti();

            t.getBaglanti();
            if (txt_urunkodu.Text != "" && txt_urunadi.Text != "" && txt_urunfiyati.Text != "" && txt_kartno.Text != "" && txt_sktarihi.Text != "" && txt_cvv.Text != "")
            {
                if (bakiyeKontrol() == true)
                {
                    if (cvvCek() == txt_cvv.Text && bankaKartSKTCek() == txt_sktarihi.Text)
                    {
                        NpgsqlCommand cmdekle = new NpgsqlCommand("insert into alısveris(urunkodu,urunadi,urunfiyati,kart_no,sonkullanmatarihi,cvv) values ('" + txt_urunkodu.Text + "','" + txt_urunadi.Text + "','" + txt_urunfiyati.Text + "','" + txt_kartno.Text + "','" + txt_sktarihi.Text + "','" + txt_cvv.Text + "')", t.getBaglanti());
                        cmdekle.ExecuteNonQuery();
                        MessageBox.Show("Alışveriş Bilgisi Eklendi");
                        bakiyeGuncelle();
                    }
                    else
                    {
                        MessageBox.Show("Girilen CVV veya Son Kullanma Tarihi Hatalı");
                    }
                }
                else
                {
                    MessageBox.Show("Yetersiz Bakiye");
                }
            }
            else
            {
                MessageBox.Show("EKSİK BİLGİ GİRDİNİZ");
            }

            txt_urunkodu.Text   = "";
            txt_urunadi.Text    = "";
            txt_urunfiyati.Text = "";
            txt_kartno.Text     = "";
            txt_sktarihi.Text   = "";
            txt_cvv.Text        = "";
            Alısveris_Load(sender, e);
        }
Пример #22
0
        private void Form1_Load(object sender, EventArgs e)
        {
            t = new Baglanti();
            btn_save.Visible = false;
            btn_ekle.Visible = false;

            NpgsqlCommand    cmdveri = new NpgsqlCommand("Select * from musteri", t.getBaglanti());
            NpgsqlDataReader dr      = cmdveri.ExecuteReader();
            DataTable        dt      = new DataTable();

            dt.Load(dr);
            dataGridView1.DataSource = dt;

            txt_musterino.ReadOnly = false;
            txt_tcno.ReadOnly      = true;
            txt_ad.ReadOnly        = true;
            txt_soyad.ReadOnly     = true;
            txt_telno.ReadOnly     = true;
            txt_email.ReadOnly     = true;
            txt_adres.ReadOnly     = true;
            txt_sifre.ReadOnly     = true;
        }
Пример #23
0
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            Baglanti t = new Baglanti();

            t.getBaglanti();
            if (txt_tcno.Text != "" && txt_ad.Text != "" && txt_soyad.Text != "" && txt_telno.Text != "" && txt_email.Text != "" && txt_adres.Text != "" && txt_sifre.Text != "")
            {
                NpgsqlCommand cmdekle = new NpgsqlCommand("insert into musteri(musteri_no,tcno,adi,soyadi,telno,email,adres,sifre) values ('" + txt_musterino.Text + "','" + txt_tcno.Text + "','" + txt_ad.Text + "','" + txt_soyad.Text + "','" + txt_telno.Text + "','" + txt_email.Text + "','" + txt_adres.Text + "','" + txt_sifre.Text + "')", t.getBaglanti());
                cmdekle.ExecuteNonQuery();
                Hesap hesap = new Hesap();
                hesap.txt_musterino.Text     = txt_musterino.Text;
                hesap.txt_hesapno.Text       = hesap.hesapNoUret();
                hesap.txt_iban.Text          = hesap.ibanUret();
                hesap.txt_iban.ReadOnly      = true;
                hesap.txt_hesapno.ReadOnly   = true;
                hesap.txt_musterino.ReadOnly = true;
                hesap.ShowDialog();
                btn_yenimusteri.Visible = true;
            }
            else
            {
                MessageBox.Show("EKSİK BİLGİ GİRDİNİZ");
                btn_yenimusteri.Visible = true;
            }


            txt_musterino.Text = "";
            txt_tcno.Text      = "";
            txt_ad.Text        = "";
            txt_soyad.Text     = "";
            txt_telno.Text     = "";
            txt_email.Text     = "";
            txt_adres.Text     = "";
            txt_sifre.Text     = "";
            Form1_Load(sender, e);
        }
Пример #24
0
        public void BakiyeUpdate(string musterino, string newbakiye)
        {
            NpgsqlCommand cmdsave = new NpgsqlCommand("update hesap set hesapbakiye='" + newbakiye + "' where musteri_no='" + musterino + "'", t.getBaglanti());

            cmdsave.ExecuteNonQuery();
        }
Пример #25
0
 private void btn_sil_Click(object sender, EventArgs e)
 {
     form1 = new Form1();
     txt_kartno.ReadOnly      = false;
     form1.txt_musterino.Text = txt_musterino.Text;
     if (txt_musterino.Text != "")
     {
         if (!form1.musteriNoKontrol())
         {
             MessageBox.Show("Müşteri Numarası Giriniz");
         }
         else
         {
             if (txt_kartno.Text != "")
             {
                 NpgsqlCommand cmdsil = new NpgsqlCommand("delete from bankakartı where musteri_no='" + txt_musterino.Text + "' and kart_no='" + txt_kartno.Text + "'", t.getBaglanti());
                 cmdsil.ExecuteNonQuery();
                 MessageBox.Show("SİLME İŞLEMİ BAŞARILI");
             }
             else
             {
                 MessageBox.Show("Kart Numarası Giriniz");
             }
         }
     }
     else
     {
         MessageBox.Show("Silmek İstediğiniz Müşteri Numarasını Giriniz");
     }
     txt_musterino.Text         = "";
     txt_hesapno.Text           = "";
     txt_kartno.Text            = "";
     txt_sonkullanmatarihi.Text = "";
     txt_cvv.Text    = "";
     txt_bakiye.Text = "";
     BankaKartıBilgileri_Load(sender, e);
 }
Пример #26
0
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            t     = new Baglanti();
            form1 = new Form1();
            form1.txt_musterino.Text = txt_musterino.Text;
            if (txt_musterino.Text != "" && txt_sonkullanmatarihi.Text != "" && txt_cvv.Text != "" && txt_bakiye.Text != "")
            {
                if (form1.musteriNoKontrol())
                {
                    if (form1.hesapSayısıKontrol() == true)
                    {
                        NpgsqlCommand cmdekle = new NpgsqlCommand("insert into bankakartı(musteri_no,hesapno,kart_no,sonkullanmatarihi,cvv,hesapbakiye) values ('" + txt_musterino.Text + "','" + form1.hesapNoCek() + "','" + kartNoUret() + "','" + txt_sonkullanmatarihi.Text + "','" + txt_cvv.Text + "','" + txt_bakiye.Text + "')", t.getBaglanti());
                        cmdekle.ExecuteNonQuery();
                        btn_ekle.Visible       = false;
                        btn_newkart.Visible    = true;
                        txt_musterino.ReadOnly = false;
                        txt_kartno.ReadOnly    = false;
                        MessageBox.Show("Kart Eklendi");
                    }
                    else
                    {
                        if (txt_hesapno.Text != "")
                        {
                            NpgsqlCommand cmdekle = new NpgsqlCommand("insert into bankakartı(musteri_no,hesapno,kart_no,sonkullanmatarihi,cvv,hesapbakiye) values ('" + txt_musterino.Text + "','" + txt_hesapno.Text + "','" + kartNoUret() + "','" + txt_sonkullanmatarihi.Text + "','" + txt_cvv.Text + "','" + txt_bakiye.Text + "')", t.getBaglanti());
                            cmdekle.ExecuteNonQuery();
                            btn_ekle.Visible       = false;
                            btn_newkart.Visible    = true;
                            txt_musterino.ReadOnly = false;
                            txt_kartno.ReadOnly    = false;
                            MessageBox.Show("Kart Eklendi");
                        }
                        else
                        {
                            MessageBox.Show("Kart Eklemek İstediğiniz Hesap Numarasını Giriniz");
                        }

                        btn_ekle.Visible       = false;
                        btn_newkart.Visible    = true;
                        txt_musterino.ReadOnly = false;
                    }
                }
            }
            else
            {
                MessageBox.Show("EKSİK BİLGİ GİRDİNİZ");
                btn_newkart.Visible    = true;
                txt_musterino.ReadOnly = false;
            }

            txt_musterino.Text         = "";
            txt_hesapno.Text           = "";
            txt_kartno.Text            = "";
            txt_sonkullanmatarihi.Text = "";
            txt_cvv.Text    = "";
            txt_bakiye.Text = "";
            BankaKartıBilgileri_Load(sender, e);
        }
Пример #27
0
        public string krediKullanılanLimit(string musterino)
        {
            Baglanti         t      = new Baglanti();
            NpgsqlCommand    bakiye = new NpgsqlCommand("select kullanılan from kredikartı where kart_no='" + krediKartNoCek(musterino) + "'", t.getBaglanti());
            NpgsqlDataReader dr     = bakiye.ExecuteReader();

            dr.Read();
            String sonBakiye = dr[0].ToString();

            return(sonBakiye);
        }
Пример #28
0
        public bool sifreKontrol()
        {
            Baglanti         t       = new Baglanti();
            NpgsqlCommand    tcBilgi = new NpgsqlCommand("Select sifre from musteri where tcno='" + txt_tcno.Text + "'", t.getBaglanti());
            NpgsqlDataReader dr      = tcBilgi.ExecuteReader();

            dr.Read();
            string sifre = dr[0].ToString();

            if (sifre == txt_sifre.Text)
            {
                return(true);
            }
            else
            {
                MessageBox.Show("Girilen Şifre Yanlış");
                return(false);
            }
        }
Пример #29
0
        public string mesajCek(string musterino)
        {
            Baglanti         t      = new Baglanti();
            NpgsqlCommand    bakiye = new NpgsqlCommand("select mesaj from musteri where musteri_no='" + musterino + "'", t.getBaglanti());
            NpgsqlDataReader dr     = bakiye.ExecuteReader();

            dr.Read();
            String sonBakiye = dr[0].ToString();

            return(sonBakiye);
        }
Пример #30
0
        public string sonOdemeTarihiCek(string musterino)
        {
            Baglanti         t      = new Baglanti();
            NpgsqlCommand    bakiye = new NpgsqlCommand("select sonodemetarihi from fatura where kart_no='" + krediKartNoCek(musterino) + "'", t.getBaglanti());
            NpgsqlDataReader dr     = bakiye.ExecuteReader();

            dr.Read();
            String sonBakiye = dr[0].ToString();

            return(sonBakiye);
        }