Exemplo n.º 1
0
 public static void DodajKomentar1(CityComment comment)
 {
     using (Entities db = new Entities())
     {
         try
         {
             db.CityComments.Add(comment);
             db.SaveChanges();
         }
         catch (Exception)
         {
         }
     }
 }
Exemplo n.º 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)
                {
                }
            }
        }