Esempio n. 1
0
        public List <Classes.Categories> GetCurrentBusinessCategories(String businessID)
        {
            query = new Dictionary <string, List <string> >();
            query.Add(sq.SQL_PROJECT, new List <string>()
            {
                sq.SQL_SELECT, c.CAT_name
            });
            query.Add(sq.SQL_FROM, new List <string>()
            {
                sq.SQL_FROM, c.CAT_table
            });
            query.Add(sq.SQL_WHERE, new List <string>()
            {
                c.B_id
            });
            query.Add(sq.SQL_COND, new List <string>()
            {
                businessID
            });
            query.Add(sq.SQL_ORDER, new List <string>()
            {
                sq.SQL_ORDER, ";", c.CAT_name
            });
            List <Object[]> newObject = newQuery.SQLSelectQuery(query);
            var             catList   = new List <Classes.Categories>();

            foreach (var item in newObject)
            {
                var tempCat = new Classes.Categories()
                {
                    category_name = item[0].ToString()
                };
                catList.Add(tempCat);
            }
            return(catList);
        }
Esempio n. 2
0
        public List <Classes.Categories> GetCategories(List <string> location)
        {
            query = new Dictionary <string, List <string> >();
            query.Add(sq.SQL_PROJECT, new List <string>()
            {
                sq.SQL_SELECTDIST, c.CAT_name
            });
            query.Add(sq.SQL_FROM, new List <string>()
            {
                sq.SQL_FROM, c.B_table, c.CAT_table
            });
            query.Add(sq.SQL_WHERE, new List <string>()
            {
                c.B_state, c.B_city, c.B_zipcode
            });
            query.Add(sq.SQL_COND, new List <string>()
            {
                location[0], location[1], location[2]
            });
            query.Add(sq.SQL_ORDER, new List <string>()
            {
                sq.SQL_ORDER, ";", c.CAT_name
            });
            List <Object[]>           newObject = newQuery.SQLSelectQuery(query);
            List <Classes.Categories> catList   = new List <Classes.Categories>();

            foreach (Object[] item in newObject)
            {
                Classes.Categories tempCat = new Classes.Categories()
                {
                    category_name = item[0].ToString()
                };
                catList.Add(tempCat);
            }
            return(catList);
        }