Ejemplo n.º 1
0
        private void btn_hesaplistele_Click(object sender, EventArgs e)
        {
            Hesap hesap = new Hesap();

            hesap.Hesap_Load(sender, e);
            hesap.ShowDialog();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Hesap hesap1 = new Hesap("Can Halfeoğulları", 200);

            Console.WriteLine("Hesap Sahibi: " + hesap1.HesapSahibi);
            Console.WriteLine("Bakiye: {0:n2}₺", hesap1.Bakiye);
            Console.WriteLine("50 lira para çekelim...");
            hesap1.ParaCek(50);
            Console.WriteLine("Bakiye: {0:n2}₺", hesap1.Bakiye);

            Console.ReadKey();
        }
Ejemplo n.º 3
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);
         }
     }
 }
Ejemplo n.º 4
0
        public void button1_Click(object sender, EventArgs e)// hesap bilgisi butonu
        {
            Baglanti t = new Baglanti();

            if (txt_musterino.Text == "")
            {
                MessageBox.Show("Lütfen Hesap Bilgilerini Görmek İstediğiniz Müşteri Numarasını Giriniz");
            }
            else
            {
                Hesap hesap = new Hesap();

                if (musteriNoKontrol())
                {
                    if (hesapNoCek() != null)
                    {
                        hesap.txt_musterino.Text     = txt_musterino.Text;
                        hesap.txt_musterino.ReadOnly = true;
                        if (hesapSayısıKontrol() == true)
                        {
                            hesap.txt_hesapno.ReadOnly = true;
                            hesap.txt_iban.ReadOnly    = true;
                            hesap.txt_hesapno.Text     = hesapNoCek();
                            hesap.txt_iban.Text        = ibanNoCek();
                            hesap.btn_ekle.Visible     = false;
                            hesap.ShowDialog();
                        }
                        else
                        {
                            hesap.txt_hesapno.ReadOnly = false;
                            hesap.txt_iban.ReadOnly    = false;
                            hesap.txt_hesapno.Text     = "";
                            hesap.txt_iban.Text        = "";
                            hesap.btn_ekle.Visible     = false;
                            hesap.ShowDialog();
                        }
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private void btn_git_Click(object sender, EventArgs e)
        {
            Baglanti t     = new Baglanti();
            Hesap    hesap = new Hesap();
            Form1    form1 = new Form1();

            hesap.txt_musterino.Text = txt_musterino.Text;
            form1.txt_musterino.Text = txt_musterino.Text;
            if (txt_musterino.Text != "")
            {
                if (hesap.musteriNoKontrol())
                {
                    if (form1.hesapSayısıKontrol() == true)
                    {
                        form1.txt_musterino.Text     = txt_musterino.Text;
                        hesap.txt_hesapno.Text       = form1.hesapNoCek();
                        hesap.txt_iban.Text          = form1.ibanNoCek();
                        hesap.txt_musterino.ReadOnly = true;
                        hesap.txt_hesapno.ReadOnly   = true;
                        hesap.txt_iban.ReadOnly      = true;
                        hesap.Hesap_Load(sender, e);
                        hesap.ShowDialog();
                    }
                    else
                    {
                        form1.txt_musterino.Text     = txt_musterino.Text;
                        hesap.txt_musterino.ReadOnly = true;
                        hesap.txt_hesapno.Text       = "";
                        hesap.txt_iban.Text          = "";
                        hesap.Hesap_Load(sender, e);
                        hesap.ShowDialog();
                    }
                }
            }
            else
            {
                MessageBox.Show("Lütfen Müşteri Numarası Giriniz");
            }
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
 private void button1_Click(object sender, EventArgs e)// hesap bilgisi butonu
 {
     if (txt_musterino.Text == "")
     {
         MessageBox.Show("Lütfen Hesap Bilgilerini Görmek İstediğiniz Müşteri Numarasını Giriniz");
     }
     else
     {
         Hesap hesap = new Hesap();
         hesap.txt_musterino.Text     = txt_musterino.Text;
         hesap.txt_musterino.ReadOnly = true;
         hesap.txt_hesapno.Text       = hesapNoCek();
         hesap.txt_iban.Text          = ibanNoCek();
         hesap.txt_hesapno.ReadOnly   = true;
         hesap.txt_iban.ReadOnly      = true;
         hesap.btn_ekle.Visible       = false;
         NpgsqlCommand    hbilgi = new NpgsqlCommand("Select * from hesap where musteri_no='" + txt_musterino.Text + "'", t.getBaglanti());
         NpgsqlDataReader dr     = hbilgi.ExecuteReader();
         DataTable        dt     = new DataTable();
         dt.Load(dr);
         hesap.ShowDialog();
         hesap.dataGridView1.DataSource = dt;
     }
 }