47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Runtime.Caching;
|
|
using PrevuWebAPI.Code.Managers;
|
|
using System.Web;
|
|
using PrevuWebAPI;
|
|
using NLog;
|
|
|
|
namespace Code.Utils
|
|
{
|
|
public class Settings
|
|
{
|
|
public static readonly string _securityToken = "token"; // Name of the url parameter.
|
|
//private APIClientInformationCallManager _ClientInfoControlManager = new APIClientInformationCallManager();
|
|
public readonly string NAME_FORMAT_SETTING_KEY = "NAME_FORMAT";
|
|
public readonly string NAME_FORMAT_DELIM_SETTING_KEY = "NAME_FORMAT_DELIM";
|
|
public readonly string PROJECT_DEFAULT_COLOR_SETTING_KEY = "PROJECT_DEFAULT_COLOR";
|
|
public readonly string REASSIGN_ALLOCATIONS = "REASSIGN_ALLOCATIONS";
|
|
public static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
public string GetSettingValue(string key)
|
|
{
|
|
var clientInfo = APIClientInformationCallManager.ClientInfo;
|
|
if (clientInfo != null) {
|
|
Guid clientId = clientInfo.Id;
|
|
PrevuAPIEntities e = new PrevuAPIEntities();
|
|
return e.Settings.Where(y => y.ClientID == clientId && y.setting1 == key).Select(x => x.value).FirstOrDefault();
|
|
}
|
|
return null;
|
|
|
|
}
|
|
//private string GetClientID()
|
|
//{
|
|
// HttpRequest request=HttpContext.Current.Request;
|
|
// string token = request.Params[_securityToken];
|
|
// return _ClientInfoControlManager.GetClientID(token);
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
}
|