Esempio n. 1
0
 public static void Addtcomment(TransportatitonComment transportationComment)
 {
     using (Entities db = new Entities())
     {
         try
         {
             db.TransportatitonComments.Add(transportationComment);
             db.SaveChanges();
         }
         catch (Exception)
         {
         }
     }
 }
Esempio n. 2
0
        public static void IzbrisiTKomentar(int id)
        {
            using (Entities db = new Entities())

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