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)); } }
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)); } }
public static Specification GetSpecification(int id) { using (var db = new ShopSmartPhoneConnectionDB()) { return(db.SingleOrDefault <Specification>("SELECT * FROM Specifications WHERE ProductID = @0", id)); } }