Beispiel #1
0
        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() + ")"));
        }
Beispiel #2
0
        public List <Login> getAllLogins()
        {
            DBSelector selector = new DBSelector();

            return(selector.getRows <Login>("SELECT * FROM \"Login\""));
        }
Beispiel #3
0
        public List <User> getAllUsers()
        {
            DBSelector selector = new DBSelector();

            return(selector.getRows <User>("SELECT * FROM \"User\""));
        }
Beispiel #4
0
        public List <String> getItemCategories()
        {
            DBSelector selector = new DBSelector();

            return(selector.getRows <String>("SELECT DISTINCT \"Category\" FROM \"Item\""));
        }
Beispiel #5
0
        public List <Item> geItemsByCategory(string category)
        {
            DBSelector selector = new DBSelector();

            return(selector.getRows <Item>("SELECT * FROM \"Item\" WHERE \"Category\" = '" + category + "'"));
        }
Beispiel #6
0
        public List <ItemList> getOrderLineItems(int orderID)
        {
            DBSelector selector = new DBSelector();

            return(selector.getRows <ItemList>("SELECT * FROM \"ItemList\" WHERE \"OrderID\" = '" + orderID + "'"));
        }
Beispiel #7
0
        public List <Order> getOrdersByUser(int userID)
        {
            DBSelector selector = new DBSelector();

            return(selector.getRows <Order>("SELECT * FROM \"Order\" WHERE \"UserID\"= '" + userID + "'"));
        }
Beispiel #8
0
        public List <Vendor> getAllVendors()
        {
            DBSelector selector = new DBSelector();

            return(selector.getRows <Vendor>("SELECT * FROM \"Vendor\""));
        }