示例#1
0
 public static void Delete(DiaDiem diadiem)
 {
     using (var db = new tourEntities())
     {
         db.Entry(diadiem).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
示例#2
0
 public static void Insert(DiaDiem diadiem)
 {
     using (var db = new tourEntities())
     {
         db.DiaDiems.Add(diadiem);
         db.SaveChanges();
     }
 }
示例#3
0
 public static Boolean KiemtraXoa(DiaDiem diadiem)
 {
     using (var db = new tourEntities())
     {
         var result = from c in db.CTTours where c.MaDiaDiem == diadiem.Id select c;
         int sl     = result.ToList <CTTour>().Count;
         if (sl == 0)
         {
             return(true);
         }
         return(false);
     }
 }