コード例 #1
0
        public ActionResult Create(string cuisineName)
        {
            CuisineClass current = new CuisineClass(cuisineName);

            current.Save();
            List <CuisineClass> cuisineList = CuisineClass.GetAll();

            return(View("NewRestaurant", cuisineList));
        }
コード例 #2
0
        public ActionResult Index()
        {
            Dictionary <string, object> restaurantCuisine = new Dictionary <string, object>();
            List <RestaurantClass>      restaurantList    = RestaurantClass.GetAll();
            List <CuisineClass>         cuisineList       = CuisineClass.GetAll();

            restaurantCuisine.Add("restaurant", restaurantList);
            restaurantCuisine.Add("cuisine", cuisineList);
            return(View(restaurantCuisine));
        }
コード例 #3
0
        public ActionResult Create(string restaurantName, string restaurantLocation, string restaurantCuisine)
        {
            int             restaurantCuisineNew = int.Parse(restaurantCuisine);
            RestaurantClass restaurant           = new RestaurantClass(restaurantName, restaurantLocation, restaurantCuisineNew);

            restaurant.Save();

            Dictionary <string, object> model          = new Dictionary <string, object>();
            List <RestaurantClass>      restaurantList = RestaurantClass.GetAll();
            List <CuisineClass>         cuisineList    = CuisineClass.GetAll();

            model.Add("restaurant", restaurantList);
            model.Add("cuisine", cuisineList);
            return(View("Index", model));
        }
コード例 #4
0
        public ActionResult Show()
        {
            List <CuisineClass> cuisineList = CuisineClass.GetAll();

            return(View("NewRestaurant", cuisineList));
        }