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

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

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

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

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

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

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

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