Beispiel #1
0
        public Task Init()
        {
            Dictionary <string, Dictionary <string, string> > @enum = new Dictionary <string, Dictionary <string, string> >();

            foreach (Assembly assembly in new[]
            {
                typeof(EnumExtensions).Assembly,
                typeof(BW.Common.Setting).Assembly,
                typeof(BW.Views.ViewUtils).Assembly,
                typeof(SP.Provider.CDN.ICDNProvider).Assembly,
                this.GetType().Assembly
            })
            {
                foreach (KeyValuePair <string, Dictionary <string, string> > t in assembly.GetEnums())
                {
                    if ([email protected](t.Key))
                    {
                        @enum.Add(t.Key, t.Value);
                    }
                }
            }
            @enum[typeof(Language).FullName] = SettingAgent.Instance().GetSetting(SystemSetting.SettingType.Language)?.
                                               Split(',').Select(t => t.ToEnum <Language>()).Distinct().ToDictionary(t => t.ToString(), t => t.GetDescription());
            return(this.GetResult(new
            {
                Enum = @enum,
                ImgServer = APIAgent.imgServer
            }));
        }
Beispiel #2
0
        public Task ModelContents([FromForm] int id)
        {
            var    list = BDC.ViewContent.Where(t => t.ModelID == id);
            string cdn  = SettingAgent.Instance().GetSetting(SystemSetting.SettingType.CDNUrl);

            return(this.GetResult(this.ShowResult(list, t => new
            {
                t.ModelID,
                t.Language,
                Path = string.Concat(cdn, "/", t.Path),
                t.Translate
            })));
        }
Beispiel #3
0
        public Task GetAdminUrl([FromForm] int id)
        {
            SiteDetail detail = SiteAgent.Instance().GetDetailInfo(id) ?? new SiteDetail()
            {
                SiteID = id
            };

            return(this.GetResult(new
            {
                detail.SiteID,
                detail.AdminURL,
                Domain = (SettingAgent.Instance().GetSetting(SettingType.AdminDomain) ?? string.Empty).Split(',')
            }));
        }
Beispiel #4
0
 public Task SaveSetting([FromForm] SystemSetting.SettingType type, [FromForm] string value)
 {
     return(this.GetResult(SettingAgent.Instance().SaveSetting(type, value)));
 }