Exemplo n.º 1
0
        public ActionResult _SubplatformSetting(string subplatform)
        {
            Subplatform Subplatform             = SubplatformMgr.GetSubplatform(subplatform);
            SubplatformSettingViewModel huidige = new SubplatformSettingViewModel
            {
                APIsource        = SubplatformMgr.GetSubplatformSetting(Subplatform.SubplatformId, Setting.Platform.SOURCE_API_URL)?.Value,
                recordsBijhouden = int.Parse(SubplatformMgr.GetSubplatformSetting(Subplatform.SubplatformId, Setting.Platform.DAYS_TO_KEEP_RECORDS)?.Value),
                SocialSource     = SubplatformMgr.GetSubplatformSetting(Subplatform.SubplatformId, Setting.Platform.SOCIAL_SOURCE)?.Value,
                SocialSourceUrl  = SubplatformMgr.GetSubplatformSetting(Subplatform.SubplatformId, Setting.Platform.SOCIAL_SOURCE_URL)?.Value,
                SiteName         = SubplatformMgr.GetSubplatformSetting(Subplatform.SubplatformId, Setting.Platform.SITE_NAME)?.Value,
                Theme            = SubplatformMgr.GetSubplatformSetting(Subplatform.SubplatformId, Setting.Platform.DEFAULT_THEME)?.Value,
                PrimaryColor     = SubplatformMgr.GetSubplatformSetting(Subplatform.SubplatformId, Setting.Platform.PRIMARY_COLOR)?.Value,
                SecondaryColor   = SubplatformMgr.GetSubplatformSetting(Subplatform.SubplatformId, Setting.Platform.SECONDARY_COLOR)?.Value
            };

            return(PartialView(huidige));
        }
Exemplo n.º 2
0
        public ActionResult SubplatformSetting(string subplatform, SubplatformSettingViewModel subplatformSettingViewModel)
        {
            Subplatform subplatformToChange = SubplatformMgr.GetSubplatform(subplatform);
            List <SubplatformSetting> subplatformSettings = new List <SubplatformSetting>
            {
                new SubplatformSetting
                {
                    SettingName = Setting.Platform.SOCIAL_SOURCE,
                    Value       = subplatformSettingViewModel.SocialSource,
                    IsEnabled   = true,
                    Subplatform = subplatformToChange
                },
                new SubplatformSetting
                {
                    SettingName = Setting.Platform.SOCIAL_SOURCE_URL,
                    Value       = subplatformSettingViewModel.SocialSourceUrl,
                    IsEnabled   = true,
                    Subplatform = subplatformToChange
                },
                new SubplatformSetting
                {
                    SettingName = Setting.Platform.SITE_NAME,
                    Value       = subplatformSettingViewModel.SiteName,
                    IsEnabled   = true,
                    Subplatform = subplatformToChange
                },
                new SubplatformSetting
                {
                    SettingName = Setting.Platform.DEFAULT_THEME,
                    Value       = subplatformSettingViewModel.Theme,
                    IsEnabled   = true,
                    Subplatform = subplatformToChange
                },
                new SubplatformSetting
                {
                    SettingName = Setting.Platform.DAYS_TO_KEEP_RECORDS,
                    Value       = subplatformSettingViewModel.recordsBijhouden.ToString(),
                    IsEnabled   = true,
                    Subplatform = subplatformToChange
                },
                new SubplatformSetting
                {
                    SettingName = Setting.Platform.SOURCE_API_URL,
                    Value       = subplatformSettingViewModel.APIsource,
                    IsEnabled   = true,
                    Subplatform = subplatformToChange
                },
                new SubplatformSetting
                {
                    SettingName = Setting.Platform.SEED_INTERVAL_HOURS,
                    Value       = SubplatformMgr.GetSubplatformSetting(subplatformToChange.SubplatformId, Setting.Platform.SEED_INTERVAL_HOURS)?.Value,
                    IsEnabled   = true,
                    Subplatform = subplatformToChange
                },
                new SubplatformSetting
                {
                    SettingName = Setting.Platform.ALERT_GENERATION_INTERVAL_HOURS,
                    Value       = SubplatformMgr.GetSubplatformSetting(subplatformToChange.SubplatformId, Setting.Platform.ALERT_GENERATION_INTERVAL_HOURS)?.Value,
                    IsEnabled   = true,
                    Subplatform = subplatformToChange
                },
                new SubplatformSetting
                {
                    SettingName = Setting.Platform.SEND_WEEKLY_REVIEWS_INTERVAL_DAYS,
                    Value       = SubplatformMgr.GetSubplatformSetting(subplatformToChange.SubplatformId, Setting.Platform.SEND_WEEKLY_REVIEWS_INTERVAL_DAYS)?.Value,
                    IsEnabled   = true,
                    Subplatform = subplatformToChange
                },
                new SubplatformSetting
                {
                    SettingName = Setting.Platform.PRIMARY_COLOR,
                    Value       = subplatformSettingViewModel.PrimaryColor,
                    IsEnabled   = true,
                    Subplatform = subplatformToChange
                },
                new SubplatformSetting
                {
                    SettingName = Setting.Platform.SECONDARY_COLOR,
                    Value       = subplatformSettingViewModel.SecondaryColor,
                    IsEnabled   = true,
                    Subplatform = subplatformToChange
                }
            };

            SubplatformMgr.ChangeSubplatformSettings(subplatformToChange, subplatformSettings);

            return(RedirectToAction("PlatformSettings", "Subplatform"));
        }