示例#1
0
        private void ShopPageForm_Load(object sender, EventArgs e)
        {
            _model = _service.Read(_id);

            PrintShopInfo();

            PopulateCategoriesGrid();

            RateShop.Enabled = _model.UserRating.isAllowed;

            PopulateMenuStrip();
        }
示例#2
0
        private ShopFormViewModel Compose(Shop shop, Dictionary <int, string> categories, List <FoodItemViewModel> foodItems, UserShopRatingInformation rating)
        {
            var model = new ShopFormViewModel();

            var shopModel = new ShopInformation();

            PropertyCopier <Shop, ShopInformation> .Copy(shop, shopModel);

            model.Info = shopModel;

            model.UserRating = rating;

            model.FoodItems = GetFoodItemsPerCategory(categories, foodItems);

            return(model);
        }