public static List <Product> listUserSoldProduct(string username, string password) { if (!CheckFunction.checkUsernamePassword(username, password)) { return(null); } List <Product> toReturn = new List <Product>(); List <soldproduct> listSold = db.soldproduct.Where(r => (r.username == username)).ToList(); foreach (var E in listSold) { toReturn.Add(new Product(E)); } return(toReturn); }
public static List <Product> listProductInCart(string username, string password) { if (!CheckFunction.checkUsernamePassword(username, password)) { return(null); } List <Product> toReturn = new List <Product>(); order o = GetFunction.getUserCurrentOrder(username); if (o == null) { return(toReturn); } List <orderline> listOrderline = db.orderline.Where(r => (r.idOrder == o.idOrder)).ToList(); foreach (var E in listOrderline) { toReturn.Add(new Product(E)); } return(toReturn); }