Пример #1
0
 public static Product GetProduct(int id)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         return(db.SingleOrDefault <Product>("SELECT * FROM Product WHERE ID=@0 AND Status = 1", id));
     }
 }
Пример #2
0
 public static DetailProduct getDetailProduct(int id)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         return(db.SingleOrDefault <DetailProduct>("Select sp.*, l.CategogyName, h.ManufacturerName from Product sp, Categogy l, Manufacturer h WHERE sp.CategogyID = l.ID and sp.ManufacturerID = h.ID and sp.Status = 1 and sp.ID = @0", id));
     }
 }
Пример #3
0
 public static Specification GetSpecification(int id)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         return(db.SingleOrDefault <Specification>("SELECT * FROM Specifications WHERE ProductID = @0", id));
     }
 }