示例#1
0
文件: Admin.cs 项目: ludusername/BTA2
 public static void Addtcomment(TransportatitonComment transportationComment)
 {
     using (Entities db = new Entities())
     {
         try
         {
             db.TransportatitonComments.Add(transportationComment);
             db.SaveChanges();
         }
         catch (Exception)
         {
         }
     }
 }
示例#2
0
文件: Admin.cs 项目: ludusername/BTA2
        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)
                {
                }
            }
        }