public AppConfig(IResourceManager appSettings) { this.RunOnBaseUrl = appSettings.GetString("RunOnBaseUrl"); this.TestPaths = appSettings.GetList("TestPaths"); this.HandlerHosts = appSettings.GetList("HandlerHosts"); this.HandlerHostNames = appSettings.GetList("HandlerHostNames"); }
public AppConfig(IResourceManager resources) { this.RootDirectory = resources.GetString("RootDirectory").MapHostAbsolutePath() .Replace('\\', Path.DirectorySeparatorChar); this.TextFileExtensions = resources.GetList("TextFileExtensions"); this.ExcludeDirectories = resources.GetList("ExcludeDirectories"); }
//public AppConfig(IAppSettings resources) public AppConfig(IResourceManager resources) { this.RootDirectory = resources.GetString("RootDirectory").MapHostAbsolutePath() .Replace('\\', Path.DirectorySeparatorChar); this.TextFileExtensions = resources.GetList("TextFileExtensions"); this.ExcludeDirectories = resources.GetList("ExcludeDirectories"); }
public JsonResult GetSelectResource(int sortId, string resname, string order = "ResourceId DESC", int pageIndex = 1, int pageSize = 20) { string sqlwhere = " KL_Resource.Status = 1 AND KL_Resource.IsOpen = 1 AND KL_Resource.IsDeleted=0 AND KL_Resource.TenantId = " + CurrentUser.TenantId; if (sortId > 0) { sqlwhere += " AND KL_Resource.SortId = " + sortId; } if (!string.IsNullOrEmpty(resname)) { sqlwhere += string.Format(" AND KL_Resource.ResourceName LIKE '%{0}%'", resname.ReplaceSql()); } int total; var list = _resourceManager.GetList(out total, sqlwhere, (pageIndex - 1) * pageSize + 1, pageSize, order); var dataList = list.Select(p => new { p.ResourceName, p.ResourceId, p.CreaterName, p.CreateTimeStr, p.SortName, //Tags = string.IsNullOrEmpty(p.Tags) ? new string[0] : p.Tags.Split(','), //p.AvgScore, //AvgScoreStr = p.AvgScore.ToString("0.0"), //p.ScoreCount, //p.ExtendName, //ResourceCommentScoreStr = p.AvgScore.ToString("0.0") }); return(Json(new { dataList, recordCount = total }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetKnowledgeList(int sortId, string resname, string sortname, int status, string realname, DateTime?stime, DateTime?etime, int pageIndex, int pageSize) { int total; var list = _resourceManager.GetList(out total, CurrentTenant.TenantId, sortId, resname, sortname, status, realname, stime, etime, pageIndex, pageSize); var dataList = list.Select(p => new { p.ResourceId, p.ResourceName, p.CreaterName, p.CreateTimeStr, StatusStr = p.ManageStatusStr, p.Status, p.SortId, SortName = string.IsNullOrEmpty(p.SortName) ? CurrentTenant.TenantName : p.SortName }); return(Json(new { dataList, recordCount = total }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetKnowledges(int sortId) { int total; List <KL_Resource> knowledges = _resourceManager.GetList(out total, CurrentTenant.TenantId, sortId, "", "", 1, "", null, null, 1, 10); var dataList = knowledges.Select(p => new { p.ResourceId, p.ResourceName, p.ExtendName, AvgScore = p.AvgScore.ToString("0.0") }); return(Json(dataList, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Initializes a new instance of the <see cref="AppConfig"/> class. /// </summary> /// <param name="appSettings"> /// The app settings. /// </param> public AppConfig(IResourceManager appSettings) { this.AdminEmailAddresses = (from adminUserName in appSettings.GetList("AdminEmailAddresses") select adminUserName.ToUpper().Trim()).ToList(); }
public UmbracoAuthConfig(IResourceManager appSettings) { this.AllowedApplicationAliases = appSettings.GetList("UmbracoAuthConfig.AllowedApplicationAliases").ToList(); }