コード例 #1
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));
            }
        }
コード例 #2
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));
            }
        }
コード例 #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
        /// <summary>
        /// Light・Darkテーマ変換対応
        /// </summary>
        private static void ChangeTheme()
        {
            var paletteHelper = new PaletteHelper();
            var theme         = paletteHelper.GetTheme();

            bool isDark = Model.Instance.Setting.IsAppDarkTheme.Value;

            theme.SetBaseTheme(
                isDark
                    ? Theme.Dark
                    : Theme.Light);

            theme.PrimaryDark  = new ColorPair((Color)Current.Resources["Primary700"], Colors.White);
            theme.PrimaryMid   = new ColorPair((Color)Current.Resources["Primary500"], Colors.White);
            theme.PrimaryLight = (Color)Current.Resources["Primary300"];
            theme.Paper        = AppExtention.ToColorOrDefault(isDark
                ? "#272E33"
                : "#E6EDF2");

            //ベース色とのコントラストが
            Current.Resources["HighContrastBrush"] =
                (isDark ? theme.PrimaryLight : theme.PrimaryDark)
                .Color.ToSolidColorBrush(true);

            paletteHelper.SetTheme(theme);
        }
コード例 #5
0
        public ActionResult GetError()
        {
            var keyValuePair = AppExtention.HomaError();

            ViewBag.Error = keyValuePair != null?keyValuePair.Value.Key:null;
            ViewBag.Photo = keyValuePair != null ? keyValuePair.Value.Value : null;
            return(PartialView("PVError"));
        }
コード例 #6
0
 public void OnActionExecuting(ActionExecutingContext filterContext)
 {
     try
     {
         AppExtention.GetHoma(filterContext.HttpContext);
     }
     catch
     {
     }
 }
コード例 #7
0
        public ActionResult Edit(Guid Id)
        {
            ViewBag.Id        = Id;
            ViewBag.IsForUser = CongressComponent.Instance.BaseInfoComponents.UserFormsFacade.Get(this.Homa.Id, Id) !=
                                null;
            var firstOrDefault =
                FormGeneratorComponent.Instance.FormAssigmentFacade.FirstOrDefault(x => x.FormStructureId == Id);

            ViewBag.Datas = new SelectList(AppExtention.GetFormList(), "Key", "Value",
                                           firstOrDefault != null ? firstOrDefault.Url : "");
            TempData["Containers"] =
                new SelectList(
                    CongressComponent.Instance.BaseInfoComponents.CongressContainerFacade.SelectKeyValuePair(
                        x => x.ContainerId, x => x.Container.Title, x => x.CongressId == this.Homa.Id), "Key", "Value");
            return(View());
        }
コード例 #8
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);
        }
コード例 #9
0
        public ReplacePatternViewModel(ReplacePattern replacePattern)
        {
            this.replacePattern = replacePattern;

            AsExpression = replacePattern
                           .ToReactivePropertyAsSynchronized(x => x.AsExpression)
                           .AddTo(this.CompositeDisposable);


            TargetPattern = replacePattern
                            .ToReactivePropertyAsSynchronized(x => x.TargetPattern, mode: ReactivePropertyMode.Default | ReactivePropertyMode.IgnoreInitialValidationError)
                            .SetValidateNotifyError(x => AppExtention.IsValidRegexPattern(x, AsExpression.Value) ? null : "Invalid Pattern")
                            .AddTo(this.CompositeDisposable);

            ReplaceText = replacePattern
                          .ToReactivePropertyAsSynchronized(x => x.ReplaceText)
                          .AddTo(this.CompositeDisposable);

            AsExpression
            .Subscribe(x => TargetPattern.ForceValidate());
        }
コード例 #10
0
        public ActionResult Edit(Guid Id, FormCollection collection)
        {
            var formStructure = FormGeneratorComponent.Instance.FormStructureFacade.Get(Id);

            try
            {
                var forUser = collection["ForUser"].ToBool();
                var url     = collection["Selected"];
                this.RadynTryUpdateModel(formStructure, collection);
                if (forUser)
                {
                    url = null;
                }
                if (CongressComponent.Instance.BaseInfoComponents.CongressFormsFacade.UpdateAndAssgine(this.Homa.Id,
                                                                                                       formStructure, url, forUser))
                {
                    ShowMessage(Resources.Common.UpdateSuccessMessage, Resources.Common.MessaageTitle,
                                messageIcon: MessageIcon.Succeed);
                    return(Redirect("~/Congress/CongressForms/Index"));
                }
                ShowMessage(Resources.Common.ErrorInEdit, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error);
                return(Redirect("~/Congress/CongressForms/Index"));
            }
            catch (Exception exception)
            {
                ShowExceptionMessage(exception);
                ViewBag.Id = Id;
                var firstOrDefault =
                    FormGeneratorComponent.Instance.FormAssigmentFacade.FirstOrDefault(x => x.FormStructureId == Id);
                ViewBag.Datas = new SelectList(AppExtention.GetFormList(), "Key", "Value",
                                               firstOrDefault != null ? firstOrDefault.Url : "");
                TempData["Containers"] =
                    new SelectList(
                        CongressComponent.Instance.BaseInfoComponents.CongressContainerFacade.SelectKeyValuePair(
                            x => x.Container.Id, x => x.Container.Title, x => x.CongressId == this.Homa.Id), "Key",
                        "Value");
                return(View());
            }
        }
コード例 #11
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);
        }
コード例 #12
0
 public ActionResult Create()
 {
     ViewBag.Sliders = new SelectList(AppExtention.SlideList(), "Key", "Value");
     return(View());
 }
コード例 #13
0
 public void OnActionExecuting(ActionExecutingContext filterContext)
 {
     AppExtention.GetWebSite();
 }