public List <Item> getOrderItems(int orderID) { DBSelector selector = new DBSelector(); List <ItemList> itemList = selector.getRows <ItemList>("SELECT * FROM \"ItemList\" WHERE \"OrderID\"= '" + orderID + "'"); StringBuilder sb = new StringBuilder(); for (int i = 0; i < itemList.Count; ++i) { sb.Append("'"); sb.Append(itemList[i].ItemID); sb.Append("'"); //add a comma if it's not the last id if (i < (itemList.Count - 1)) { sb.Append(","); } } return(selector.getRows <Item>("SELECT * FROM \"Item\" WHERE \"ItemID\" IN (" + sb.ToString() + ")")); }
public List <Login> getAllLogins() { DBSelector selector = new DBSelector(); return(selector.getRows <Login>("SELECT * FROM \"Login\"")); }
public List <User> getAllUsers() { DBSelector selector = new DBSelector(); return(selector.getRows <User>("SELECT * FROM \"User\"")); }
public List <String> getItemCategories() { DBSelector selector = new DBSelector(); return(selector.getRows <String>("SELECT DISTINCT \"Category\" FROM \"Item\"")); }
public List <Item> geItemsByCategory(string category) { DBSelector selector = new DBSelector(); return(selector.getRows <Item>("SELECT * FROM \"Item\" WHERE \"Category\" = '" + category + "'")); }
public List <ItemList> getOrderLineItems(int orderID) { DBSelector selector = new DBSelector(); return(selector.getRows <ItemList>("SELECT * FROM \"ItemList\" WHERE \"OrderID\" = '" + orderID + "'")); }
public List <Order> getOrdersByUser(int userID) { DBSelector selector = new DBSelector(); return(selector.getRows <Order>("SELECT * FROM \"Order\" WHERE \"UserID\"= '" + userID + "'")); }
public List <Vendor> getAllVendors() { DBSelector selector = new DBSelector(); return(selector.getRows <Vendor>("SELECT * FROM \"Vendor\"")); }