示例#1
0
 public bool Update(DATPHONG item)
 {
     try
     {
         using (var db = new QLPhongKaraokeEntities())
         {
             var x = from s in db.DATPHONGs
                     where s.ID == item.ID
                     select s;
             var sv = x.FirstOrDefault();
             if (sv != null)
             {
                 sv.NgayGioDat = item.NgayGioDat;
                 sv.SDT        = item.SDT;
                 sv.Note       = item.Note;
                 db.SaveChanges();
             }
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#2
0
 public bool Insert(DATPHONG item)
 {
     try
     {
         using (var db = new QLPhongKaraokeEntities())
         {
             db.DATPHONGs.Add(item);
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }