public ActionResult Create(ConfigurationGalleryModel model) { if (ModelState.IsValid) { var gallery = new Galleries { Name = model.Name, Description = model.Description, DisplayOrder = model.DisplayOrder, PictureId = model.PictureId, VideoLink = model.VideoLink, }; if (!string.IsNullOrEmpty(model.GalleryType)) { switch (model.GalleryType) { case "SimpleGallery": { gallery.SimpleGallery = true; gallery.FlickrGallery = false; gallery.PicasaGallery = false; gallery.VideoGallery = false; } break; case "FlickrGallery": { gallery.FlickrGallery = true; gallery.SimpleGallery = false; gallery.PicasaGallery = false; gallery.VideoGallery = false; } break; case "PicasaGallery": { gallery.PicasaGallery = true; gallery.SimpleGallery = false; gallery.FlickrGallery = false; gallery.VideoGallery = false; } break; case "VideoGallery": { gallery.VideoGallery = true; gallery.SimpleGallery = false; gallery.FlickrGallery = false; gallery.PicasaGallery = false; } break; } } else { gallery.SimpleGallery = true; gallery.FlickrGallery = false; gallery.PicasaGallery = false; gallery.VideoGallery = false; } _galleryService.InsertGallery(gallery); //locales UpdateLocales(gallery, model); //update picture seo file name UpdatePictureSeoNames(gallery); SuccessNotification(_localizationService.GetResource("Plugin.Widgets.Gallery.GalleryConfigureController.Added")); } return(View("~/Plugins/Widgets.Gallery/Views/GalleryConfigure/Create.cshtml", model)); }