public static IQueryable <Category> listCategory() { ShoesShopOnline db = new ShoesShopOnline(); var query = (from category in db.Categories select category); return(query); }
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); }
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); }
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); }
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); }
public ProductDao() { db = new ShoesShopOnline(); }
public CartDao() { db = new ShoesShopOnline(); }
public UserDao() { db = new ShoesShopOnline(); }
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); } } } }
public ManufacturerDao() { db = new ShoesShopOnline(); }
public InvoiceDao() { db = new ShoesShopOnline(); }
public static List <Manufacturer> getListManufacturer() { ShoesShopOnline db = new ShoesShopOnline(); return(db.Manufacturers.ToList()); }
public AdminDao() { db = new ShoesShopOnline(); }
public CategoryDao() { db = new ShoesShopOnline(); }
public TransactionDao() { db = new ShoesShopOnline(); }
public MethodDao() { db = new ShoesShopOnline(); }
public LoginDao() { db = new ShoesShopOnline(); }