Ejemplo n.º 1
0
 public static void InsertSpecification(Specification spe)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         db.Insert(spe);
     }
 }
Ejemplo n.º 2
0
 public static IEnumerable <Product> ListOfManufacturer(int id)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         return(db.Query <Product>("SELECT * FROM Product WHERE ManufacturerID = @0 and Status = True", id));
     }
 }
Ejemplo n.º 3
0
 public static void Insert(Product sp)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         db.Insert(sp);
     }
 }
Ejemplo n.º 4
0
 public static Page <Product> getListProductFollowManu(int pageNumber, int itemPerPage, int id)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         return(db.Page <Product>(pageNumber, itemPerPage, "SELECT * FROM Product WHERE ManufacturerID = @0", id));
     }
 }
Ejemplo n.º 5
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));
     }
 }
Ejemplo n.º 6
0
 public static IEnumerable <MoreImage> getListImage(int id)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         return(db.Query <MoreImage>("SELECT * FROM MoreImage WHERE Product_ID = @0", id));
     }
 }
Ejemplo n.º 7
0
 public static void UpdateSpecification(Specification spec)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         db.Update(spec);
     }
 }
Ejemplo n.º 8
0
 public static void UpdateImage(String filename, int imageID)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         db.Update <MoreImage>("SET ImageName = @0 WHERE Image_ID = @1", filename, imageID);
     }
 }
 public static IEnumerable <Categogy> getListManufacturer()
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         return(db.Query <Categogy>("SELECT * FROM Manufacturer WHERE Status = 1"));
     }
 }
Ejemplo n.º 10
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));
     }
 }
Ejemplo n.º 11
0
 public static IEnumerable <Categogy> getListCategogy()
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         return(db.Query <Categogy>("SELECT * FROM Categogy"));
     }
 }
Ejemplo n.º 12
0
 public static IEnumerable <Manufacturer> getListManufacturer()
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         return(db.Query <Manufacturer>("SELECT * FROM Manufacturer"));
     }
 }
Ejemplo n.º 13
0
 public static void UpdateNoImage(int id, Product sp)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         db.Update <Product>("SET ProductName=@0, Price=@1, CategogyID=@2, ManufacturerID=@3, Description=@4, Specifications=@5, Warranty=@6, Accessories=@7, Evaluate=@8 WHERE ID=@9", sp.ProductName, sp.Price, sp.CategogyID, sp.ManufacturerID, sp.Description, sp.Specifications, sp.Warranty, sp.Accessories, sp.Evaluate, id);
     }
 }
Ejemplo n.º 14
0
 public static void Delete(int id)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         db.Update <Product>("SET Status = 0 WHERE ID=@0", id);
     }
 }
Ejemplo n.º 15
0
 public static Specification GetSpecification(int id)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         return(db.SingleOrDefault <Specification>("SELECT * FROM Specifications WHERE ProductID = @0", id));
     }
 }
Ejemplo n.º 16
0
 public static void InsertImage(MoreImage mi)
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         db.Insert(mi);
     }
 }
Ejemplo n.º 17
0
 public static int getIDProductNew()
 {
     using (var db = new ShopSmartPhoneConnectionDB())
     {
         var query = db.Query <Product>("SELECT * FROM Product ORDER BY ID DESC");
         return(query.First().ID);
     }
 }
Ejemplo n.º 18
0
        public static Page <Product> getListProductPage(int pageNumber, int itemPerPage)
        {
            var db = new ShopSmartPhoneConnectionDB();

            return(db.Page <Product>(pageNumber, itemPerPage, "Select * from Product"));
        }
Ejemplo n.º 19
0
        public static IEnumerable <Product> getListProduct()
        {
            var db = new ShopSmartPhoneConnectionDB();

            return(db.Query <Product>("Select * from Product"));
        }
Ejemplo n.º 20
0
        public static IEnumerable <Product> DanhSach()
        {
            var db = new ShopSmartPhoneConnectionDB();

            return(db.Query <Product>("Select * from Product WHERE Status = 1"));
        }
Ejemplo n.º 21
0
        public static IEnumerable <Manufacturer> GetListManufacturer()
        {
            var db = new ShopSmartPhoneConnectionDB();

            return(db.Query <Manufacturer>("SELECT * FROM Manufacturer WHERE Status = 1"));
        }
Ejemplo n.º 22
0
        public static IEnumerable <Categogy> GetListCategogy()
        {
            var db = new ShopSmartPhoneConnectionDB();

            return(db.Query <Categogy>("Select * FROM Categogy WHERE Status = 1"));
        }