示例#1
0
 public void luuAnh_DAL(string ID, byte[] a)
 {
     using (imageEntities db = new imageEntities())
     {
         GiangVien img = (from c in db.GiangViens
                          where c.ID == ID
                          select c).SingleOrDefault();
         img.Image = a;
         db.SaveChanges();
     }
 }
示例#2
0
 public byte[] loadAnh(string ID)
 {
     using (imageEntities db = new imageEntities())
     {
         GiangVien img = (from c in db.GiangViens
                          where c.ID == ID
                          select c).SingleOrDefault();
         if (img == null)
         {
             return(null);
         }
         else
         {
             return(img.Image.ToArray());
         }
     }
 }