예제 #1
0
        private void btnNOTGUNCELLE_Click(object sender, EventArgs e)
        {
            ENTITYNOT not = new ENTITYNOT();

            not.AD        = txtOGRAD.Text;
            not.SOYAD     = txtOGRSOYAD.Text;
            not.OGRENCIID = Convert.ToInt16(txtIDNOT.Text);
            not.SINAV1    = Convert.ToInt16(txtSINAV1.Text);
            not.SINAV2    = Convert.ToInt16(txtSINAV2.Text);
            not.SINAV3    = Convert.ToInt16(txtSINAV3.Text);
            not.PROJE     = Convert.ToInt16(txtPROJE.Text);
            not.ORTALAMA  = ((not.SINAV1 + not.SINAV2 + not.SINAV3) / 3) * 0.6 + not.PROJE * 0.4;

            if (not.ORTALAMA >= 50)
            {
                not.DURUM = "True";
            }
            else
            {
                not.DURUM = "False";
            }

            bool guncelle = BLLNOTLAR.GUNCELLE(not);

            if (guncelle)
            {
                MessageBox.Show(not.AD + " " + not.SOYAD + " isimli öğrencinin notları güncellendi");
            }
            else
            {
                MessageBox.Show("Eksik veya hatalı giriş yapıldı");
            }
            NotListesi();
        }
예제 #2
0
        public static List <ENTITYNOT> NOTLISTESI()
        {
            List <ENTITYNOT> degerler = new List <ENTITYNOT>();
            SqlCommand       komut    = new SqlCommand("NOTLISTESI", SQLBAGLANTISI.BAGLANTI);

            komut.CommandType = CommandType.StoredProcedure;

            if (komut.Connection.State != ConnectionState.Open)
            {
                komut.Connection.Open();
            }

            SqlDataReader dr = komut.ExecuteReader();

            while (dr.Read())
            {
                ENTITYNOT ent = new ENTITYNOT();
                ent.OGRENCIID = Convert.ToInt16(dr["OGRID"]);
                ent.AD        = dr["AD"].ToString();
                ent.SOYAD     = dr["SOYAD"].ToString();
                ent.SINAV1    = Convert.ToInt16(dr["SINAV1"]);
                ent.SINAV2    = Convert.ToInt16(dr["SINAV2"]);
                ent.SINAV3    = Convert.ToInt16(dr["SINAV3"]);
                ent.PROJE     = Convert.ToInt16(dr["PROJE"]);
                ent.ORTALAMA  = Convert.ToDouble(dr["ORTALAMA"]);
                ent.DURUM     = dr["DURUM"].ToString();
                degerler.Add(ent);
            }
            dr.Close();
            return(degerler);
        }
예제 #3
0
 public static bool GUNCELLE(ENTITYNOT deger)
 {
     if (deger.OGRENCIID != 0 && deger.OGRENCIID > 0 && deger.ORTALAMA != null && deger.ORTALAMA >= 0 && deger.ORTALAMA <= 100 && deger.SINAV1 != null && deger.SINAV1 >= 0 && deger.SINAV1 <= 100 && deger.SINAV2 != null && deger.SINAV2 >= 0 && deger.SINAV2 <= 100 && deger.SINAV3 != null && deger.SINAV3 >= 0 && deger.SINAV3 <= 100 && deger.PROJE != null && deger.PROJE >= 0 && deger.PROJE <= 100 && deger.DURUM != null)
     {
         return(FACADENOTLAR.GUNCELLE(deger));
     }
     else
     {
         return(false);
     }
 }
예제 #4
0
        public static bool GUNCELLE(ENTITYNOT deger)
        {
            SqlCommand komut = new SqlCommand("NOTGUNCELLE", SQLBAGLANTISI.BAGLANTI);

            komut.CommandType = CommandType.StoredProcedure;

            if (komut.Connection.State != ConnectionState.Open)
            {
                komut.Connection.Open();
            }

            komut.Parameters.AddWithValue("SINAV1", deger.SINAV1);
            komut.Parameters.AddWithValue("SINAV2", deger.SINAV2);
            komut.Parameters.AddWithValue("SINAV3", deger.SINAV3);
            komut.Parameters.AddWithValue("PROJE", deger.PROJE);
            komut.Parameters.AddWithValue("ORTALAMA", deger.ORTALAMA);
            komut.Parameters.AddWithValue("DURUM", deger.DURUM);
            komut.Parameters.AddWithValue("OGRID", deger.OGRENCIID);

            return(komut.ExecuteNonQuery() > 0);
        }