Esempio n. 1
0
        //Bolum Sil Method
        public void BolumSil(BolumEntity Bolum)
        {
            SqlCommand cmd = dbHelper.GetSqlCommand();

            cmd.CommandText = "DELETE FROM Tbl_Bolum WHERE BolumID = @BolumID";
            cmd.Parameters.AddWithValue("@BolumID", Bolum.BolumID);
            cmd.ExecuteNonQuery();
        }
Esempio n. 2
0
        //Bolum Ekle Method
        public void BolumEkle(BolumEntity Bolum)
        {
            SqlCommand cmd = dbHelper.GetSqlCommand();

            cmd.CommandText = "Insert Into Tbl_Bolum(BolumAd) Values(@BolumAd)";
            cmd.Parameters.AddWithValue("@BolumAd", Bolum.BolumAd);
            cmd.ExecuteNonQuery();
        }
Esempio n. 3
0
        //Bolum Guncelle Method
        public void BolumGuncelle(BolumEntity Bolum)
        {
            SqlCommand cmd = dbHelper.GetSqlCommand();

            cmd.CommandText = "UPDATE Tbl_Bolum SET BolumAd = @BolumAd WHERE BolumID = @BolumID";
            cmd.Parameters.AddWithValue("@BolumAd", Bolum.BolumAd);
            cmd.Parameters.AddWithValue("@BolumID", Bolum.BolumID);
            cmd.ExecuteNonQuery();
        }
Esempio n. 4
0
        //Bolum Getir Method
        public List <BolumEntity> BolumGetir()
        {
            SqlCommand cmd = dbHelper.GetSqlCommand();

            cmd.CommandText = "SELECT BolumAd FROM Tbl_Bolum";
            List <BolumEntity> bolumler = new List <BolumEntity>();
            SqlDataReader      dr       = cmd.ExecuteReader();

            while (dr.Read())
            {
                BolumEntity bolum = new BolumEntity();
                bolum.BolumAd = dr["BolumAd"].ToString();

                bolumler.Add(bolum);
            }
            return(bolumler);
        }