Beispiel #1
0
        public override void Ekle(YorumResmi veri)
        {
            string commandText =
                "exec sp_YorumResmiEkle @ResimAdi, @ResimYolu, @YorumId,@PaylasimId, @KullaniciId,@YapilmaZamani";

            SqlConnection _sqlConnection = new SqlConnection(yol);

            if (_sqlConnection.State == ConnectionState.Closed)
            {
                _sqlConnection.Open();
            }

            SqlCommand _sqlCommand = new SqlCommand(commandText, _sqlConnection);


            _sqlCommand.Parameters.AddWithValue("@ResimAdi", veri.Resim.ResimAdi);
            _sqlCommand.Parameters.AddWithValue("@ResimYolu", veri.Resim.ResimYolu);
            _sqlCommand.Parameters.AddWithValue("@YorumId", veri.YorumId);
            _sqlCommand.Parameters.AddWithValue("@PaylasimId", veri.PaylasimId);
            _sqlCommand.Parameters.AddWithValue("@KullaniciId", veri.KullaniciId);
            _sqlCommand.Parameters.AddWithValue("@YapilmaZamani", veri.YapilmaZamani);

            _sqlCommand.ExecuteNonQuery();

            _sqlConnection.Close();
        }
Beispiel #2
0
 public void Ekle(YorumResmi veri)
 {
     if (String.IsNullOrEmpty(veri.YorumId))
     {
         veri.YorumId = Guid.NewGuid().ToString();
     }
     _yorumResmiDal.Ekle(veri);
 }
Beispiel #3
0
        public override void Sil(YorumResmi veri)
        {
            string commandText =
                "exec sp_YorumResmiSil @id";

            SqlConnection _sqlConnection = new SqlConnection(yol);

            if (_sqlConnection.State == ConnectionState.Closed)
            {
                _sqlConnection.Open();
            }

            SqlCommand _sqlCommand = new SqlCommand(commandText, _sqlConnection);



            _sqlCommand.Parameters.AddWithValue("@id", veri.Resim.ResimId);

            _sqlCommand.ExecuteNonQuery();

            _sqlConnection.Close();
        }
Beispiel #4
0
 public void Sil(YorumResmi veri)
 {
     _yorumResmiDal.Sil(veri);
 }
Beispiel #5
0
 public void Guncelle(YorumResmi veri)
 {
     _yorumResmiDal.Guncelle(veri);
 }