Example #1
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ShowId,LastChangeDate,LaseChangeUserId,CheckIn,Start,End,EventId")] Shows shows)
        {
            if (id != shows.ShowId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    Shows result = await _showService.EditAsync(id, shows);
                }
                catch (DbUpdateConcurrencyException)
                {
                    throw;
                }
                catch (KeyNotFoundException)
                {
                    return(NotFound());
                }
                return(RedirectToAction(nameof(Index)));
            }
            //ViewData["EventId"] = new SelectList(_context.Events, "EventId", "Name", shows.EventId);
            //ViewData["LaseChangeUserId"] = new SelectList(_context.Users, "UserId", "FirstName", shows.LaseChangeUserId);
            return(View(shows));
        }