public bool AddSP(string TenSP)
 {
     SanPham sp = new SanPham();
     sp.TenSP = TenSP;
      try
     {
         using (ShopttEntities data = new ShopttEntities())
         {
             data.SanPhams.Add(sp);
             data.SaveChanges();
             return true;
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine(e);
         return false;
     }
 }
 private Product TranslateEntity(SanPham Sp)
 {
     Product product = new Product();
     product._MaSP = Sp.MaSP;
     product._TenSP = Sp.TenSP;
     product._GiaBan = (decimal)Sp.GiaBan;
     product._HinhAnh = Sp.HinhAnh;
     product._NgayCapNhat = (DateTime)Sp.NgayCapNhat;
     product._SoLuong =(int) Sp.SoLuong;
     product._MaNSX = (int)Sp.MaNSX;
     product._MaLoai =(int) Sp.MaLoai;
     return product;
 }
 private SanPham TranslateProDuct(Product sp)
 {
     SanPham _SP = new SanPham();
     _SP.MaSP = sp._MaSP;
     _SP.TenSP = sp._TenSP;
     _SP.GiaBan = (decimal)sp._GiaBan;
     _SP.HinhAnh = sp._HinhAnh;
     _SP.NgayCapNhat =(DateTime)sp._NgayCapNhat;
     _SP.SoLuong = (int)sp._SoLuong;
     _SP.MaNSX = (int)sp._MaNSX;
     _SP.MaLoai = (int)sp._MaLoai;
     return _SP;
 }