Exemplo n.º 1
0
 private void btnGeri_Click(object sender, EventArgs e)
 {
     this.Hide();
     uh              = new uyeHome();
     uh.FormClosing += f1_FormClosing;
     uh.ShowDialog();
 }
Exemplo n.º 2
0
        private void btnSatinAl_Click(object sender, EventArgs e)
        {
            baglanti.Open();
            SqlCommand komut = new SqlCommand("insert into Siparisler (kisiID, kargoNo,fiyat,urunID) values(@kisiID,@kargoNo,@fiyat,@urunID)", baglanti);

            komut.Parameters.AddWithValue("@kisiID", Form1.ID);
            if (cbKargo.Text == "Aras")
            {
                komut.Parameters.AddWithValue("@kargoNo", 1);
            }
            else if (cbKargo.Text == "PttKargo")
            {
                komut.Parameters.AddWithValue("@kargoNo", 2);
            }
            else if (cbKargo.Text == "UpsKargo")
            {
                komut.Parameters.AddWithValue("@kargoNo", 5);
            }
            if (pnlMacera.Visible == true)
            {
                komut.Parameters.AddWithValue("@fiyat", dgvMacera.SelectedRows[0].Cells[3].Value);
                komut.Parameters.AddWithValue("@urunID", dgvMacera.SelectedRows[0].Cells[0].Value);
            }
            else if (panelTarih.Visible == true)
            {
                komut.Parameters.AddWithValue("@fiyat", dgvTarih.SelectedRows[0].Cells[3].Value);
                komut.Parameters.AddWithValue("@urunID", dgvTarih.SelectedRows[0].Cells[0].Value);
            }
            else if (panelRoman.Visible == true)
            {
                komut.Parameters.AddWithValue("@fiyat", dgvRoman.SelectedRows[0].Cells[3].Value);
                komut.Parameters.AddWithValue("@urunID", dgvRoman.SelectedRows[0].Cells[0].Value);
            }

            komut.ExecuteNonQuery();
            MessageBox.Show("Basarili bir sekilde satin aldiniz!");

            uyeHome uyehome = new uyeHome();

            this.Hide();
            uyehome.Show();
        }
Exemplo n.º 3
0
 private void btnGiris_Click(object sender, EventArgs e)
 {
     try
     {
         SqlCommand komut = new SqlCommand("select kisiID, kullaniciAdi, sifre, silindimi from Kisi WHERE kullaniciAdi=@kullaniciAdi and sifre=@sifre", baglanti);
         komut.Parameters.AddWithValue("@kullaniciAdi", txtKullaniciAdi.Text);
         komut.Parameters.AddWithValue("@sifre", txtSifre.Text);
         komut.Connection.Open();
         SqlDataReader rd = komut.ExecuteReader(CommandBehavior.CloseConnection);
         if (rd.HasRows)
         {
             while (rd.Read())
             {
                 if (rd["silindimi"].ToString() == "False")
                 {
                     kullaniciAdi = txtKullaniciAdi.Text;
                     sifre        = txtSifre.Text;
                     ID           = Convert.ToInt32(rd["kisiID"]);
                     uyeHome uyehome = new uyeHome();
                     this.Hide();
                     uyehome.Show();
                 }
                 else
                 {
                     MessageBox.Show("Baba hesap yoktir!");
                 }
             }
         }
         else /// Reader SATIR döndüremiyorsa K.Adı Parola Yanlış Demekdir
         {
             rd.Close();
             MessageBox.Show("Kullanıcı Adı veya Parola Geçersizdir", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     catch
     {
         MessageBox.Show("DB ye ulaşılamadı", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }