Пример #1
0
 public bool ChangeImageLHS(string id, string image)
 {
     using (var db = new LUUHS())
     {
         var result = db.LuuHocSinhs.SingleOrDefault(b => b.MaLHS == id);
         if (result != null)
         {
             result.Image = image;
             db.SaveChanges();
         }
     }
     return(true);
 }
Пример #2
0
 public bool AddNewLHS(LuuHocSinh lhs)
 {
     using (LUUHS luuhs = new LUUHS())
     {
         try
         {
             luuhs.LuuHocSinhs.Add(lhs);
             luuhs.SaveChanges();
             return(true);
         }
         catch (Exception)
         {
             return(false);
         }
     }
 }