Exemplo n.º 1
0
        public Restaurant GetRestaurantByID(int id)
        {
            string sql = "Select * From restaurant where RestaurantID = @id";
            Dictionary <object, object> parameters = new Dictionary <object, object>();

            parameters.Add("id", id.ToString());

            DataSet    results = GetDataSetSql(sql, parameters);
            Restaurant r       = null;

            if (results != null && results.Tables[0].Rows.Count == 1)
            {
                r = DataSetParser.DataSetToRestaurant(results, 0);
            }
            return(r);
        }
Exemplo n.º 2
0
        public Restaurant GetRestaurantByName(string Name)
        {
            string sql = "Select * From restaurant where Naam like @name";
            Dictionary <object, object> parameters = new Dictionary <object, object>();

            parameters.Add("name", Name);


            DataSet    results = GetDataSetSql(sql, parameters);
            Restaurant r       = null;

            if (results != null && results.Tables[0].Rows.Count == 1)
            {
                r = DataSetParser.DataSetToRestaurant(results, 0);
            }

            return(r);
        }
Exemplo n.º 3
0
        public List <Restaurant> GetGlobalRestaurants()
        {
            string sql = "Select * From restaurant";
            Dictionary <object, object> parameters = new Dictionary <object, object>();

            DataSet           results     = GetDataSetSql(sql, parameters);
            List <Restaurant> restaurants = new List <Restaurant>();

            if (results != null && results.Tables[0].Rows.Count > 0)
            {
                for (int x = 0; x < results.Tables[0].Rows.Count; x++)
                {
                    Restaurant r = DataSetParser.DataSetToRestaurant(results, x);
                    restaurants.Add(r);
                }
            }

            return(restaurants);
        }