Esempio n. 1
0
 public static void Insert(CTTour cttour)
 {
     using (var db = new tourEntities())
     {
         db.CTTours.Add(cttour);
         db.SaveChanges();
     }
 }
Esempio n. 2
0
 public static void Update(CTTour cttour)
 {
     using (var db = new tourEntities())
     {
         db.Entry(cttour).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Esempio n. 3
0
 public static void Delete(CTTour cttour)
 {
     using (var db = new tourEntities())
     {
         var result = (from c in db.CTTours where c.MaDiaDiem == cttour.MaDiaDiem && c.MaTour == cttour.MaTour select c).First();
         db.CTTours.Remove(result);
         db.SaveChanges();
     }
 }