Example #1
0
        public static IQueryable <Category> listCategory()
        {
            ShoesShopOnline db    = new ShoesShopOnline();
            var             query = (from category in db.Categories
                                     select category);

            return(query);
        }
Example #2
0
        public static IQueryable <User> getUserById(int userId)
        {
            ShoesShopOnline db    = new ShoesShopOnline();
            var             query = (from user in db.Users
                                     where user.userId == userId
                                     select user);

            return(query);
        }
Example #3
0
        public static IQueryable <User> getUserByEmail(String email)
        {
            ShoesShopOnline db    = new ShoesShopOnline();
            var             query = (from user in db.Users
                                     where user.email == email
                                     select user);

            return(query);
        }
Example #4
0
        public static IQueryable <Product> getProductInfo(int productId)
        {
            ShoesShopOnline db    = new ShoesShopOnline();
            var             query = (from product in db.Products
                                     where product.productId == productId
                                     select product);

            return(query);
        }
Example #5
0
        public static IPagedList <Product> getListProduct(int page, int size)
        {
            ShoesShopOnline db    = new ShoesShopOnline();
            var             query = (from product in db.Products
                                     where product.isAvailable == true
                                     orderby product.releaseDate
                                     select product).ToPagedList(page, size);

            return(query);
        }
Example #6
0
 public ProductDao()
 {
     db = new ShoesShopOnline();
 }
Example #7
0
 public CartDao()
 {
     db = new ShoesShopOnline();
 }
Example #8
0
 public UserDao()
 {
     db = new ShoesShopOnline();
 }
Example #9
0
        public static IPagedList <Product> getAllProduct(int?manufacturerId, int sort, int order, int page, int size)
        {
            ShoesShopOnline db = new ShoesShopOnline();

            if (order == 1)
            {
                if (manufacturerId != null)
                {
                    if (sort == 1)
                    {
                        var query = (from product in db.Products
                                     where product.manufacturerId == manufacturerId
                                     orderby product.productName descending
                                     select product).ToPagedList(page, size);
                        return(query);
                    }
                    else
                    {
                        var query = (from product in db.Products
                                     where product.manufacturerId == manufacturerId
                                     orderby product.productName ascending
                                     select product).ToPagedList(page, size);
                        return(query);
                    }
                }
                else
                {
                    if (sort == 1)
                    {
                        var query = (from product in db.Products
                                     orderby product.productName descending
                                     select product).ToPagedList(page, size);
                        return(query);
                    }
                    else
                    {
                        var query = (from product in db.Products
                                     orderby product.productName ascending
                                     select product).ToPagedList(page, size);
                        return(query);
                    }
                }
            }
            else
            {
                if (manufacturerId != null)
                {
                    if (sort == 1)
                    {
                        var query = (from product in db.Products
                                     where product.manufacturerId == manufacturerId
                                     orderby product.price descending
                                     select product).ToPagedList(page, size);
                        return(query);
                    }
                    else
                    {
                        var query = (from product in db.Products
                                     where product.manufacturerId == manufacturerId
                                     orderby product.price ascending
                                     select product).ToPagedList(page, size);
                        return(query);
                    }
                }
                else
                {
                    if (sort == 1)
                    {
                        var query = (from product in db.Products
                                     orderby product.price descending
                                     select product).ToPagedList(page, size);
                        return(query);
                    }
                    else
                    {
                        var query = (from product in db.Products
                                     orderby product.price ascending
                                     select product).ToPagedList(page, size);
                        return(query);
                    }
                }
            }
        }
Example #10
0
 public ManufacturerDao()
 {
     db = new ShoesShopOnline();
 }
Example #11
0
 public InvoiceDao()
 {
     db = new ShoesShopOnline();
 }
Example #12
0
        public static List <Manufacturer> getListManufacturer()
        {
            ShoesShopOnline db = new ShoesShopOnline();

            return(db.Manufacturers.ToList());
        }
Example #13
0
 public AdminDao()
 {
     db = new ShoesShopOnline();
 }
Example #14
0
 public CategoryDao()
 {
     db = new ShoesShopOnline();
 }
Example #15
0
 public TransactionDao()
 {
     db = new ShoesShopOnline();
 }
Example #16
0
 public MethodDao()
 {
     db = new ShoesShopOnline();
 }
Example #17
0
 public LoginDao()
 {
     db = new ShoesShopOnline();
 }