Exemple #1
0
 void KurumAdlarınıGruplaraEkleme()
 {
     if (comboBox1.Text == "")
     {
         MessageBox.Show("Grup Adı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else if (comboBox4.Text == "")
     {
         MessageBox.Show("Kurum Adı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else
     {
         using (MySqlConnection connn = BaglantiKatmanı.baglan())
         {
             MySqlCommand komut = new MySqlCommand("update kurumlar set GrupID=@GrupID where KurumAdi= '" + comboBox4.Text + "'");
             komut.Parameters.AddWithValue("@GrupID", Grupid);
             komut.Connection = connn;
             komut.ExecuteNonQuery();
             MessageBox.Show("Kayıt İşlemi Başarılı!", "Başarılı ! ", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             connn.Close();
         }
     }
 }
        private void kullaniciListele()
        {
            DataTable        table = new DataTable();
            MySqlConnection  conn  = BaglantiKatmanı.baglan();
            MySqlDataAdapter adptr = new MySqlDataAdapter("select * from kullanicilar ", conn);

            adptr.Fill(table);
            conn.Close();
            adptr.Dispose();
            dataGridView1.DataSource = table;
        }
Exemple #3
0
        void VeritabanıGrupİdÇekme()
        {
            MySqlConnection conn  = BaglantiKatmanı.baglan();
            MySqlCommand    komut = new MySqlCommand("Select GrupID from gruplar where GrupAdi = '" + comboBox1.SelectedItem.ToString() + "'", conn);
            MySqlDataReader dr    = komut.ExecuteReader();

            if (dr.Read())
            {
                Grupid = Convert.ToInt32(dr[0]);
                conn.Close();
                dr.Close();
                conn.Dispose();
            }
        }
Exemple #4
0
        //////////////////// Veritabanı İşlemleri //////////////////////////////////////////////
        async void VeritabanıVeriCekmeİslemleri()
        {
            await Task.Run(() =>
            {
                MySqlConnection conn = BaglantiKatmanı.baglan();
                MySqlCommand komut   = new MySqlCommand();
                komut.CommandText    = "SELECT * FROM kurumlar ORDER BY KurumAdi";
                komut.Connection     = conn;
                komut.CommandType    = CommandType.Text;


                MySqlDataReader dr;
                dr = komut.ExecuteReader();

                while (dr.Read())
                {
                    KurumAdınaGöreAraComboBax.Items.Add(dr["KurumAdi"]);
                    comboBox4.Items.Add(dr["KurumAdi"]);
                    Invoke((Action)(() =>
                    {
                        KurumAdınaGöreAraComboBax.AutoCompleteSource = AutoCompleteSource.ListItems;
                        KurumAdınaGöreAraComboBax.AutoCompleteMode = AutoCompleteMode.Suggest;
                        comboBox4.AutoCompleteSource = AutoCompleteSource.ListItems;
                        comboBox4.AutoCompleteMode = AutoCompleteMode.Suggest;
                    }));
                }
                conn.Close();

                conn.Open();

                komut.CommandText = "SELECT * FROM gruplar ORDER BY GrupAdi";
                komut.Connection  = conn;
                komut.CommandType = CommandType.Text;
                dr = komut.ExecuteReader();
                while (dr.Read())
                {
                    comboBox1.Items.Add(dr["GrupAdi"]);
                    GrupAdınaGöreAraComboBax.Items.Add(dr["GrupAdi"]);
                    Invoke((Action)(() =>
                    {
                        GrupAdınaGöreAraComboBax.AutoCompleteSource = AutoCompleteSource.ListItems;
                        GrupAdınaGöreAraComboBax.AutoCompleteMode = AutoCompleteMode.Suggest;
                        comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;
                        comboBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
                    }));
                }
                conn.Close();
            });
        }
 private void KullanıcıGirisi_Load(object sender, EventArgs e)
 {
     if (WebRequestTest())
     {
         // Bağlantı varsa hiçbir işlem yapmıyorum .
         BaglantiKatmanı.baglan();
     }
     else
     {
         label5.Text      = "Internet Bağlantınızda Sorun Oluştu" + Environment.NewLine + "Lütfen Tekrar Deneyiniz";
         label5.Visible   = true;
         label5.ForeColor = Color.Red;
         button3.Enabled  = false;
     }
 }
Exemple #6
0
        void VeritabanıGrupEkleme()
        {
            if (textBox5.Text == "")
            {
                MessageBox.Show("Grup Adı Boş Bırakılamaz", "Bilgilendirme Penceresi");
                return;
            }

            else
            {
                MySqlConnection conn  = BaglantiKatmanı.baglan();
                MySqlCommand    komut = new MySqlCommand("Select GrupAdi from gruplar where GrupAdi = '" + textBox5.Text + "'");
                komut.Connection = conn;
                MySqlDataReader dr = komut.ExecuteReader();
                if (dr.Read())
                {
                    MessageBox.Show("Grup Adı sistemde  mevcut kontrol ediniz.", "UYARI! ");
                    conn.Close();
                    dr.Close();
                    conn.Dispose();
                }
                else
                {
                    MySqlConnection conn2 = BaglantiKatmanı.baglan();

                    MySqlCommand komut2 = new MySqlCommand("insert into gruplar (GrupAdi) values (@GrupAdi)", conn2);
                    komut2.Parameters.Clear();
                    komut2.Parameters.AddWithValue("@GrupAdi", textBox5.Text);

                    komut2.ExecuteNonQuery();
                    conn2.Close();
                    if (GrupAdınaGöreAraComboBax.Items.IndexOf(textBox5.Text) != -1)
                    {
                        MessageBox.Show("Eklemek İstediğiniz Grup Adı Zaten Mevcut");
                    }
                    else if (comboBox1.Items.IndexOf(textBox5.Text) != -1)
                    {
                        MessageBox.Show("Eklemek İstediğiniz Grup Adı Zaten Mevcut");
                    }
                    else
                    {
                        GrupAdınaGöreAraComboBax.Items.Add(textBox5.Text);
                        comboBox1.Items.Add(textBox5.Text);
                        MessageBox.Show("Kayıt İşlemi Tamamlandı!", "Bilgilendirme Penceresi");
                    }
                }
            }
        }
Exemple #7
0
        void KurumBilgileriÇekme()
        {
            using (MySqlConnection baglanti = BaglantiKatmanı.baglan())
            {
                MySqlCommand komut = new MySqlCommand();
                komut.CommandText = "SELECT * FROM kurumlar where KurumAdi = '" + GrupAdınaGöreAraComboBax2.Text + "' or KurumAdi = '" + KurumAdınaGöreAraComboBax.Text + "' ";
                komut.Connection  = baglanti;
                komut.CommandType = CommandType.Text;

                MySqlDataReader dr;
                dr = komut.ExecuteReader();
                while (dr.Read())
                {
                    KurumAdıtext.Text = dr["KurumAdi"].ToString();
                    AdresText.Text    = dr["KurumAdres"].ToString();
                    İlText.Text       = dr["Kurum_il"].ToString();
                    İlceText.Text     = dr["Kurum_ilce"].ToString();
                }
                baglanti.Close();
            }
        }
Exemple #8
0
        void GrupAdınaGöreAramaYapma()
        {
            GrupAdınaGöreAraComboBax2.Items.Clear();
            GrupAdınaGöreAraComboBax2.Text = string.Empty;
            using (MySqlConnection baglanti = BaglantiKatmanı.baglan())
            {
                MySqlCommand komut = new MySqlCommand();
                komut.CommandText = "SELECT * FROM kurumlar where GrupID = (select GrupID from gruplar where GrupAdi = '" + GrupAdınaGöreAraComboBax.Text + "') ";
                komut.Connection  = baglanti;
                komut.CommandType = CommandType.Text;

                MySqlDataReader dr;
                dr = komut.ExecuteReader();
                while (dr.Read())
                {
                    GrupAdınaGöreAraComboBax2.Items.Add(dr["KurumAdi"]);
                    GrupAdınaGöreAraComboBax2.Visible = true;
                }
                baglanti.Close();
            }
        }
Exemple #9
0
 void KurumBilgileriGüncelle()
 {
     if (KurumAdıtext.Text == "")
     {
         MessageBox.Show("Kurum Adı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else if (AdresText.Text == "")
     {
         MessageBox.Show("Adres Alanı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else if (İlceText.Text == "")
     {
         MessageBox.Show("İlçe Alanı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else if (İlText.Text == "")
     {
         MessageBox.Show("İl Alanı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else
     {
         using (MySqlConnection connn = BaglantiKatmanı.baglan())
         {
             MySqlCommand komut = new MySqlCommand("update kurumlar set KurumAdres = @KurumAdres , KurumAdi = @KurumAdi , Kurum_il = @Kurum_il, Kurum_ilce = @Kurum_ilce where KurumAdi= '" + KurumAdıtext.Text + "'");
             komut.Parameters.AddWithValue("@KurumAdi", KurumAdıtext.Text);
             komut.Parameters.AddWithValue("@KurumAdres", AdresText.Text);
             komut.Parameters.AddWithValue("@Kurum_il", İlText.Text);
             komut.Parameters.AddWithValue("@Kurum_ilce", İlceText.Text);
             komut.Connection = connn;
             komut.ExecuteNonQuery();
             MessageBox.Show("Bilgiler Başarıyla Güncellendi!", "Başarılı ! ", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             connn.Close();
             checkBox5.Enabled = true;
             checkBox5.Checked = false;
         }
     }
 }
        private void kullaniciGuncelle()
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Ad Soyad Boş Bırakılamaz", "Bilgilendirme Penceresi");
                return;
            }
            else if (textBox2.Text == "")
            {
                MessageBox.Show("Kullanıcı Adı Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
                return;
            }
            else if (textBox3.Text == "")
            {
                MessageBox.Show("Şifre Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
                return;
            }
            else if (comboBox1.Text == "")
            {
                MessageBox.Show("Yetki Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
                return;
            }
            else
            {
                using (MySqlConnection conn = BaglantiKatmanı.baglan())
                {
                    MySqlCommand komut = new MySqlCommand("update kullanicilar set k_adsoyad=@kullaniciAdSoyad, kullanici_ad=@kullaniciAd, kullanici_sifre=@kullaniciSifre, yetki=@kullaniciYetki where kullaniciID='" + dataGridView1.SelectedRows[0].Cells[0].Value + "'", conn);
                    komut.Parameters.AddWithValue("@kullaniciAdSoyad", textBox1.Text);
                    komut.Parameters.AddWithValue("@kullaniciAd", textBox2.Text);
                    komut.Parameters.AddWithValue("@kullaniciSifre", textBox3.Text);
                    komut.Parameters.AddWithValue("@kullaniciYetki", comboBox1.Text);

                    komut.ExecuteNonQuery();
                    conn.Close();
                    kullaniciListele();
                    MessageBox.Show("Güncelleme işlemi başarılı oldu", "Başarılı!");
                }
            }
        }
 private void button3_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == "")
     {
         label5.Visible   = true;
         label5.Text      = "Kullanıcı Adı kısmını boş bırakmayınız";
         label5.ForeColor = Color.Red;
     }
     else if (textBox2.Text == "")
     {
         label5.Visible   = true;
         label5.Text      = "Şifre kısmını boş bırakmayınız";
         label5.ForeColor = Color.Red;
     }
     else
     {
         MySqlConnection conn  = BaglantiKatmanı.baglan();
         MySqlCommand    komut = new MySqlCommand("Select * from kullanicilar where kullanici_ad = '" + textBox1.Text + "' AND kullanici_sifre = '" + textBox2.Text + "' ", conn);
         MySqlDataReader dr    = komut.ExecuteReader();
         if (dr.Read())
         {
             k_adisoyadi = dr[1].ToString();
             yetki       = dr[4].ToString();
             Ana_Ekran frm = new Ana_Ekran();
             frm.Show();
             this.Hide();
             conn.Close();
             dr.Close();
             conn.Dispose();
         }
         else
         {
             label5.Visible   = true;
             label5.Text      = "Kullanıcı Adı veya Şifre Yanlış!!";
             label5.ForeColor = Color.Red;
         }
     }
 }
 private void kullaniciSil()
 {
     if (textBox1.Text == "")
     {
         MessageBox.Show("Ad Soyad Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else if (textBox2.Text == "")
     {
         MessageBox.Show("Kullanıcı Adı Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else if (textBox3.Text == "")
     {
         MessageBox.Show("Şifre Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else if (comboBox1.Text == "")
     {
         MessageBox.Show("Yetki Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else
     {
         DialogResult result = MessageBox.Show("Silmek istediğinize emin misiniz ?", "Uyarı!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (result == DialogResult.Yes)
         {
             using (MySqlConnection conn = BaglantiKatmanı.baglan())
             {
                 MySqlCommand komut = new MySqlCommand("delete from kullanicilar where kullaniciID='" + dataGridView1.SelectedRows[0].Cells[0].Value + "' ", conn);
                 komut.ExecuteNonQuery();
                 conn.Close();
                 kullaniciListele();
                 MessageBox.Show("Silme işlemi başarılı oldu", "Başarılı!");
             }
         }
     }
 }
 private void button3_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == "")
     {
         MessageBox.Show("Ad Soyad Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else if (textBox2.Text == "")
     {
         MessageBox.Show("Kullanıcı Adı Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else if (textBox3.Text == "")
     {
         MessageBox.Show("Şifre Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else if (comboBox1.Text == "")
     {
         MessageBox.Show("Yetki Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
         return;
     }
     else
     {
         MySqlConnection conn2  = BaglantiKatmanı.baglan();
         MySqlCommand    komut2 = new MySqlCommand("insert into kullanicilar (k_adsoyad,kullanici_ad,kullanici_sifre,yetki) values (@k_adsoyad,@kullanici_ad,@kullanici_sifre,@yetki)", conn2);
         komut2.Parameters.Clear();
         komut2.Parameters.AddWithValue("@k_adsoyad", textBox1.Text);
         komut2.Parameters.AddWithValue("@kullanici_ad", textBox2.Text);
         komut2.Parameters.AddWithValue("@kullanici_sifre", textBox3.Text);
         komut2.Parameters.AddWithValue("@yetki", comboBox1.Text);
         komut2.ExecuteNonQuery();
         conn2.Close();
         MessageBox.Show("Kullanici Başarıyla Kaydedildi", "Başarılı");
     }
 }
Exemple #14
0
        void VeritabanıKurumEkleme()
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Kurum Adı Boş Bırakılamaz", "Bilgilendirme Penceresi");
                return;
            }
            else if (textBox2.Text == "")
            {
                MessageBox.Show("Adres Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
                return;
            }
            else if (textBox3.Text == "")
            {
                MessageBox.Show("İl Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
                return;
            }
            else if (textBox4.Text == "")
            {
                MessageBox.Show("İlçe Kısmı Boş Bırakılamaz", "Bilgilendirme Penceresi");
                return;
            }
            else
            {
                MySqlConnection conn  = BaglantiKatmanı.baglan();
                MySqlCommand    komut = new MySqlCommand("Select KurumAdi from kurumlar where KurumAdi = '" + textBox1.Text + "'", conn);
                MySqlDataReader dr    = komut.ExecuteReader();

                if (dr.Read())
                {
                    MessageBox.Show("Kurum Adı sistemde  mevcut kontrol ediniz.", "UYARI! ");
                    conn.Close();
                    dr.Close();
                    conn.Dispose();
                }
                else
                {
                    MySqlConnection conn2  = BaglantiKatmanı.baglan();
                    MySqlCommand    komut2 = new MySqlCommand("insert into kurumlar (KurumAdi,KurumAdres,Kurum_il,Kurum_ilce) values (@KurumAdi,@KurumAdres,@Kurum_il,@Kurum_ilce)", conn2);
                    komut2.Parameters.Clear();
                    komut2.Parameters.AddWithValue("@KurumAdi", textBox1.Text);
                    komut2.Parameters.AddWithValue("@KurumAdres", textBox2.Text);
                    komut2.Parameters.AddWithValue("@Kurum_il", textBox3.Text);
                    komut2.Parameters.AddWithValue("@Kurum_ilce", textBox4.Text);

                    komut2.ExecuteNonQuery();
                    conn2.Close();
                    if (comboBox4.Items.IndexOf(textBox1.Text) != -1)
                    {
                        MessageBox.Show("Eklemek İstediğiniz Kurum Adı Zaten Mevcut");
                    }
                    else if (KurumAdınaGöreAraComboBax.Items.IndexOf(textBox1.Text) != -1)
                    {
                        MessageBox.Show("Eklemek İstediğiniz Kurum Adı Zaten Mevcut");
                    }
                    else
                    {
                        comboBox4.Items.Add(textBox1.Text);
                        KurumAdınaGöreAraComboBax.Items.Add(textBox1.Text);
                        MessageBox.Show("Kayıt İşlemi Tamamlandı!", "Bilgilendirme Penceresi");
                    }
                    foreach (Control item in YeniAdresGroupBox.Controls)
                    {
                        if (item is TextBox)
                        {
                            item.Text = String.Empty;
                        }
                    }
                }
            }
        }