示例#1
0
文件: MMThamSo.cs 项目: TVMD/KaraOKe
 public bool Insert(THAMSO item)
 {
     try
     {
         using (var db = new QLPhongKaraokeEntities())
         {
             db.THAMSOes.Add(item);
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#2
0
文件: MMThamSo.cs 项目: TVMD/KaraOKe
 public bool Update(THAMSO item)
 {
     try
     {
         using (var db = new QLPhongKaraokeEntities())
         {
             var x = from s in db.THAMSOes
                     where s.Name == item.Name && s.Deleted == 0
                     select s;
             var sv = x.FirstOrDefault();
             if (sv != null)
             {
                 sv.Value = item.Value;
                 db.SaveChanges();
             }
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }