public ActionResult Create(FormCollection collection) { var slide = new Radyn.Slider.DataStructure.Slide(); try { this.RadynTryUpdateModel(slide); var url = collection["Selected"]; slide.CurrentUICultureName = collection["LanguageId"]; if (CongressComponent.Instance.BaseInfoComponents.CongessSlideFacade.Insert(this.Homa.Id, slide, url)) { ShowMessage(Resources.Common.InsertSuccessMessage, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Succeed); if (!string.IsNullOrEmpty(url)) { SessionParameters.CurrentCongress = CongressComponent.Instance.BaseInfoComponents.HomaFacade.Get(this.Homa.Id); } return(this.SubmitRedirect(collection, new { Id = slide.Id })); } ShowMessage(Resources.Common.ErrorInInsert, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error); return(Redirect("~/Congress/CongressSlide/Index")); } catch (Exception exception) { ShowExceptionMessage(exception); ViewBag.Sliders = new SelectList(AppExtention.SlideList(), "Key", "Value"); return(View(slide)); } }
public ActionResult Create(FormCollection collection) { var slide = new Radyn.Slider.DataStructure.Slide(); try { this.RadynTryUpdateModel(slide); var url = collection["Selected"]; slide.CurrentUICultureName = collection["LanguageId"]; if (WebDesignComponent.Instance.SliderFacade.Insert(this.WebSite.Id, slide, url)) { ShowMessage(Resources.Common.InsertSuccessMessage, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Succeed); if (!string.IsNullOrEmpty(url)) { SessionParameters.CurrentWebSite = null; } return(RedirectToAction("Index")); } ShowMessage(Resources.Common.ErrorInInsert, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error); return(RedirectToAction("Index")); } catch (Exception exception) { ShowMessage(Resources.Common.ErrorInInsert + exception.Message, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error); ViewBag.Sliders = new SelectList(AppExtention.SlideList(), "Key", "Value"); return(View(slide)); } }