init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
184
Kreta.KretaServer/Caching/ConnectionStringCache.cs
Normal file
184
Kreta.KretaServer/Caching/ConnectionStringCache.cs
Normal file
|
@ -0,0 +1,184 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Kreta.DataAccessManual;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Caching;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Kreta.Client.GlobalApi;
|
||||
using Kreta.Core.Enum;
|
||||
using Kreta.Core.FeatureToggle;
|
||||
using Kreta.Core.FeatureToggle.Configuration;
|
||||
using System.Configuration;
|
||||
using Kreta.Core;
|
||||
|
||||
namespace Kreta.KretaServer.Caching
|
||||
{
|
||||
public sealed class ConnectionStringCache : GenericCache<object>
|
||||
{
|
||||
private static readonly string SystemConnectionStringsCache = $"{nameof(Kreta)}_{nameof(SystemConnectionStringsCache)}";
|
||||
|
||||
private static readonly string IntezmenyConnectionStringsCache = $"{nameof(Kreta)}_{nameof(IntezmenyConnectionStringsCache)}";
|
||||
|
||||
public ConnectionStringCache(Framework.Caching.CacheManager cacheManager) : base(cacheManager, nameof(ConnectionStringCache))
|
||||
{
|
||||
}
|
||||
|
||||
#region Private methods
|
||||
|
||||
private List<string> LoadSystemConnectionStrings()
|
||||
{
|
||||
var systemConnectionStrings = new List<string>();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(KretaServer.Instance.Configuration.IntezmenyConnectionStringFile))
|
||||
{
|
||||
string intezmenyConnectionStringFile = KretaServer.Instance.Configuration.IntezmenyConnectionStringFile;
|
||||
|
||||
try
|
||||
{
|
||||
if (File.Exists(intezmenyConnectionStringFile))
|
||||
{
|
||||
var builder = new Microsoft.Extensions.Configuration.ConfigurationBuilder();
|
||||
builder.AddJsonFile(intezmenyConnectionStringFile);
|
||||
IConfigurationRoot configuration = builder.Build();
|
||||
|
||||
systemConnectionStrings = configuration.GetSection("config:connectionStrings").GetChildren().Select(x => x.Value).ToList();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SDAServer.Instance.Logger.ExceptionThrown(ex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
systemConnectionStrings = new List<string> { KretaServer.Instance.Configuration.DBConnection };
|
||||
}
|
||||
|
||||
AddOrUpdate(SystemConnectionStringsCache, systemConnectionStrings, oldValue => systemConnectionStrings);
|
||||
|
||||
return systemConnectionStrings;
|
||||
}
|
||||
|
||||
private Dictionary<string, string> GetIntezmenyConnectionStrings()
|
||||
{
|
||||
|
||||
var globalApiFeature = new UseGlobalApiConnectionStringFeature((FeatureConfigurationSection)ConfigurationManager.GetSection(Constants.ConfigurationSectionNames.FeatureConfig));
|
||||
|
||||
var result = (Dictionary<string, string>)Get(IntezmenyConnectionStringsCache) ??
|
||||
(globalApiFeature.IsEnabled ? LoadIntezmenyConnectionStringsGlobalApi() : LoadIntezmenyConnectionStrings());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private Dictionary<string, string> LoadIntezmenyConnectionStrings()
|
||||
{
|
||||
var intezmenyConnectionStrings = new Dictionary<string, string>();
|
||||
|
||||
IEnumerable<string> systemConnectionStrings = GetSystemConnectionStrings();
|
||||
|
||||
if (systemConnectionStrings.Any())
|
||||
{
|
||||
// intézmény kapcsolati leírók feltöltése (json fájlban megadott rendszer leíró db-kből lekérdezem a DB-khez tartozó intézményeket)
|
||||
foreach (var connectionString in systemConnectionStrings)
|
||||
{
|
||||
intezmenyConnectionStrings = Dal.ServiceSystemConnection.Run(connectionString, h =>
|
||||
{
|
||||
return intezmenyConnectionStrings.Concat(
|
||||
h.IntezmenyDal().GetOsszesIntezmeny()
|
||||
.Select(intezmeny => new { key = intezmeny.ToLower(), value = connectionString })
|
||||
.ToDictionary(k => k.key, v => v.value)
|
||||
).ToDictionary(k => k.Key, v => v.Value);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
AddOrUpdate(IntezmenyConnectionStringsCache, intezmenyConnectionStrings, oldValue => intezmenyConnectionStrings);
|
||||
|
||||
return intezmenyConnectionStrings;
|
||||
}
|
||||
|
||||
private Dictionary<string, string> LoadIntezmenyConnectionStringsGlobalApi()
|
||||
{
|
||||
var systemType = KretaServer.Instance.Configuration.SystemType;
|
||||
|
||||
var intezmenyConnectionStrings = new Dictionary<string, string>();
|
||||
var globalDbConnection = KretaServer.Instance.Configuration.GlobalDbConnection;
|
||||
var globalApiClient = GlobalApiClientFactory.Build();
|
||||
var token = globalApiClient.GetPrivateToken();
|
||||
var dbConnectionList = globalApiClient.GetKretaAdatbaziselerhetosegek(token.AccessToken, systemType);
|
||||
|
||||
foreach (var dbConnenction in dbConnectionList)
|
||||
{
|
||||
intezmenyConnectionStrings.Add(dbConnenction.IntezmenyAzonosito.ToLower(), string.Format(globalDbConnection, dbConnenction.SqlInstanceName, dbConnenction.DatabaseName));
|
||||
}
|
||||
|
||||
AddOrUpdate(IntezmenyConnectionStringsCache, intezmenyConnectionStrings, oldValue => intezmenyConnectionStrings);
|
||||
return intezmenyConnectionStrings;
|
||||
}
|
||||
|
||||
private string GetIntezmenyiFelhasznalo(string intezmenyAzonosito)
|
||||
{
|
||||
return $"KR_{intezmenyAzonosito}_user";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public methods
|
||||
|
||||
public IEnumerable<string> GetOsszesIntezmeny()
|
||||
{
|
||||
return GetIntezmenyConnectionStrings().Keys;
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetSystemConnectionStrings()
|
||||
{
|
||||
var result = (IList<string>)Get(SystemConnectionStringsCache) ?? LoadSystemConnectionStrings();
|
||||
return result;
|
||||
}
|
||||
|
||||
public string GetSystemConnectionString(string intezmenyAzonosito)
|
||||
{
|
||||
intezmenyAzonosito = intezmenyAzonosito.ToLower();
|
||||
Dictionary<string, string> intezmenyConnectionStrings = GetIntezmenyConnectionStrings();
|
||||
|
||||
return intezmenyConnectionStrings.TryGetValue(intezmenyAzonosito, out string value)
|
||||
? value
|
||||
: KretaServer.Instance.Configuration.DBConnection;
|
||||
}
|
||||
|
||||
public string GetIntezmenyConnectionString(string intezmenyAzonosito)
|
||||
{
|
||||
intezmenyAzonosito = intezmenyAzonosito.ToLower();
|
||||
string connectionString = GetSystemConnectionString(intezmenyAzonosito);
|
||||
Dictionary<string, string> intezmenyConnectionStrings = GetIntezmenyConnectionStrings();
|
||||
|
||||
if (intezmenyConnectionStrings.ContainsKey(intezmenyAzonosito))
|
||||
{
|
||||
var builder = new System.Data.SqlClient.SqlConnectionStringBuilder(connectionString)
|
||||
{
|
||||
UserID = GetIntezmenyiFelhasznalo(intezmenyAzonosito),
|
||||
};
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
return connectionString;
|
||||
}
|
||||
|
||||
public void FillCache()
|
||||
{
|
||||
_ = GetSystemConnectionStrings();
|
||||
_ = GetIntezmenyConnectionStrings();
|
||||
}
|
||||
|
||||
public void ResetCache()
|
||||
{
|
||||
_ = LoadSystemConnectionStrings();
|
||||
_ = LoadIntezmenyConnectionStrings();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
172
Kreta.KretaServer/Caching/SystemSettingsCache.cs
Normal file
172
Kreta.KretaServer/Caching/SystemSettingsCache.cs
Normal file
|
@ -0,0 +1,172 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.Core;
|
||||
using Kreta.DataAccessManual;
|
||||
using Kreta.DataAccessManual.Interfaces;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework.Caching;
|
||||
using Kreta.KretaServer.Exceptions;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.KretaServer.Caching
|
||||
{
|
||||
public class SystemSettingsCache : GenericCache<SystemSettingsCache.SystemSettingsData>
|
||||
{
|
||||
private static readonly string SystemSettingsCacheKeyPrefix = $"{Constants.Cache.CacheKeyPrefix}{nameof(SystemSettingsCache)}_";
|
||||
private static readonly string SystemSettingsRegionPrefix = $"{Constants.Cache.CacheKeyPrefix}{nameof(SystemSettingsCache)}Region_";
|
||||
|
||||
public SystemSettingsCache(Framework.Caching.CacheManager cacheManager) : base(cacheManager, nameof(SystemSettingsCache))
|
||||
{
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class SystemSettingsData
|
||||
{
|
||||
public RendszerBeallitasTipusEnum BeallitasTipus { get; set; }
|
||||
public SystemSettingsControlTypeEnum Type { get; set; }
|
||||
public string Json { get; set; }
|
||||
public bool IsDisabled { get; set; }
|
||||
}
|
||||
|
||||
private string GetCacheKey(string keyPrefix, RendszerBeallitasTipusEnum beallitasTipus, string intezmenyAzonosito, int tanevId)
|
||||
{
|
||||
return $"{keyPrefix}{intezmenyAzonosito.ToLower()}.{tanevId}.{(int)beallitasTipus}";
|
||||
}
|
||||
|
||||
private static string GetRegionKey(string intezmenyAzonosito) => $"{SystemSettingsRegionPrefix}{intezmenyAzonosito}";
|
||||
|
||||
private SystemSettingsData LoadSystemSettingByType(IRendszerBeallitasDAL dal, RendszerBeallitasTipusEnum beallitasTipus, int tanevId)
|
||||
{
|
||||
var rb = dal.Get(beallitasTipus, tanevId);
|
||||
if (rb != null)
|
||||
{
|
||||
return new SystemSettingsData
|
||||
{
|
||||
Type = (SystemSettingsControlTypeEnum)rb.ErtekTipus,
|
||||
Json = rb.Ertek,
|
||||
BeallitasTipus = (RendszerBeallitasTipusEnum)rb.BeallitasTipus,
|
||||
IsDisabled = rb.IsDisabled
|
||||
};
|
||||
}
|
||||
|
||||
throw new KretaException($"System setting not found: {beallitasTipus}");
|
||||
}
|
||||
|
||||
private SystemSettingsData LoadSystemSettingByType(RendszerBeallitasTipusEnum beallitasTipus, string intezmenyAzonosito, int tanevId)
|
||||
{
|
||||
return Dal.OrganizationConnection.Run(intezmenyAzonosito, h =>
|
||||
{
|
||||
return LoadSystemSettingByType(h.RendszerBeallitas(), beallitasTipus, tanevId);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaad egy rendszerbeállítást
|
||||
/// </summary>
|
||||
public SystemSettingsData GetSystemSetting(RendszerBeallitasTipusEnum beallitasTipus, string intezmenyAzonosito, int tanevId)
|
||||
{
|
||||
var key = GetCacheKey(SystemSettingsCacheKeyPrefix, beallitasTipus, intezmenyAzonosito, tanevId);
|
||||
var region = GetRegionKey(intezmenyAzonosito);
|
||||
|
||||
var result = GetOrAddWithRegion(key, region, (k, r) => LoadSystemSettingByType(beallitasTipus, intezmenyAzonosito, tanevId));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja az összes rendszerbeállítást
|
||||
/// </summary>
|
||||
public List<SystemSettingsData> GetSystemSettings(string intezmenyAzonosito, int tanevId)
|
||||
{
|
||||
return Dal.OrganizationConnection.Run(intezmenyAzonosito, h =>
|
||||
{
|
||||
List<SystemSettingsData> result = new List<SystemSettingsData>();
|
||||
var dal = h.RendszerBeallitas();
|
||||
foreach (RendszerBeallitasTipusEnum beallitasTipus in Enum.GetValues(typeof(RendszerBeallitasTipusEnum)))
|
||||
{
|
||||
var key = GetCacheKey(SystemSettingsCacheKeyPrefix, beallitasTipus, intezmenyAzonosito, tanevId);
|
||||
var region = GetRegionKey(intezmenyAzonosito);
|
||||
|
||||
result.Add(GetOrAddWithRegion(key, region, (k, r) => LoadSystemSettingByType(dal, beallitasTipus, tanevId)));
|
||||
}
|
||||
return result;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ment egy rendszerbeállítás
|
||||
/// </summary>
|
||||
public void SetSystemSettings(RendszerBeallitasTipusEnum beallitasTipus, string intezmenyAzonosito, int tanevId, object settingobject, int? kovTanevId)
|
||||
{
|
||||
Dal.OrganizationConnection.Run(intezmenyAzonosito, h =>
|
||||
{
|
||||
var dal = h.RendszerBeallitas();
|
||||
var rb = dal.Get(beallitasTipus, tanevId);
|
||||
|
||||
if (rb != null)
|
||||
{
|
||||
string json = JsonConvert.SerializeObject(settingobject);
|
||||
rb.Ertek = json;
|
||||
dal.FullUpdate(rb);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Invalid System settings type given");
|
||||
}
|
||||
|
||||
var key = GetCacheKey(SystemSettingsCacheKeyPrefix, beallitasTipus, intezmenyAzonosito, tanevId);
|
||||
var region = GetRegionKey(intezmenyAzonosito);
|
||||
|
||||
var value = LoadSystemSettingByType(dal, beallitasTipus, tanevId);
|
||||
AddOrUpdateWithRegion(key, region, value, k => value);
|
||||
|
||||
if (kovTanevId.IsEntityId())
|
||||
{
|
||||
try
|
||||
{
|
||||
key = GetCacheKey(SystemSettingsCacheKeyPrefix, beallitasTipus, intezmenyAzonosito, (int)kovTanevId);
|
||||
region = GetRegionKey(intezmenyAzonosito);
|
||||
|
||||
value = LoadSystemSettingByType(dal, beallitasTipus, (int)kovTanevId);
|
||||
AddOrUpdateWithRegion(key, region, value, k => value);
|
||||
}
|
||||
catch (KretaException)
|
||||
{
|
||||
// Köv tanév esetén nem foglalkozunk azzal a hibával, hogy nem található a rendszerbeállítás,
|
||||
// mivel új rendszerbeállítás felvételekor nem tudjuk beszúrni a rendszerbeállítás táblába az értéket,
|
||||
// mert nem feltétlen szerepel tanévrendje események köv tanévhez.
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public bool ResetSystemSettings(string intezmenyAzonosito, int? intezmenyID, int? tanevID, List<int> exceptSystemSettings)
|
||||
{
|
||||
return Dal.OrganizationConnection.Run(intezmenyAzonosito, h =>
|
||||
{
|
||||
try
|
||||
{
|
||||
h.RendszerBeallitas().ResetSystemSettings(intezmenyID, tanevID, exceptSystemSettings);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var region = GetRegionKey(intezmenyAzonosito);
|
||||
ClearRegion(region);
|
||||
return true;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void RemoveSystemSetting(RendszerBeallitasTipusEnum beallitasTipus, string intezmenyAzonosito, int tanevId)
|
||||
{
|
||||
var key = GetCacheKey(SystemSettingsCacheKeyPrefix, beallitasTipus, intezmenyAzonosito, tanevId);
|
||||
var region = GetRegionKey(intezmenyAzonosito);
|
||||
|
||||
RemoveFromRegion(key, region);
|
||||
}
|
||||
}
|
||||
}
|
40
Kreta.KretaServer/Exceptions/KretaException.cs
Normal file
40
Kreta.KretaServer/Exceptions/KretaException.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.KretaServer.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Ez az osztály a Neptun kivételek ososztálya, minden Neptun kivételt
|
||||
/// ebbol az osztályból kell származtatni.
|
||||
/// A leszármaztatás során fel kell venni minden nyelven a ClientMessage attribútumot,
|
||||
/// mert ezt az üzenetet kapja meg a kliens. A kliens megkapja továbbá a ClientErrorCode
|
||||
/// attribútum értékét is.
|
||||
///
|
||||
/// Lehet használni az Kreta.Framework.Logging.LogParameter -ben lévo paramétereket is, ezeket
|
||||
/// az m_Parameters-be kell berakni a konstruktorban. Példák a Framework/Util/Exceptions.cs fájlban
|
||||
/// találhatóak.
|
||||
/// </summary>
|
||||
[ErrorCode(Events.NEPTUN_GENERAL)]
|
||||
[FriendlyName(3051, "Ismeretlen Kréta rendszerbeli hiba.")]
|
||||
[LogLevel(LogLevel.WARNING)]
|
||||
public class KretaException : FrameworkException
|
||||
{
|
||||
public KretaException()
|
||||
: this("General business logic error.")
|
||||
{
|
||||
}
|
||||
|
||||
public KretaException(string message)
|
||||
: this(message, null)
|
||||
{
|
||||
}
|
||||
|
||||
public KretaException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
355
Kreta.KretaServer/Kreta.KretaServer.csproj
Normal file
355
Kreta.KretaServer/Kreta.KretaServer.csproj
Normal file
|
@ -0,0 +1,355 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{62EB8504-1C3A-4DB1-AB86-F96B2341E201}</ProjectGuid>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>Kreta.KretaServer</AssemblyName>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Kreta.KretaServer</RootNamespace>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<TargetFrameworkProfile />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG;ADVANCEDCOMMUNICATION</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<UseVSHostingProcess>true</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>true</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>none</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;ADVANCEDCOMMUNICATION</DefineConstants>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<Optimize>true</Optimize>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Framework\Kreta.Framework.csproj">
|
||||
<Project>{320ef478-7155-441d-b1e9-47ec3e57fb45}</Project>
|
||||
<Name>Kreta.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Kreta.Client\Kreta.Client.csproj">
|
||||
<Project>{4b28e52b-b531-403c-a827-2cc178ff8a4f}</Project>
|
||||
<Name>Kreta.Client</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Kreta.Core\Kreta.Core.csproj">
|
||||
<Project>{57418d3e-caf1-482c-9b18-85d147abd495}</Project>
|
||||
<Name>Kreta.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Kreta.DataAccessInterfaceGenerated\Kreta.DataAccess.Interfaces.csproj">
|
||||
<Project>{68318C3F-0779-4755-848E-B270F6BAC40B}</Project>
|
||||
<Name>Kreta.DataAccess.Interfaces</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Kreta.Enums\Kreta.Enums.csproj">
|
||||
<Project>{1d5e0ac2-dfab-4d32-9ad1-b5788a7d06bd}</Project>
|
||||
<Name>Kreta.Enums</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Kreta.Resources\Kreta.Resources.csproj">
|
||||
<Project>{DFCB4D33-B599-42B2-98C6-B60FD220DB0C}</Project>
|
||||
<Name>Kreta.Resources</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Sda.DataProvider\Sda.DataProvider.csproj">
|
||||
<Project>{9ac4fd13-81f5-48ac-aa21-ba774c4dc771}</Project>
|
||||
<Name>Sda.DataProvider</Name>
|
||||
</ProjectReference>
|
||||
<Reference Include="CacheManager.Core, Version=1.2.0.0, Culture=neutral, PublicKeyToken=5b450b4fb65c4cdb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CacheManager.Core.1.2.0\lib\net45\CacheManager.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CacheManager.SystemRuntimeCaching, Version=1.2.0.0, Culture=neutral, PublicKeyToken=5b450b4fb65c4cdb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CacheManager.SystemRuntimeCaching.1.2.0\lib\net45\CacheManager.SystemRuntimeCaching.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Extensions.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Configuration.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.2.0.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Configuration.FileExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Configuration.FileExtensions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.FileExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Configuration.Json, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Configuration.Json.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.FileProviders.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.FileProviders.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.FileProviders.Physical, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.FileProviders.Physical.2.0.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Physical.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.FileSystemGlobbing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.FileSystemGlobbing.2.0.0\lib\netstandard2.0\Microsoft.Extensions.FileSystemGlobbing.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Primitives, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Primitives.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<Name>System.Data</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Linq, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Linq.4.3.0\lib\net463\System.Linq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Caching" />
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.InteropServices.4.3.0\lib\net463\System.Runtime.InteropServices.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Security">
|
||||
<Name>System.Security</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<Name>System.XML</Name>
|
||||
</Reference>
|
||||
<ProjectReference Include="..\Kreta.DataAccessGenerated\Kreta.DataAccessGenerated.csproj">
|
||||
<Project>{B91833B5-0BA0-4E8B-9159-B991F15D3FC4}</Project>
|
||||
<Name>Kreta.DataAccessGenerated</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Kreta.DataAccessManual\Kreta.DataAccessManual.csproj">
|
||||
<Project>{3212f2bf-6883-48b4-9f7d-0dff4c826221}</Project>
|
||||
<Name>Kreta.DataAccessManual</Name>
|
||||
</ProjectReference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Tools\SharedAssemblyInfo.cs">
|
||||
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Caching\ConnectionStringCache.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Caching\SystemSettingsCache.cs" />
|
||||
<Compile Include="Exceptions\KretaException.cs" />
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ServerUtil\KretaConfiguration.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ServerUtil\KretaConnectionManager.cs" />
|
||||
<Compile Include="ServerUtil\KretaServer.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SystemSettings\SettingsTypes\SettingsCheckBox.cs" />
|
||||
<Compile Include="SystemSettings\SettingsTypes\SettingsMultiSelect.cs" />
|
||||
<Compile Include="SystemSettings\SettingsTypes\SettingsCheckBoxGroup.cs" />
|
||||
<Compile Include="SystemSettings\SettingsTypes\SettingsControlBase.cs" />
|
||||
<Compile Include="SystemSettings\SettingsTypes\SettingsNumericTextBox.cs" />
|
||||
<Compile Include="SystemSettings\SettingsTypes\SettingsDatePicker.cs" />
|
||||
<Compile Include="SystemSettings\SettingsTypes\SettingsDropDownList.cs" />
|
||||
<Compile Include="SystemSettings\SettingsTypes\SettingsRadioButtonGroup.cs" />
|
||||
<Compile Include="SystemSettings\SettingsTypes\SettingsSwitchButton.cs" />
|
||||
<Compile Include="SystemSettings\SettingsTypes\SettingsTimePicker.cs" />
|
||||
<Compile Include="SystemSettings\SystemSettingsManager.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ServerConfig.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadata Include="Service References\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Security\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
1
Kreta.KretaServer/Properties/AssemblyInfo.cs
Normal file
1
Kreta.KretaServer/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1 @@
|
|||
|
26
Kreta.KretaServer/Properties/Settings.Designer.cs
generated
Normal file
26
Kreta.KretaServer/Properties/Settings.Designer.cs
generated
Normal file
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Kreta.KretaServer.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.1.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
5
Kreta.KretaServer/Properties/Settings.settings
Normal file
5
Kreta.KretaServer/Properties/Settings.settings
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles />
|
||||
<Settings />
|
||||
</SettingsFile>
|
14
Kreta.KretaServer/ServerConfig.xml
Normal file
14
Kreta.KretaServer/ServerConfig.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0"?>
|
||||
<config secure="0">
|
||||
<server>
|
||||
<name>KRETA</name>
|
||||
<systemtype>Teszt</systemtype>
|
||||
<loglevel>DEBUG</loglevel>
|
||||
<sessiontimeout>46</sessiontimeout>
|
||||
<maxrecordsperrequest>1000000</maxrecordsperrequest>
|
||||
<dbconnection>Data Source=kretalocal;User ID=kreta;Password=Porcica1.;Initial Catalog=Kreta;Connection Timeout=3000;</dbconnection>
|
||||
<!-- <intezmenyconnectionstringfile>IntezmenyConnectionString.json</intezmenyconnectionstringfile> -->
|
||||
<lcid>1038</lcid>
|
||||
<logtoconsole>True</logtoconsole>
|
||||
</server>
|
||||
</config>
|
74
Kreta.KretaServer/ServerUtil/KretaConfiguration.cs
Normal file
74
Kreta.KretaServer/ServerUtil/KretaConfiguration.cs
Normal file
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using Kreta.Framework;
|
||||
|
||||
namespace Kreta.KretaServer
|
||||
{
|
||||
public class KretaConfiguration : Configuration
|
||||
{
|
||||
public KretaConfiguration(XmlNode confignode) : base(confignode)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void ReadConfig(XmlNode confignode)
|
||||
{
|
||||
string xpath = "";
|
||||
|
||||
try
|
||||
{
|
||||
base.ReadConfig(confignode);
|
||||
|
||||
if (!DBConnection.EndsWith(";", StringComparison.Ordinal))
|
||||
{
|
||||
DBConnection += ";";
|
||||
}
|
||||
//if (DBConnection.IndexOf("Max Pool Size", StringComparison.OrdinalIgnoreCase) < 0)
|
||||
// DBConnection += "Max Pool Size=" + (SessionLimit < 100 ? 100 : SessionLimit) + ";";
|
||||
|
||||
XmlNode current = null;
|
||||
xpath = "/config/server/intezmenyconnectionstringfile";
|
||||
if ((current = confignode.SelectSingleNode(xpath)) != null)
|
||||
{
|
||||
intezmenyConnectionStringFile = current.InnerText;
|
||||
if (intezmenyConnectionStringFile.Contains("~") && (HttpContext.Current != null))
|
||||
{
|
||||
intezmenyConnectionStringFile = HttpContext.Current.Server.MapPath(intezmenyConnectionStringFile);
|
||||
}
|
||||
}
|
||||
|
||||
xpath = "/config/server/tesztintezmenyazonosito";
|
||||
if ((current = confignode.SelectSingleNode(xpath)) != null)
|
||||
{
|
||||
tesztIntezmenyAzonosito = current.InnerText;
|
||||
}
|
||||
xpath = "/config/server/mkbbankszamlaigenylesconnectionstringfile";
|
||||
if ((current = confignode.SelectSingleNode(xpath)) != null)
|
||||
{
|
||||
bankszamlaIgenylesConnectionStringFile = current.InnerText;
|
||||
if (bankszamlaIgenylesConnectionStringFile.Contains("~") && (HttpContext.Current != null))
|
||||
{
|
||||
bankszamlaIgenylesConnectionStringFile = HttpContext.Current.Server.MapPath(bankszamlaIgenylesConnectionStringFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (InvalidConfigurationException)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw new InvalidConfigurationException("Invalid configuration entry: " + xpath + ".", exception);
|
||||
}
|
||||
}
|
||||
|
||||
private string intezmenyConnectionStringFile;
|
||||
private string tesztIntezmenyAzonosito;
|
||||
private string bankszamlaIgenylesConnectionStringFile;
|
||||
|
||||
public string IntezmenyConnectionStringFile { get { return intezmenyConnectionStringFile; } }
|
||||
public string BankszamlaIgenylesConnectionStringFile { get { return bankszamlaIgenylesConnectionStringFile; } }
|
||||
|
||||
public string TesztIntezmenyAzonosito { get { return tesztIntezmenyAzonosito; } }
|
||||
}
|
||||
}
|
37
Kreta.KretaServer/ServerUtil/KretaConnectionManager.cs
Normal file
37
Kreta.KretaServer/ServerUtil/KretaConnectionManager.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System.Collections.Generic;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Session;
|
||||
using Kreta.KretaServer.Caching;
|
||||
|
||||
namespace Kreta.KretaServer.ServerUtil
|
||||
{
|
||||
public class KretaConnectionManager : ConnectionManager
|
||||
{
|
||||
private readonly ConnectionStringCache connectionStringCache = SDAServer.Instance.CacheManager.AquireCache<ConnectionStringCache>();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
connectionStringCache.FillCache();
|
||||
}
|
||||
|
||||
public override IEnumerable<string> GetOsszesIntezmeny()
|
||||
{
|
||||
return connectionStringCache.GetOsszesIntezmeny();
|
||||
}
|
||||
|
||||
public override string GetIntezmenyConnectionString(string intezmenyAzonosito)
|
||||
{
|
||||
return connectionStringCache.GetIntezmenyConnectionString(intezmenyAzonosito);
|
||||
}
|
||||
|
||||
public override string GetSystemConnectionString(string intezmenyAzonosito)
|
||||
{
|
||||
return connectionStringCache.GetSystemConnectionString(intezmenyAzonosito);
|
||||
}
|
||||
|
||||
public override IEnumerable<string> GetSystemConnectionStrings()
|
||||
{
|
||||
return connectionStringCache.GetSystemConnectionStrings();
|
||||
}
|
||||
}
|
||||
}
|
152
Kreta.KretaServer/ServerUtil/KretaServer.cs
Normal file
152
Kreta.KretaServer/ServerUtil/KretaServer.cs
Normal file
|
@ -0,0 +1,152 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Session;
|
||||
using Kreta.KretaServer.ServerUtil;
|
||||
|
||||
namespace Kreta.KretaServer
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// A Kréta kiszolgáló.
|
||||
/// </summary>
|
||||
public class KretaServer : SDAApplicationServer
|
||||
{
|
||||
public KretaServer(string configPath) : base(configPath)
|
||||
{
|
||||
}
|
||||
|
||||
public KretaServer(XmlNode configNode) : base(configNode)
|
||||
{
|
||||
}
|
||||
|
||||
public static new KretaServer Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
return (KretaServer)SDAServer.Instance;
|
||||
}
|
||||
}
|
||||
|
||||
public new KretaConfiguration Configuration
|
||||
{
|
||||
get
|
||||
{
|
||||
return (KretaConfiguration)base.Configuration;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Intézményi azonosító kiszedése az URL-ből.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string GetOrganizationIdentifier()
|
||||
{
|
||||
var identifier = Configuration.TesztIntezmenyAzonosito;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(identifier))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (HttpContext.Current != null)
|
||||
{
|
||||
var request = HttpContext.Current.Request.Url.AbsoluteUri;
|
||||
var requestArray = request.Replace("http://", null).Replace("https://", null).Split('.');
|
||||
if (requestArray.Length > 1)
|
||||
{
|
||||
identifier = requestArray[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return identifier;
|
||||
}
|
||||
|
||||
public override string GetIntezmenyConnectionString(string intezmenyAzonosito)
|
||||
{
|
||||
return ConnectionManager.GetIntezmenyConnectionString(intezmenyAzonosito);
|
||||
}
|
||||
|
||||
public override string GetSystemConnectionString(string intezmenyAzonosito)
|
||||
{
|
||||
return ConnectionManager.GetSystemConnectionString(intezmenyAzonosito);
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetOsszesIntezmeny()
|
||||
{
|
||||
return ConnectionManager.GetOsszesIntezmeny();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Karakterlánccá alakítja az objektumot.
|
||||
/// </summary>
|
||||
/// <returns>Az objektum leírása.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
if (Configuration == null)
|
||||
{
|
||||
return "KRETA server";
|
||||
}
|
||||
|
||||
if (IsRunning)
|
||||
{
|
||||
return $"{Configuration.ServerName} server (running)";
|
||||
}
|
||||
|
||||
return $"{Configuration.ServerName} server (stopped)";
|
||||
}
|
||||
|
||||
protected override Configuration DoReadConfiguration(XmlNode configNode)
|
||||
{
|
||||
return new KretaConfiguration(configNode);
|
||||
}
|
||||
|
||||
protected virtual void CreateConnectionManager()
|
||||
{
|
||||
ConnectionManager = new KretaConnectionManager();
|
||||
|
||||
ConnectionManager.Initialize();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elindítja a kiszolgálót.
|
||||
/// </summary>
|
||||
protected override void DoStart()
|
||||
{
|
||||
base.DoStart();
|
||||
|
||||
CreateConnectionManager();
|
||||
|
||||
if (Configuration.SystemType == SystemType.Ismeretlen)
|
||||
{
|
||||
throw new Exception("Nincs beállítva a Kréta rendszer típusa a config-ban!");
|
||||
}
|
||||
|
||||
//TODO: itt lehet finomhangolni a session naplozast amennyiben szukseges. adtam egy alapertelmezett implementaciot, ami csak signon/signoff esetben
|
||||
//naploz, hogy csokkentsem a dbhez fordulasok szamat. ha ettol pontosabb kep kell akkor be lehet kapcsolni az activate/deactivate lehetoseget is
|
||||
//Ha valakinek nem tetszik az altalam adott implementacio a naplora itt kotheti be a sajatjat.
|
||||
//glhf ^.^;
|
||||
this.SessionManager.SessionCreated += new SessionCreatedEventHandler(new Framework.Session.Instrumentation.SessionLogger().SessionCreated);
|
||||
this.SessionManager.SessionDeleted += new SessionDeletedEventHandler(new Framework.Session.Instrumentation.SessionLogger().SessionDeleted);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Leállítja a kiszolgálót.
|
||||
/// </summary>
|
||||
protected override void DoStop()
|
||||
{
|
||||
base.DoStop();
|
||||
}
|
||||
|
||||
protected override SessionManager CreateSessionManager(Configuration configuration, Framework.Caching.CacheManager cacheManager)
|
||||
{
|
||||
return new SessionManager(configuration, cacheManager);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
namespace Kreta.KretaServer.SystemSettings.SettingsTypes
|
||||
{
|
||||
public class SettingsCheckBox : SettingsControlBase
|
||||
{
|
||||
public bool IsSelected { get; set; }
|
||||
|
||||
public int StringResourcesID { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Kreta.KretaServer.SystemSettings.SettingsTypes
|
||||
{
|
||||
public class SettingsCheckBoxGroup : SettingsControlBase
|
||||
{
|
||||
public SettingsCheckBoxGroup()
|
||||
{
|
||||
Options = new List<SelectListItem>();
|
||||
}
|
||||
|
||||
public List<SelectListItem> Options { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
namespace Kreta.KretaServer.SystemSettings.SettingsTypes
|
||||
{
|
||||
public abstract class SettingsControlBase
|
||||
{
|
||||
public string Id { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.KretaServer.SystemSettings.SettingsTypes
|
||||
{
|
||||
public class SettingsDatePicker : SettingsControlBase
|
||||
{
|
||||
public DateTime? Date { get; set; }
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
public DateTime? Min { get; set; }
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
public DateTime? Max { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Kreta.KretaServer.SystemSettings.SettingsTypes
|
||||
{
|
||||
public class SettingsDropDownList : SettingsControlBase
|
||||
{
|
||||
public SettingsDropDownList()
|
||||
{
|
||||
Options = new List<SelectListItem>();
|
||||
}
|
||||
|
||||
public List<SelectListItem> Options { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Kreta.KretaServer.SystemSettings.SettingsTypes
|
||||
{
|
||||
public class SettingsMultiSelect : SettingsControlBase
|
||||
{
|
||||
public SettingsMultiSelect()
|
||||
{
|
||||
Options = new List<SelectListItem>();
|
||||
}
|
||||
|
||||
public List<SelectListItem> Options { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
namespace Kreta.KretaServer.SystemSettings.SettingsTypes
|
||||
{
|
||||
public class SettingsNumericTextBox : SettingsControlBase
|
||||
{
|
||||
public double Value { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Kreta.KretaServer.SystemSettings.SettingsTypes
|
||||
{
|
||||
public class SettingsRadioButtonGroup : SettingsControlBase
|
||||
{
|
||||
public SettingsRadioButtonGroup()
|
||||
{
|
||||
Options = new List<SelectListItem>();
|
||||
}
|
||||
|
||||
public List<SelectListItem> Options { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
namespace Kreta.KretaServer.SystemSettings.SettingsTypes
|
||||
{
|
||||
public class SettingsSwitchButton : SettingsControlBase
|
||||
{
|
||||
public bool Value { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.KretaServer.SystemSettings.SettingsTypes
|
||||
{
|
||||
public class SettingsTimePicker : SettingsControlBase
|
||||
{
|
||||
public TimeSpan Time { get; set; }
|
||||
}
|
||||
}
|
389
Kreta.KretaServer/SystemSettings/SystemSettingsManager.cs
Normal file
389
Kreta.KretaServer/SystemSettings/SystemSettingsManager.cs
Normal file
|
@ -0,0 +1,389 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework;
|
||||
using Kreta.KretaServer.Caching;
|
||||
using Kreta.KretaServer.SystemSettings.SettingsTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.KretaServer.SystemSettings
|
||||
{
|
||||
public static class SystemSettingsManager
|
||||
{
|
||||
private static T DeserializeControlObject<T>(string json, SystemSettingsControlTypeEnum controlType)
|
||||
{
|
||||
Type typeinfo = null;
|
||||
switch (controlType)
|
||||
{
|
||||
case SystemSettingsControlTypeEnum.CheckBox:
|
||||
typeinfo = typeof(SettingsCheckBox);
|
||||
break;
|
||||
case SystemSettingsControlTypeEnum.CheckBoxGroup:
|
||||
typeinfo = typeof(SettingsCheckBoxGroup);
|
||||
break;
|
||||
case SystemSettingsControlTypeEnum.DatePicker:
|
||||
typeinfo = typeof(SettingsDatePicker);
|
||||
break;
|
||||
case SystemSettingsControlTypeEnum.TimePicker:
|
||||
typeinfo = typeof(SettingsTimePicker);
|
||||
break;
|
||||
case SystemSettingsControlTypeEnum.NumericTextBox:
|
||||
typeinfo = typeof(SettingsNumericTextBox);
|
||||
break;
|
||||
case SystemSettingsControlTypeEnum.DropDownList:
|
||||
typeinfo = typeof(SettingsDropDownList);
|
||||
break;
|
||||
case SystemSettingsControlTypeEnum.RadioButtonGroup:
|
||||
typeinfo = typeof(SettingsRadioButtonGroup);
|
||||
break;
|
||||
case SystemSettingsControlTypeEnum.TrueFalse:
|
||||
typeinfo = typeof(SettingsSwitchButton);
|
||||
break;
|
||||
case SystemSettingsControlTypeEnum.MultiSelect:
|
||||
typeinfo = typeof(SettingsMultiSelect);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (T)JsonConvert.DeserializeObject(json, typeinfo);
|
||||
}
|
||||
/// <summary>
|
||||
/// Visszaadja az adotr rendszerbeállítás értékét.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Enum, String, int, bool, List<int>, List<string> List<Enum></typeparam>
|
||||
/// <param name="beallitasTipus"></param>
|
||||
/// <returns>
|
||||
/// Az adott beállítás értéke a megadott típusba vagy a megadott tipus alap értéke ha nincs érték PL: CheckBoxGroup.
|
||||
/// </returns>
|
||||
public static T GetSystemSettingValue<T>(RendszerBeallitasTipusEnum beallitasTipus, string intezmenyAzonosito, int tanevId)
|
||||
{
|
||||
var setting = SDAServer.Instance.CacheManager.AquireCache<SystemSettingsCache>().GetSystemSetting(beallitasTipus, intezmenyAzonosito, tanevId);
|
||||
var inputType = typeof(T);
|
||||
switch (setting.Type)
|
||||
{
|
||||
case SystemSettingsControlTypeEnum.CheckBox:
|
||||
var checkBox = DeserializeControlObject<SettingsCheckBox>(setting.Json, setting.Type);
|
||||
{
|
||||
if (inputType.Equals(typeof(string)))
|
||||
{
|
||||
return (T)((object)checkBox.IsSelected.ToString());
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(bool)))
|
||||
{
|
||||
return (T)((object)checkBox.IsSelected);
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
case SystemSettingsControlTypeEnum.CheckBoxGroup:
|
||||
var checkBoxGroup = DeserializeControlObject<SettingsCheckBoxGroup>(setting.Json, setting.Type);
|
||||
{
|
||||
if (inputType.Equals(typeof(string)))
|
||||
{
|
||||
var selectedOptions = string.Join(",", checkBoxGroup.Options.Where(x => x.Selected).Select(y => y.Value).ToArray());
|
||||
return (T)((object)selectedOptions);
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(List<string>)))
|
||||
{
|
||||
var stringList = new List<string>();
|
||||
foreach (var box in checkBoxGroup.Options)
|
||||
{
|
||||
if (box.Selected)
|
||||
{
|
||||
stringList.Add(box.Value);
|
||||
}
|
||||
}
|
||||
return (T)((object)stringList);
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(List<int>)))
|
||||
{
|
||||
var intList = new List<int>();
|
||||
foreach (var box in checkBoxGroup.Options)
|
||||
{
|
||||
int optionValue;
|
||||
if (box.Selected)
|
||||
{
|
||||
if (int.TryParse(box.Value, out optionValue))
|
||||
{
|
||||
intList.Add(optionValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return (T)((object)intList);
|
||||
}
|
||||
}
|
||||
|
||||
var nestedTypes = inputType.GetGenericArguments();
|
||||
if (nestedTypes.Length == 1 && nestedTypes[0].IsEnum)
|
||||
{
|
||||
var nestedType = nestedTypes[0];
|
||||
var enumlist = (IList)Activator.CreateInstance(inputType);
|
||||
|
||||
foreach (var box in checkBoxGroup.Options)
|
||||
{
|
||||
int enumvalue;
|
||||
if (int.TryParse(box.Value, out enumvalue) && Enum.IsDefined(nestedType, enumvalue))
|
||||
{
|
||||
enumlist.Add(Enum.Parse(nestedType, box.Value));
|
||||
}
|
||||
}
|
||||
|
||||
return (T)(enumlist);
|
||||
}
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
case SystemSettingsControlTypeEnum.DatePicker:
|
||||
var datePicker = DeserializeControlObject<SettingsDatePicker>(setting.Json, setting.Type);
|
||||
{
|
||||
if (inputType.Equals(typeof(string)))
|
||||
{
|
||||
return (T)((object)datePicker.Date.ToString());
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(DateTime)))
|
||||
{
|
||||
return (T)((object)datePicker.Date);
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(DateTime?)))
|
||||
{
|
||||
if (datePicker.Date.HasValue)
|
||||
{
|
||||
return (T)((object)datePicker.Date.Value);
|
||||
}
|
||||
|
||||
return (T)(object)null;
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
case SystemSettingsControlTypeEnum.TimePicker:
|
||||
var timePicker = DeserializeControlObject<SettingsTimePicker>(setting.Json, setting.Type);
|
||||
{
|
||||
if (inputType.Equals(typeof(string)))
|
||||
{
|
||||
return (T)((object)timePicker.Time.ToString());
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(TimeSpan)))
|
||||
{
|
||||
return (T)((object)timePicker.Time);
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
case SystemSettingsControlTypeEnum.NumericTextBox:
|
||||
var numericTextBox = DeserializeControlObject<SettingsNumericTextBox>(setting.Json, setting.Type);
|
||||
{
|
||||
if (inputType.Equals(typeof(string)))
|
||||
{
|
||||
return (T)((object)numericTextBox.Value.ToString());
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(int)) || inputType.Equals(typeof(double)))
|
||||
{
|
||||
return (T)((object)numericTextBox.Value);
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
case SystemSettingsControlTypeEnum.DropDownList:
|
||||
|
||||
var dropDown = DeserializeControlObject<SettingsDropDownList>(setting.Json, setting.Type);
|
||||
var value = dropDown.Options.First(x => x.Selected == true).Value;
|
||||
{
|
||||
if (inputType.Equals(typeof(string)))
|
||||
{
|
||||
|
||||
return (T)((object)value);
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(int)))
|
||||
{
|
||||
int result;
|
||||
if (int.TryParse(value, out result))
|
||||
{
|
||||
return (T)((object)result);
|
||||
}
|
||||
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
}
|
||||
|
||||
if (inputType.IsEnum)
|
||||
{
|
||||
int valueInt;
|
||||
|
||||
if (int.TryParse(value, out valueInt) && Enum.IsDefined(inputType, valueInt))
|
||||
{
|
||||
return (T)Enum.Parse(inputType, valueInt.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
case SystemSettingsControlTypeEnum.RadioButtonGroup:
|
||||
var radiobuttonGroup = DeserializeControlObject<SettingsRadioButtonGroup>(setting.Json, setting.Type);
|
||||
var selected = radiobuttonGroup.Options.First(x => x.Selected).Value;
|
||||
{
|
||||
if (inputType.Equals(typeof(string)))
|
||||
{
|
||||
|
||||
return (T)((object)selected);
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(int)))
|
||||
{
|
||||
int result;
|
||||
if (int.TryParse(selected, out result))
|
||||
{
|
||||
return (T)((object)result);
|
||||
}
|
||||
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
}
|
||||
|
||||
if (inputType.IsEnum)
|
||||
{
|
||||
int enumInt;
|
||||
|
||||
if (int.TryParse(selected, out enumInt) && Enum.IsDefined(inputType, enumInt))
|
||||
{
|
||||
return (T)Enum.Parse(inputType, enumInt.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
case SystemSettingsControlTypeEnum.TrueFalse:
|
||||
var switchbutton = DeserializeControlObject<SettingsSwitchButton>(setting.Json, setting.Type);
|
||||
{
|
||||
if (inputType.Equals(typeof(string)))
|
||||
{
|
||||
return (T)((object)switchbutton.Value.ToString());
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(bool)))
|
||||
{
|
||||
return (T)((object)switchbutton.Value);
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
case SystemSettingsControlTypeEnum.MultiSelect:
|
||||
var multiSelect = DeserializeControlObject<SettingsMultiSelect>(setting.Json, setting.Type);
|
||||
{
|
||||
if (inputType.Equals(typeof(string)))
|
||||
{
|
||||
var selectedOptions = string.Join(",", multiSelect.Options.Where(x => x.Selected).Select(y => y.Value).ToArray());
|
||||
return (T)((object)selectedOptions);
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(List<string>)))
|
||||
{
|
||||
var stringList = new List<string>();
|
||||
foreach (var box in multiSelect.Options)
|
||||
{
|
||||
if (box.Selected)
|
||||
{
|
||||
stringList.Add(box.Value);
|
||||
}
|
||||
}
|
||||
return (T)((object)stringList);
|
||||
}
|
||||
|
||||
if (inputType.Equals(typeof(List<int>)))
|
||||
{
|
||||
var intList = new List<int>();
|
||||
foreach (var box in multiSelect.Options)
|
||||
{
|
||||
int optionValue;
|
||||
if (box.Selected)
|
||||
{
|
||||
if (int.TryParse(box.Value, out optionValue))
|
||||
{
|
||||
intList.Add(optionValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return (T)((object)intList);
|
||||
}
|
||||
}
|
||||
|
||||
var nestedMultiTypes = inputType.GetGenericArguments();
|
||||
if (nestedMultiTypes.Length == 1 && nestedMultiTypes[0].IsEnum)
|
||||
{
|
||||
var nestedType = nestedMultiTypes[0];
|
||||
var enumlist = (IList)Activator.CreateInstance(inputType);
|
||||
|
||||
foreach (var box in multiSelect.Options)
|
||||
{
|
||||
int enumvalue;
|
||||
if (int.TryParse(box.Value, out enumvalue) && Enum.IsDefined(nestedType, enumvalue))
|
||||
{
|
||||
enumlist.Add(Enum.Parse(nestedType, box.Value));
|
||||
}
|
||||
}
|
||||
|
||||
return (T)(enumlist);
|
||||
}
|
||||
throw new InvalidCastException(string.Format("Can not cast setting value string to a given Type of {0}", inputType.ToString()));
|
||||
default:
|
||||
throw new NotSupportedException("The given SystemSettingsControl Type is unsupportd by the method!");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Beállítja az adott beállítás értékét.
|
||||
/// </summary>
|
||||
/// <param name="settingType">Rendszerbeállítás tipus</param>
|
||||
/// <param name="settingObject">
|
||||
/// SystemSettingType object
|
||||
/// </param>
|
||||
public static void SetSystemSettings(RendszerBeallitasTipusEnum settingType, string intezmenyAzonosito, int tanevId, object settingObject, int? kovTanevId)
|
||||
{
|
||||
SDAServer.Instance.CacheManager.AquireCache<SystemSettingsCache>().SetSystemSettings(settingType, intezmenyAzonosito, tanevId, settingObject, kovTanevId);
|
||||
}
|
||||
/// <summary>
|
||||
/// Visszaállítja az alapértékeket a db-ben majd frissiti a cachet
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool ResetSystemSettings(string intezmenyAzonosito, int? intezmenyID, int? tanevID, List<int> exceptSystemSettings)
|
||||
{
|
||||
return SDAServer.Instance.CacheManager.AquireCache<SystemSettingsCache>().ResetSystemSettings(intezmenyAzonosito, intezmenyID, tanevID, exceptSystemSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja az összes rednszerbeállítás leíró objektumot.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<SystemSettingsCache.SystemSettingsData> GetSystemSettings(string intezmenyAzonosito, int tanevId)
|
||||
{
|
||||
return SDAServer.Instance.CacheManager.AquireCache<SystemSettingsCache>().GetSystemSettings(intezmenyAzonosito, tanevId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja a rendszerbeállítás osztály. Tartalmazza a rendszerbeállítás tipusát, json stringet és a json object tipusát
|
||||
/// </summary>
|
||||
/// <param name="beallitasTipus"></param>
|
||||
/// <returns></returns>
|
||||
public static SystemSettingsCache.SystemSettingsData GetSystemSetting(RendszerBeallitasTipusEnum beallitasTipus, string intezmenyAzonosito, int tanevId)
|
||||
{
|
||||
return SDAServer.Instance.CacheManager.AquireCache<SystemSettingsCache>().GetSystemSetting(beallitasTipus, intezmenyAzonosito, tanevId);
|
||||
}
|
||||
}
|
||||
}
|
48
Kreta.KretaServer/app.config
Normal file
48
Kreta.KretaServer/app.config
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.Configuration.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.1.0" newVersion="2.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.FileProviders.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.Configuration.FileExtensions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.FileProviders.Physical" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.Configuration" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="CacheManager.Core" publicKeyToken="5b450b4fb65c4cdb" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.2.0.0" newVersion="1.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
30
Kreta.KretaServer/packages.config
Normal file
30
Kreta.KretaServer/packages.config
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="CacheManager.Core" version="1.2.0" targetFramework="net48" />
|
||||
<package id="CacheManager.SystemRuntimeCaching" version="1.2.0" targetFramework="net48" />
|
||||
<package id="Meziantou.Analyzer" version="1.0.688" targetFramework="net48" developmentDependency="true" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.6" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Configuration" version="2.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Configuration.Abstractions" version="2.0.1" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Configuration.FileExtensions" version="2.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Configuration.Json" version="2.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.FileProviders.Abstractions" version="2.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.FileProviders.Physical" version="2.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.FileSystemGlobbing" version="2.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Primitives" version="2.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
<package id="System.Collections" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.IO" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Linq" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Runtime" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Threading" version="4.3.0" targetFramework="net48" />
|
||||
</packages>
|
Loading…
Add table
Add a link
Reference in a new issue