예제 #1
0
        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));
            }
        }
예제 #2
0
        public ActionResult Edit(short id, FormCollection collection)
        {
            var slide = SliderComponent.Instance.SlideFacade.Get(id);

            try
            {
                this.RadynTryUpdateModel(slide, collection);
                var url = collection["Selected"];
                slide.CurrentUICultureName = collection["LanguageId"];
                if (WebDesignComponent.Instance.SliderFacade.Update(this.WebSite.Id, slide, url))
                {
                    ShowMessage(Resources.Common.UpdateSuccessMessage, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Succeed);
                    SessionParameters.CurrentWebSite = null;
                    return(RedirectToAction("Index"));
                }
                ShowMessage(Resources.Common.ErrorInEdit, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error);
                return(RedirectToAction("Index"));
            }
            catch (Exception exception)
            {
                ShowMessage(Resources.Common.ErrorInEdit + exception.Message, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error);
                ViewBag.Id      = id;
                ViewBag.Sliders = new SelectList(AppExtention.SlideList(), "Key", "Value");
                return(View(slide));
            }
        }
예제 #3
0
        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));
            }
        }
예제 #4
0
        private void GetValue(short id)
        {
            ViewBag.Id = id;
            var str = "";

            if (this.WebSite.Configuration.BigSlideId != null && this.WebSite.Configuration.BigSlideId == id)
            {
                str = "1";
            }
            if (this.WebSite.Configuration.AverageSlideId != null && this.WebSite.Configuration.AverageSlideId == id)
            {
                str = "0";
            }
            if (this.WebSite.Configuration.MiniSlideId != null && this.WebSite.Configuration.MiniSlideId == id)
            {
                str = "-1";
            }
            ViewBag.Sliders = new SelectList(AppExtention.SlideList(), "Key", "Value", str);
        }
예제 #5
0
        private void GetValue(short?id)
        {
            ViewBag.Id = id;
            var str = "";

            if (this.Homa.Configuration.BigSlideId != null && this.Homa.Configuration.BigSlideId == id)
            {
                str = "1";
            }
            if (this.Homa.Configuration.AverageSlideId != null && this.Homa.Configuration.AverageSlideId == id)
            {
                str = "0";
            }
            if (this.Homa.Configuration.MiniSlideId != null && this.Homa.Configuration.MiniSlideId == id)
            {
                str = "-1";
            }
            var list = new List <KeyValuePair <string, string> >();

            list = AppExtention.SlideList();
            list.Insert(0, new KeyValuePair <string, string>(
                            "-2", Resources.Congress.None));
            ViewBag.Sliders = new SelectList(list, "Key", "Value", str);
        }
예제 #6
0
 public ActionResult Create()
 {
     ViewBag.Sliders = new SelectList(AppExtention.SlideList(), "Key", "Value");
     return(View());
 }