public ActionResult EditAndCreate(GenreModel genre)
        {
            BGenre oldGenre = AutoMapper <GenreModel, BGenre> .Map(genre);

            genreService.CreateOrUpdate(oldGenre);
            return(RedirectToActionPermanent("Index", "Genre"));
        }
Example #2
0
        public ActionResult CreateOrUpdate(GenreViewModel model)
        {
            if (!ValidateForm(model))
            {
                model.CulturedGenreSelectList = GetRelatedEntitiesList();

                CreateNotification(ActionResultType.Failure);
                return(View("CreateOrUpdate", model));
            }

            var genreParams = _genreService.CreateOrUpdate(model);

            CreateNotification(ActionResultType.Success);

            return(RedirectToAction("Update", new { genreParams.Id }));
        }