Exemple #1
0
        public ActionResult DirectorEdit(DirectorEditViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var directorDto = FilmViewerMapper.Mapper.Map <DirectorDetailsDto>(viewModel);

                _directorService.EditDirector(directorDto);

                TempData[UserMessages.UserMessage] = new MessageViewModel()
                {
                    CssClass = "alert-success",
                    Message  = Resources.DirectorEditedSuccesfully
                };
            }
            return(RedirectToAction("ViewDirectors", "Moderator"));
        }
Exemple #2
0
        public IActionResult Edit(int id, app.service.Directors.Query.GetDirectorById.GetDirectorByIdResult director)
        {
            if (id != director.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                _directorService.EditDirector(new app.service.Directors.Commands.EditDirector.EditDirectorCommand
                {
                    ID   = director.ID,
                    Name = director.Name
                });

                return(RedirectToAction(nameof(Index)));
            }
            return(View(director));
        }