Example #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"));
     }
 }
Example #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));
     }
 }
Example #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"));
     }
 }
Example #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"));
     }
 }
Example #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"));
     }
 }
Example #6
0
 public static IEnumerable <View_ThreeMonthsStatistic> ThreeMonthsStatistics()
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <View_ThreeMonthsStatistic>("SELECT * FROM View_ThreeMonthsStatistics"));
     }
 }
Example #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));
     }
 }
Example #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));
     }
 }
Example #9
0
 public static IEnumerable <Order> List()
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Query <Order>("SELECT * FROM Orders ORDER BY OrderDate DESC"));
     }
 }
Example #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));
     }
 }
Example #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));
     }
 }