Beispiel #1
0
 public static void DodajKomentar1(CityComment comment)
 {
     using (Entities db = new Entities())
     {
         try
         {
             db.CityComments.Add(comment);
             db.SaveChanges();
         }
         catch (Exception)
         {
         }
     }
 }
Beispiel #2
0
        public static void IzbrisiKomentar(int id)
        {
            using (Entities db = new Entities())

            {
                CityComment komentarzabrisanje = (from a in db.CityComments where a.CommentID == id select a).Single();
                try
                {
                    db.CityComments.Remove(komentarzabrisanje);
                    db.SaveChanges();
                }
                catch (Exception)
                {
                }
            }
        }