Пример #1
0
 // get top 10 best selling products
 public static IEnumerable <Product> Top10Featured()
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <Product>("SELECT TOP 10 * FROM Products WHERE Sold > 0 ORDER BY Sold DESC"));
     }
 }
Пример #2
0
 public static IEnumerable <Comment> ProductComments(int id)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <Comment>("SELECT * FROM Comments WHERE Status = 1 AND ProductId = @0 ORDER BY DateCreated DESC", id));
     }
 }
Пример #3
0
 public static IEnumerable <Brand> List()
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <Brand>("SELECT * FROM Brands WHERE Status = 1 ORDER BY Name"));
     }
 }
Пример #4
0
 // get products list
 public static IEnumerable <Product> List()
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <Product>("SELECT * FROM Products ORDER BY DateModified DESC, DateCreated DESC"));
     }
 }
Пример #5
0
 public static IEnumerable <View_Profile> List()
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <View_Profile>("SELECT * FROM View_Profile ORDER BY Email, FirstName, LastName"));
     }
 }
Пример #6
0
 public static IEnumerable <View_ThreeMonthsStatistic> ThreeMonthsStatistics()
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <View_ThreeMonthsStatistic>("SELECT * FROM View_ThreeMonthsStatistics"));
     }
 }
Пример #7
0
 public static IEnumerable <Order> OrderPurchase(string id)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <Order>("SELECT * FROM Orders WHERE UserId = @0 ORDER By OrderDate DESC", id));
     }
 }
Пример #8
0
 public static IEnumerable <View_PurchaseHistory> PurchaseHistory(string id)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <View_PurchaseHistory>("SELECT DISTINCT * FROM View_PurchaseHistory WHERE Id = @0", id));
     }
 }
Пример #9
0
 public static IEnumerable <Order> List()
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <Order>("SELECT * FROM Orders ORDER BY OrderDate DESC"));
     }
 }
Пример #10
0
 // get images by product id
 public static IEnumerable <Image> List(int?id)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <Image>("SELECT * FROM Images WHERE ProductId = @0", id));
     }
 }
Пример #11
0
 public static IEnumerable <View_OrderDetail> Details(int id)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <View_OrderDetail>("SELECT * FROM View_OrderDetails WHERE Id = @0", id));
     }
 }