Example #1
0
        public void Listele(string komut)
        {
            try
            {
                islemler = new VeritabaniIslemler();
                if (islemler.Al(komut).Rows.Count > 0)
                {
                    MySqlConnection conn = new MySqlConnection(VeritabaniIslemler.ConnectionString());

                    da = new MySqlDataAdapter(komut, conn);
                    ds = new DataSet();

                    //Fill the DataSet.
                    da.Fill(ds, Home.donem);
                    dtSource = ds.Tables[Home.donem];
                    Fill();
                    dataGridView1.Focus();
                }
                else
                {
                    dataGridView1.DataSource = null;
                    dataGridView1.Rows.Clear();
                    dataGridView1.Refresh();
                }
            }
            catch (Exception err)
            {
                MessageBox.Show("Tablo Listelenirken Hata! \nHata Kodu:" + err, "HATA!");
            }
        }
Example #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            string eposta = txteposta.Text;
            string sifre  = txtsifre.Text;



            //Eposta kontrolü ve girilen eposta uygunsa ana forma giriş yapıldı gönderiyor
            Regex duzenliifade;

            if (txtkod.Text == "" || txteposta.Text == "" || txtsifre.Text == "")
            {
                MessageBox.Show("Lütfen Gerekli Alanları Doldurunuz!");
            }
            else if (txteposta.Text.Trim() != string.Empty)
            {
                duzenliifade = new Regex(@"^([a-zA-Z0-9_\-])([a-zA-Z0-9_\-\.]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}|((([a-zA-Z0-9\-]+)\.)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\])$");
                if (!duzenliifade.IsMatch(txteposta.Text.Trim()))
                {
                    MessageBox.Show("Hatalı E posta Girişi Yaptınız!");
                    txteposta.Focus();
                    txteposta.SelectAll();
                }
                else
                {
                    if (txtkod.Text == lblkod.Text)
                    {
                        #region Veritabanı Bağlantısı
                        MySqlDataReader    rd;
                        VeritabaniIslemler sorgu = new VeritabaniIslemler();
                        label5.Text = "Bağlanıyor...";
                        string komut = "SELECT * FROM OgretimElemani WHERE eposta='" + eposta + "' AND sifre='" + sifre + "';";
                        rd = sorgu.Oku(komut);
                        if (rd.Read())
                        {
                            Yetki   = byte.Parse(rd["yetki"].ToString());
                            Session = true;
                            Ad      = rd["Ad_Soyad"].ToString();
                            this.Close();
                        }
                        else
                        {
                            label5.Text = "";
                            GuvenlikKodu();
                            MessageBox.Show("E posta ya da şifre yanlış!");
                        }

                        #endregion
                    }
                    else
                    {
                        MessageBox.Show("Hatalı Güvenlik Kodu Girişi");
                        GuvenlikKodu();
                    }
                }
            }
        }
Example #3
0
 public void OgretimGorevlileriListele()
 {
     try
     {
         islemler = new VeritabaniIslemler();
         komut    = "select unvan as 'Ünvanı', Ad_Soyad as 'Ad Soyad',Kendi_Sinav_Sayisi as 'Kendi Sınav Sayısı',Gozetmenlik_Sayisi as 'Gözetmenlik Sayısı' from ogretimelemani";
         if (islemler.Al(komut) != null)
         {
             dataGridView2.DataSource = null;
             dataGridView2.Refresh();
             dataGridView2.DataSource = islemler.Al(komut);
         }
     }
     catch (Exception err)
     {
         MessageBox.Show("Öğretim Elemanları Listelenirken Hata! \nHata Kodu:" + err, "HATA!");
     }
 }
Example #4
0
        public void YerlesenOGrenciRenkAta()
        {
            try
            {
                islemler = new VeritabaniIslemler();
                if (sinavid > 0)
                {
                    komut = "select SiraNo,Ogr_Sayisi,Y_Ogr_Sayisi from " + Home.donem + " where SiraNo=" + sinavid + "";
                }
                else
                {
                    komut = "select SiraNo,Ogr_Sayisi,Y_Ogr_Sayisi from " + Home.donem + " order by SiraNo desc";
                }



                dr = islemler.Oku(komut);
                if (sinavid > 0)
                {
                    if (dr.Read())
                    {
                        int ogrencisayisi         = 0;
                        int yerlesenogrencisayisi = 0;
                        if (!dr.IsDBNull(1))
                        {
                            ogrencisayisi = int.Parse(dr.GetString("Ogr_Sayisi"));
                        }
                        if (!dr.IsDBNull(2))
                        {
                            yerlesenogrencisayisi = int.Parse(dr.GetString("Y_Ogr_Sayisi"));
                        }

                        if (ogrencisayisi == 0 && yerlesenogrencisayisi == 0)
                        {
                            dataGridView1.Rows[rowindex].Cells[16].Style.BackColor = Color.White;
                        }
                        else if (ogrencisayisi > yerlesenogrencisayisi)
                        {
                            dataGridView1.Rows[rowindex].Cells[16].Style.BackColor = Color.FromArgb(244, 67, 54);
                        }
                        else
                        {
                            dataGridView1.Rows[rowindex].Cells[16].Style.BackColor = Color.FromArgb(165, 214, 167);
                        }
                    }
                }
                else
                {
                    while (dr.Read())
                    {
                        int ogrencisayisi         = 0;
                        int yerlesenogrencisayisi = 0;
                        if (!dr.IsDBNull(1))
                        {
                            ogrencisayisi = int.Parse(dr.GetString("Ogr_Sayisi"));
                        }
                        if (!dr.IsDBNull(2))
                        {
                            yerlesenogrencisayisi = int.Parse(dr.GetString("Y_Ogr_Sayisi"));
                        }

                        for (int i = 0; i < dataGridView1.Rows.Count; i++)
                        {
                            if (dataGridView1.Rows[i].Cells[0].Value.ToString() == dr.GetString("SiraNo"))
                            {
                                if (ogrencisayisi == 0 && yerlesenogrencisayisi == 0)
                                {
                                    dataGridView1.Rows[i].Cells[16].Style.BackColor = Color.White; break;
                                }
                                else if (ogrencisayisi > yerlesenogrencisayisi)
                                {
                                    dataGridView1.Rows[i].Cells[16].Style.BackColor = Color.FromArgb(244, 67, 54); break;
                                }
                                else
                                {
                                    dataGridView1.Rows[i].Cells[16].Style.BackColor = Color.FromArgb(165, 214, 167); break;
                                }
                            }
                        }
                    }
                }
                islemler.Kapat();
                sinavid = -1;
            }
            catch (Exception err)
            {
                MessageBox.Show("Hücre Rengi Değiştirilirken Hata! \nHata Kodu:" + err, "HATA!");
            }
        }
        private void btnmavi1_Click(object sender, EventArgs e)
        {
            string eposta = txteposta.Text.Trim();
            string sifre  = txtsifre.Text.Trim();



            //Eposta kontrolü ve girilen eposta uygunsa ana forma giriş yapıldı gönderiyor
            Regex duzenliifade;

            if (txtkod.Text == "" || txteposta.Text == "" || txtsifre.Text == "")
            {
                MessageBox.Show("Lütfen Gerekli Alanları Doldurunuz!");
            }
            else if (txteposta.Text.Trim() != string.Empty)
            {
                duzenliifade = new Regex(@"^([a-zA-Z0-9_\-])([a-zA-Z0-9_\-\.]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}|((([a-zA-Z0-9\-]+)\.)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\])$");
                if (!duzenliifade.IsMatch(txteposta.Text.Trim()))
                {
                    MessageBox.Show("Hatalı E posta Girişi Yaptınız!");
                    txteposta.Focus();
                    txteposta.SelectAll();
                }
                else
                {
                    if (txtkod.Text == lblkod.Text)
                    {
                        #region Veritabanı Bağlantısı
                        VeritabaniIslemler sorgu = new VeritabaniIslemler();
                        label5.Text = "Bağlanıyor...";
                        DataTable dt    = new DataTable();
                        string    komut = "SELECT * FROM ogretimelemani WHERE eposta='" + eposta + "' AND sifre='" + sifre + "';";
                        dt = sorgu.Al(komut);
                        if (dt == null)
                        {
                            MessageBox.Show("Bağlantı Hatası!\nLütfen İnternet Bağlantınızı Kontrol Edip Tekrar Deneyin.", "HATA!");
                            label5.Text = "";
                        }
                        else if (dt.Rows.Count != 0)
                        {
                            Yetki   = byte.Parse(dt.Rows[0]["yetki"].ToString());
                            Session = true;
                            Ad      = dt.Rows[0]["Ad_Soyad"].ToString();
                            this.Close();
                        }
                        else
                        {
                            label5.Text = "";
                            GuvenlikKodu();
                            MessageBox.Show("E posta ya da şifre yanlış!");
                        }

                        #endregion
                    }
                    else
                    {
                        MessageBox.Show("Hatalı Güvenlik Kodu Girişi");
                        GuvenlikKodu();
                    }
                }
            }
        }