Example #1
0
        //Set all the ratings and datagridview table
        public void setRating(String name, String location)
        {
            Item item = new Item();
            RestaurantService restaurantService = new RestaurantService();
            Restaurant        restaurant        = new Restaurant();

            restaurant.Name     = name;
            restaurant.Location = location;

            restaurant   = restaurantService.GetAllRate(restaurant);
            label17.Text = name + " (" + location + ")";
            label6.Text  = restaurant.Environment.ToString();
            label8.Text  = restaurant.Behaviour.ToString();
            rid          = restaurant.Rid;

            ItemService itemService = new ItemService();

            item.Rid   = rid;
            foodRating = itemService.GetItemsRating(item);

            label4.Text = foodRating.ToString();

            DataTable table = new DataTable();

            table = itemService.GetTable(item);
            dataGridView1.DataSource = table;

            totalRating = (restaurant.Environment + restaurant.Behaviour + foodRating) / 3;
            label2.Text = totalRating.ToString();
        }