Пример #1
0
        public ActionResult DishFeed(string slug)
        {
            var dishModel = new Pages.DishPage();

            ButterCMSClientHandler <Pages.DishPage> dishFeedHandler = new ButterCMSClientHandler <Pages.DishPage>();

            dishFeedHandler.modifyToMultiple(dishModel);

            var dishFeedModel = new Pages.DishFeedPage();

            try
            {
                dishFeedModel.DishCount = dishFeedHandler.pagesClassType.Meta.Count;

                dishFeedModel.Dishes = new List <Pages.DishPage>();
                var dishPageList = dishFeedHandler.pagesClassType.Data.ToList();

                foreach (var dish in dishPageList)
                {
                    var tempDish = new Pages.DishPage();

                    tempDish.copyData(dish);

                    dishFeedModel.Dishes.Add(tempDish);
                }
            }
            catch (Exception ex)
            {
                return(View("Error"));
            }

            return(View(dishFeedModel));
        }
Пример #2
0
        public ActionResult Main()
        {
            var mainModel = new Pages.MainPage();

            ButterCMSClientHandler <Pages.MainPage> mainhandler = new ButterCMSClientHandler <Pages.MainPage>();

            mainhandler.modifyToMultiple(mainModel);

            var mainPageList = mainhandler.pagesClassType.Data.ToList();

            try
            {
                mainModel.copyData(mainPageList[0]);
            }
            catch (Exception ex)
            {
                return(View("Error"));
            }

            return(View(mainModel));
        }