示例#1
0
文件: Admin.cs 项目: ludusername/BTA2
 public static void Addtrating(TransportatitonRating transportationRating)
 {
     using (Entities db = new Entities())
     {
         try
         {
             db.TransportatitonRatings.Add(transportationRating);
             db.SaveChanges();
         }
         catch (Exception)
         {
         }
     }
 }
示例#2
0
文件: Admin.cs 项目: ludusername/BTA2
        public static void IzbrisiTRating(int id)
        {
            using (Entities db = new Entities())

            {
                TransportatitonRating komentarzabrisanje = (from a in db.TransportatitonRatings where a.RatingID == id select a).Single();
                try
                {
                    db.TransportatitonRatings.Remove(komentarzabrisanje);
                    db.SaveChanges();
                }
                catch (Exception)
                {
                }
            }
        }