Esempio n. 1
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            AnaForm a = (AnaForm)Application.OpenForms["AnaForm"];

            a.acilisDurum = false;
            a.acilisKontrolEt();
            this.Close();
        }
Esempio n. 2
0
        private void simpleButton9_Click(object sender, EventArgs e)
        {
            try
            {
                if (textEdit1.Text != "" && textEdit2.Text != "" && textEdit3.Text != "")
                {
                    baglanti.Open();
                    if (durum == 0)
                    {
                        OleDbCommand komu = new OleDbCommand("INSERT INTO Veresiyeler(CariNo,CariAd,VeresiyeTarih,VeresiyeAciklama,VeresiyeTutar) VALUES(" + cariNo + ",'" + cariAd + "','" + textEdit2.Text + "','" + textEdit1.Text + "','" + textEdit3.Text + "')", baglanti);
                        komu.ExecuteNonQuery();
                    }
                    else
                    {
                        OleDbCommand komu = new OleDbCommand("INSERT INTO Veresiyeler(CariNo,CariAd,VeresiyeTarih,VeresiyeAciklama,VeresiyeTutar) VALUES(" + cariNo + ",'" + cariAd + "','" + textEdit2.Text + "','" + textEdit1.Text + "','-" + textEdit3.Text + "')", baglanti);
                        komu.ExecuteNonQuery();
                    }


                    OleDbCommand    komut2      = new OleDbCommand("Select * From Veresiyeler Where CariNo=" + cariNo, baglanti);
                    OleDbDataReader oku         = komut2.ExecuteReader();
                    double          genelToplam = 0;
                    while (oku.Read())
                    {
                        genelToplam += Convert.ToDouble(oku["VeresiyeTutar"]);
                    }
                    oku.Dispose();
                    OleDbCommand komut3 = new OleDbCommand("UPDATE CariHesap SET CariBakiye=" + genelToplam + " Where CariNo=" + cariNo, baglanti);
                    komut3.ExecuteNonQuery();

                    baglanti.Close();

                    AnaForm ana = (AnaForm)Application.OpenForms["AnaForm"];
                    ana.musteriHesabiGetir();
                    this.Close();
                }
                else
                {
                    MesajKutusu m = new MesajKutusu();
                    m.labelControl1.Text   = "Lütfen tüm bilgileri doldurunuz.";
                    m.pictureEdit1.Visible = true;
                    m.ShowDialog();
                }
            }
            catch (Exception hata)
            {
                baglanti.Close();
                MessageBox.Show(hata.Message);
            }
        }
Esempio n. 3
0
 private void simpleButton15_Click(object sender, EventArgs e)
 {
     if (kullaniciAd == textEdit1.Text && kullaniciSifre == textEdit2.Text)
     {
         AnaForm a = (AnaForm)Application.OpenForms["AnaForm"];
         a.acilisDurum = true;
         a.acilisKontrolEt();
         this.Close();
     }
     else
     {
         MesajKutusu m = new MesajKutusu();
         m.labelControl1.Text   = "Kullanıcı adı veya parola hatalı!";
         m.pictureEdit1.Visible = true;
         m.ShowDialog();
     }
 }