36 lines
1.1 KiB
C#
36 lines
1.1 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 System.Web;
|
|
using PrevuWebAPI;
|
|
using PrevuWebAPI.Code.Managers;
|
|
|
|
namespace Code.Utils
|
|
{
|
|
public class Properties
|
|
{
|
|
|
|
private APIClientInformationCallManager _ClientInfoControlManager = new APIClientInformationCallManager();
|
|
public readonly string PROJECT_DEFAULT_COLOR_PROPERTY_KEY = "PROJECT_DEFAULT_COLOR";
|
|
|
|
public string GetPropertyValue(string key)
|
|
{
|
|
Guid clientId = GetClientID();
|
|
PrevuAPIEntities e = new PrevuAPIEntities();
|
|
return e.Properties.Where(y => y.ClientId == clientId && y.propertyName == key).Select(x => x.propertyValue).FirstOrDefault();
|
|
}
|
|
private Guid GetClientID()
|
|
{
|
|
HttpRequest request = HttpContext.Current.Request;
|
|
string token = request.Params[Settings._securityToken];
|
|
return _ClientInfoControlManager.GetClientID(token);
|
|
}
|
|
|
|
|
|
}
|
|
}
|