public ActionResult Edit(RestaurantInput input)
        {
            if (!ModelState.IsValid)
            {
                return View("Create", input);
            }

            var rest = Db.Get<Restaurant>(Convert.ToInt32(input.Id));

            rest.Name = input.Name;

            return Json(new { });
        }
Example #2
0
        public ActionResult Edit(RestaurantInput input)
        {
            if (!ModelState.IsValid)
            {
                return(View("Create", input));
            }

            var rest = Db.Get <Restaurant>(Convert.ToInt32(input.Id));

            rest.Name = input.Name;

            return(Json(new { }));
        }
        public ActionResult Create(RestaurantInput input)
        {
            if (!ModelState.IsValid)
            {
                return View(input);
            }

            var restaurant = Db.Get<Restaurant>(input.Id);
            restaurant.Name = input.Name;
            restaurant.IsCreated = true;

            return Json(new { });
        }
Example #4
0
        public ActionResult Create(RestaurantInput input)
        {
            if (!ModelState.IsValid)
            {
                return(View(input));
            }

            var restaurant = Db.Get <Restaurant>(input.Id);

            restaurant.Name      = input.Name;
            restaurant.IsCreated = true;

            return(Json(new { }));
        }