Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,StartTime,EndTime,CustomerName,NumParticipants,TableNum")] Reservation reservation)
        {
            try
            {
                await RestHelper.ApiEdit <Reservation>(api + id, reservation);

                logger.LogInformation("Reservation information on id: " + id + " edited");

                return(RedirectToAction("Index", "Reservations"));
            }
            catch (Exception e)
            {
                logger.LogError("Error trying to edit reservation \n" + e);
                return(RedirectToAction("Index", "Reservations"));
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,CustomerName,NumParticipants,ActivityId")] ActivityBooking activityBooking)
        {
            _logger.LogInformation("<-- Returned to Edit/httppost-->");
            if (id != activityBooking.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                await RestHelper.ApiEdit(api + id, activityBooking);

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ActivityId"] = new SelectList(_context.Activity, "Id", "Id", activityBooking.ActivityId);
            return(View(activityBooking));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,DayName,Open,Closed")] RestaurantInfo restaurantInfo)
        {
            await RestHelper.ApiEdit <RestaurantInfo>(api + id, restaurantInfo);

            return(RedirectToAction("Index"));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,MenuId")] MenuCategory menuCategory)
        {
            await RestHelper.ApiEdit <MenuCategory>(menuCatApi + id, menuCategory);

            return(RedirectToAction("Index", "Menus"));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] Menu menu)
        {
            await RestHelper.ApiEdit <Menu>(menuApi + id, menu);

            return(RedirectToAction("Index", "Menus"));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Description,Location,Price,StartTime,EndTime")] Activity activity)
        {
            await RestHelper.ApiEdit <Activity>(api + id, activity);

            return(RedirectToAction("Index", "Activities"));
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Description,Allergies,Price,MenuCategoryId")] MenuItems menuItems)
        {
            await RestHelper.ApiEdit <MenuItems>(menuItemApi + id, menuItems);

            return(RedirectToAction("Index", "Menus"));
        }