init
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
//https://cpratt.co/async-tips-tricks/
|
||||
//https://www.ryadel.com/en/asyncutil-c-helper-class-async-method-sync-result-wait/
|
||||
/// <summary>
|
||||
/// Helper class to run async methods within a sync process.
|
||||
/// </summary>
|
||||
public static class AsyncUtil
|
||||
{
|
||||
private static readonly TaskFactory _taskFactory = new
|
||||
TaskFactory(CancellationToken.None,
|
||||
TaskCreationOptions.None,
|
||||
TaskContinuationOptions.None,
|
||||
TaskScheduler.Default);
|
||||
|
||||
/// <summary>
|
||||
/// Executes an async Task method which has a void return value synchronously
|
||||
/// USAGE: AsyncUtil.RunSync(() => AsyncMethod());
|
||||
/// </summary>
|
||||
/// <param name="task">Task method to execute</param>
|
||||
public static void RunSync(Func<Task> task)
|
||||
=> _taskFactory
|
||||
.StartNew(task)
|
||||
.Unwrap()
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
/// <summary>
|
||||
/// Executes an async Task<T> method which has a T return type synchronously
|
||||
/// USAGE: T result = AsyncUtil.RunSync(() => AsyncMethod<T>());
|
||||
/// </summary>
|
||||
/// <typeparam name="TResult">Return Type</typeparam>
|
||||
/// <param name="task">Task<T> method to execute</param>
|
||||
/// <returns></returns>
|
||||
public static TResult RunSync<TResult>(Func<Task<TResult>> task)
|
||||
=> _taskFactory
|
||||
.StartNew(task)
|
||||
.Unwrap()
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.Caching;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
public static class Cache
|
||||
{
|
||||
private static readonly MemoryCache DefaultCache = new MemoryCache("DefaultCache");
|
||||
|
||||
private static readonly CacheItemPolicy DefaultPolicy = new CacheItemPolicy { SlidingExpiration = TimeSpan.FromSeconds(30) };
|
||||
|
||||
[Pure]
|
||||
public static Guid Add(object value)
|
||||
{
|
||||
var guid = Guid.NewGuid();
|
||||
DefaultCache.Add(new CacheItem($"{guid}", value), DefaultPolicy);
|
||||
return guid;
|
||||
}
|
||||
|
||||
public static bool Add(string key, object value, CacheItemPolicy cacheItemPolicy)
|
||||
{
|
||||
return DefaultCache.Add(new CacheItem(key, value), cacheItemPolicy);
|
||||
}
|
||||
|
||||
public static T AddOrGetExisting<T>(string key, T value, CacheItemPolicy cacheItemPolicy)
|
||||
{
|
||||
object existingValue = DefaultCache.AddOrGetExisting(key, value, cacheItemPolicy);
|
||||
return (existingValue != null) ? (T)existingValue : value;
|
||||
}
|
||||
|
||||
public static void Set(string key, object value, CacheItemPolicy cacheItemPolicy)
|
||||
{
|
||||
DefaultCache.Set(new CacheItem(key, value), cacheItemPolicy);
|
||||
}
|
||||
|
||||
[Pure]
|
||||
public static object Get(Guid guid)
|
||||
{
|
||||
return DefaultCache.Get($"{guid}");
|
||||
}
|
||||
|
||||
[Pure]
|
||||
public static object Get(string key)
|
||||
{
|
||||
return DefaultCache.Get(key);
|
||||
}
|
||||
|
||||
[Pure]
|
||||
public static void Remove(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
DefaultCache.Remove(key);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using Kreta.Core.Configuratiaton.Interface;
|
||||
|
||||
namespace Kreta.Core.Configuratiaton
|
||||
{
|
||||
public class ApiKeyConfiguration : ConfigurationSection, IApiKeyConfiguration
|
||||
{
|
||||
private static readonly Lazy<ApiKeyConfiguration> instance = new Lazy<ApiKeyConfiguration>(() => (ApiKeyConfiguration)ConfigurationManager.GetSection(nameof(ApiKeyConfiguration)));
|
||||
|
||||
private ApiKeyConfiguration()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static ApiKeyConfiguration Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
return instance.Value;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty(nameof(ApiKey), IsRequired = true)]
|
||||
public string ApiKey => (string)base[nameof(ApiKey)];
|
||||
|
||||
[ConfigurationProperty(nameof(Enabled), IsRequired = true)]
|
||||
public bool Enabled => (bool)base[nameof(Enabled)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.Configuratiaton
|
||||
{
|
||||
public class EESZTConfiguration : ConfigurationSection
|
||||
{
|
||||
[ConfigurationProperty(nameof(InterfaceUrl), IsRequired = true)]
|
||||
public string InterfaceUrl => (string)this[nameof(InterfaceUrl)];
|
||||
|
||||
[ConfigurationProperty(nameof(ClientUserId), IsRequired = true)]
|
||||
public string ClientUserId => (string)this[nameof(ClientUserId)];
|
||||
|
||||
[ConfigurationProperty(nameof(OrganizationId), IsRequired = true)]
|
||||
public string OrganizationId => (string)this[nameof(OrganizationId)];
|
||||
|
||||
/// <summary>
|
||||
/// Címzettek címei ';'-vel elválasztva
|
||||
/// </summary>
|
||||
[ConfigurationProperty(nameof(MailToAddresses), IsRequired = false)]
|
||||
public string MailToAddresses => (string)this[nameof(MailToAddresses)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Configuration;
|
||||
using Kreta.Core.Configuratiaton.Interface;
|
||||
|
||||
namespace Kreta.Core.Configuratiaton
|
||||
{
|
||||
public class FirebaseConfiguration : ConfigurationSection, IFirebaseConfiguration
|
||||
{
|
||||
[ConfigurationProperty(nameof(ApiKey), IsRequired = true)]
|
||||
public string ApiKey => (string)base[nameof(ApiKey)];
|
||||
|
||||
[ConfigurationProperty(nameof(AuthDomain), IsRequired = true)]
|
||||
public string AuthDomain => (string)base[nameof(AuthDomain)];
|
||||
|
||||
[ConfigurationProperty(nameof(DatabaseURL), IsRequired = true)]
|
||||
public string DatabaseURL => (string)base[nameof(DatabaseURL)];
|
||||
|
||||
[ConfigurationProperty(nameof(ProjectId), IsRequired = true)]
|
||||
public string ProjectId => (string)base[nameof(ProjectId)];
|
||||
|
||||
[ConfigurationProperty(nameof(StorageBucket), IsRequired = true)]
|
||||
public string StorageBucket => (string)base[nameof(StorageBucket)];
|
||||
|
||||
[ConfigurationProperty(nameof(MessagingSenderId), IsRequired = true)]
|
||||
public string MessagingSenderId => (string)base[nameof(MessagingSenderId)];
|
||||
|
||||
[ConfigurationProperty(nameof(AppId), IsRequired = true)]
|
||||
public string AppId => (string)base[nameof(AppId)];
|
||||
|
||||
[ConfigurationProperty(nameof(MeasurementId), IsRequired = false)]
|
||||
public string MeasurementId => (string)base[nameof(MeasurementId)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Kreta.Core.Configuratiaton.Interface
|
||||
{
|
||||
public interface IApiKeyConfiguration
|
||||
{
|
||||
string ApiKey { get; }
|
||||
|
||||
bool Enabled { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace Kreta.Core.Configuratiaton.Interface
|
||||
{
|
||||
public interface IBankszamlaIgenylesConfiguration
|
||||
{
|
||||
string FormUrl { get; }
|
||||
|
||||
string PublicKeyFileName { get; }
|
||||
|
||||
string PublicKeyFilePassword { get; }
|
||||
|
||||
string PrivateKeyFileName { get; }
|
||||
|
||||
string PrivateKeyFilePassword { get; }
|
||||
|
||||
string ArrivedFilePathRoot { get; }
|
||||
|
||||
string EmailAddress { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace Kreta.Core.Configuratiaton.Interface
|
||||
{
|
||||
public interface IFirebaseConfiguration
|
||||
{
|
||||
string ApiKey { get; }
|
||||
string AuthDomain { get; }
|
||||
string DatabaseURL { get; }
|
||||
string ProjectId { get; }
|
||||
string StorageBucket { get; }
|
||||
string MessagingSenderId { get; }
|
||||
string AppId { get; }
|
||||
string MeasurementId { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Kreta.Core.Configuratiaton.Interface
|
||||
{
|
||||
public interface IKozpontiKretaConfiguration
|
||||
{
|
||||
string KtrUrl { get; }
|
||||
string KgrUrl { get; }
|
||||
string ApiKey { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Kreta.Core.Configuratiaton.Interface
|
||||
{
|
||||
public interface ILepConfiguration
|
||||
{
|
||||
string Url { get; }
|
||||
string UserName { get; }
|
||||
string Password { get; }
|
||||
string ClientId { get; }
|
||||
string ClientSecret { get; }
|
||||
string ApiKey { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Kreta.Core.Configuratiaton.Interface
|
||||
{
|
||||
public interface IMkbBankszamlaIgenylesConfiguration : IBankszamlaIgenylesConfiguration
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Kreta.Core.Configuratiaton.Interface
|
||||
{
|
||||
public interface IOtpBankszamlaIgenylesConfiguration : IBankszamlaIgenylesConfiguration
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Kreta.Core.Configuratiaton.Interface
|
||||
{
|
||||
public interface ITananyagtarConfiguration
|
||||
{
|
||||
string Url { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Configuration;
|
||||
using Kreta.Core.Configuratiaton.Interface;
|
||||
|
||||
namespace Kreta.Core.Configuratiaton
|
||||
{
|
||||
public class KozpontiKretaConfiguration : ConfigurationSection, IKozpontiKretaConfiguration
|
||||
{
|
||||
[ConfigurationProperty(nameof(KtrUrl), IsRequired = true)]
|
||||
public string KtrUrl => (string)this[nameof(KtrUrl)];
|
||||
|
||||
[ConfigurationProperty(nameof(KgrUrl), IsRequired = true)]
|
||||
public string KgrUrl => (string)this[nameof(KgrUrl)];
|
||||
|
||||
[ConfigurationProperty(nameof(ApiKey), IsRequired = true)]
|
||||
public string ApiKey => (string)this[nameof(ApiKey)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Configuration;
|
||||
using Kreta.Core.Configuratiaton.Interface;
|
||||
|
||||
namespace Kreta.Core.Configuratiaton
|
||||
{
|
||||
public class LepConfiguration : ConfigurationSection, ILepConfiguration
|
||||
{
|
||||
[ConfigurationProperty(nameof(Url), IsRequired = true)]
|
||||
public string Url => (string)this[nameof(Url)];
|
||||
|
||||
[ConfigurationProperty(nameof(UserName), IsRequired = true)]
|
||||
public string UserName => (string)this[nameof(UserName)];
|
||||
|
||||
[ConfigurationProperty(nameof(Password), IsRequired = true)]
|
||||
public string Password => (string)this[nameof(Password)];
|
||||
|
||||
[ConfigurationProperty(nameof(ClientId), IsRequired = true)]
|
||||
public string ClientId => (string)this[nameof(ClientId)];
|
||||
|
||||
[ConfigurationProperty(nameof(ClientSecret), IsRequired = true)]
|
||||
public string ClientSecret => (string)this[nameof(ClientSecret)];
|
||||
|
||||
[ConfigurationProperty(nameof(ApiKey), IsRequired = true)]
|
||||
public string ApiKey => (string)this[nameof(ApiKey)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Configuration;
|
||||
using Kreta.Core.Configuratiaton.Interface;
|
||||
|
||||
namespace Kreta.Core.Configuratiaton
|
||||
{
|
||||
public class MkbBankszamlaIgenylesConfiguration : ConfigurationSection, IMkbBankszamlaIgenylesConfiguration
|
||||
{
|
||||
[ConfigurationProperty(nameof(FormUrl), IsRequired = true)]
|
||||
public string FormUrl => (string)this[nameof(FormUrl)];
|
||||
|
||||
[ConfigurationProperty(nameof(PublicKeyFileName), IsRequired = true)]
|
||||
public string PublicKeyFileName => (string)this[nameof(PublicKeyFileName)];
|
||||
|
||||
[ConfigurationProperty(nameof(PublicKeyFilePassword), IsRequired = true)]
|
||||
public string PublicKeyFilePassword => (string)this[nameof(PublicKeyFilePassword)];
|
||||
|
||||
[ConfigurationProperty(nameof(PrivateKeyFileName), IsRequired = true)]
|
||||
public string PrivateKeyFileName => (string)this[nameof(PrivateKeyFileName)];
|
||||
|
||||
[ConfigurationProperty(nameof(PrivateKeyFilePassword), IsRequired = true)]
|
||||
public string PrivateKeyFilePassword => (string)this[nameof(PrivateKeyFilePassword)];
|
||||
|
||||
[ConfigurationProperty(nameof(ArrivedFilePathRoot), IsRequired = true)]
|
||||
public string ArrivedFilePathRoot => (string)this[nameof(ArrivedFilePathRoot)];
|
||||
|
||||
[ConfigurationProperty(nameof(EmailAddress), IsRequired = true)]
|
||||
public string EmailAddress => (string)this[nameof(EmailAddress)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Configuration;
|
||||
using Kreta.Core.Configuratiaton.Interface;
|
||||
|
||||
namespace Kreta.Core.Configuratiaton
|
||||
{
|
||||
public class OtpBankszamlaIgenylesConfiguration : ConfigurationSection, IOtpBankszamlaIgenylesConfiguration
|
||||
{
|
||||
[ConfigurationProperty(nameof(FormUrl), IsRequired = true)]
|
||||
public string FormUrl => (string)this[nameof(FormUrl)];
|
||||
|
||||
[ConfigurationProperty(nameof(PublicKeyFileName), IsRequired = true)]
|
||||
public string PublicKeyFileName => (string)this[nameof(PublicKeyFileName)];
|
||||
|
||||
[ConfigurationProperty(nameof(PublicKeyFilePassword), IsRequired = true)]
|
||||
public string PublicKeyFilePassword => (string)this[nameof(PublicKeyFilePassword)];
|
||||
|
||||
[ConfigurationProperty(nameof(PrivateKeyFileName), IsRequired = true)]
|
||||
public string PrivateKeyFileName => (string)this[nameof(PrivateKeyFileName)];
|
||||
|
||||
[ConfigurationProperty(nameof(PrivateKeyFilePassword), IsRequired = true)]
|
||||
public string PrivateKeyFilePassword => (string)this[nameof(PrivateKeyFilePassword)];
|
||||
|
||||
[ConfigurationProperty(nameof(ArrivedFilePathRoot), IsRequired = true)]
|
||||
public string ArrivedFilePathRoot => (string)this[nameof(ArrivedFilePathRoot)];
|
||||
|
||||
[ConfigurationProperty(nameof(EmailAddress), IsRequired = true)]
|
||||
public string EmailAddress => (string)this[nameof(EmailAddress)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Configuration;
|
||||
using Kreta.Core.Configuratiaton.Interface;
|
||||
|
||||
namespace Kreta.Core.Configuratiaton
|
||||
{
|
||||
public class TananyagtarConfiguration : ConfigurationSection, ITananyagtarConfiguration
|
||||
{
|
||||
[ConfigurationProperty(nameof(Url), IsRequired = true)]
|
||||
public string Url => (string)base[nameof(Url)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace Kreta.Core.ConnectionType
|
||||
{
|
||||
public class ConnectionTypeBase : IConnectionType
|
||||
{
|
||||
private ConnectionTypeBase() { }
|
||||
|
||||
protected ConnectionTypeBase(int felhasznaloId, int intezmenyId, string intezmenyAzonosito, int tanevId)
|
||||
{
|
||||
FelhasznaloId = felhasznaloId;
|
||||
IntezmenyId = intezmenyId;
|
||||
IntezmenyAzonosito = intezmenyAzonosito ?? throw new ArgumentNullException(nameof(intezmenyAzonosito));
|
||||
TanevId = tanevId;
|
||||
}
|
||||
|
||||
public int FelhasznaloId { get; }
|
||||
|
||||
public int IntezmenyId { get; }
|
||||
|
||||
public string IntezmenyAzonosito { get; }
|
||||
|
||||
public int TanevId { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Kreta.Core.ConnectionType
|
||||
{
|
||||
public interface IConnectionType
|
||||
{
|
||||
int FelhasznaloId { get; }
|
||||
int IntezmenyId { get; }
|
||||
string IntezmenyAzonosito { get; }
|
||||
int TanevId { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Kreta.Core.ConnectionType
|
||||
{
|
||||
public sealed class MobileConnectionType : ConnectionTypeBase
|
||||
{
|
||||
public MobileConnectionType(int felhasznaloId, int intezmenyId, string intezmenyAzonosito, int tanevId) : base(felhasznaloId, intezmenyId, intezmenyAzonosito, tanevId) { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Kreta.Core.ConnectionType
|
||||
{
|
||||
public sealed class OrganizationConnectionType : ConnectionTypeBase
|
||||
{
|
||||
public OrganizationConnectionType(int felhasznaloId, int intezmenyId, string intezmenyAzonosito, int tanevId) : base(felhasznaloId, intezmenyId, intezmenyAzonosito, tanevId) { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace Kreta.Core.ConnectionType
|
||||
{
|
||||
public sealed class SessionConnectionType : ConnectionTypeBase
|
||||
{
|
||||
public SessionConnectionType(string sessionId, int felhasznaloId, int intezmenyId, string intezmenyAzonosito, int tanevId) : base(felhasznaloId, intezmenyId, intezmenyAzonosito, tanevId)
|
||||
{
|
||||
SessionId = sessionId ?? throw new ArgumentNullException(nameof(sessionId));
|
||||
}
|
||||
|
||||
public string SessionId { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Kreta.Core.ConnectionType
|
||||
{
|
||||
public sealed class SystemConnectionType : ConnectionTypeBase
|
||||
{
|
||||
public SystemConnectionType(int felhasznaloId, int intezmenyId, string intezmenyAzonosito, int tanevId) : base(felhasznaloId, intezmenyId, intezmenyAzonosito, tanevId) { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,956 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Constants
|
||||
/// </summary>
|
||||
public static class Constants
|
||||
{
|
||||
//TODO tothi: Ez így nem jó, csak átmenetileg!
|
||||
public const string EncryptionKey = "1472afc44ae547b8bf0fd920093b75c5";
|
||||
|
||||
public static class ConfigurationSectionNames
|
||||
{
|
||||
public const string HttpCookies = "system.web/httpCookies";
|
||||
public const string KretaJobConfig = "KretaJobsConfigGroup/KretaJobConfig";
|
||||
public const string FeatureConfig = nameof(FeatureConfig);
|
||||
public const string UploadFileValidation = nameof(UploadFileValidation);
|
||||
public const string NexiusCourseService = nameof(NexiusCourseService);
|
||||
public const string EugyintezesClientConfiguration = nameof(EugyintezesClientConfiguration);
|
||||
public const string KretaPoszeidonConfig = "KretaPoszeidonConfigGroup/KretaPoszeidonConfig";
|
||||
public const string IktatasJobConfig = "KretaJobsConfigGroup/IktatasJobConfig";
|
||||
public const string FileServiceConfiguration = nameof(FileServiceConfiguration);
|
||||
public const string SapConfiguration = nameof(SapConfiguration);
|
||||
public const string KirConfiguration = nameof(KirConfiguration);
|
||||
public const string IdpConfiguration = nameof(IdpConfiguration);
|
||||
public const string KozpontiKretaConfig = nameof(KozpontiKretaConfig);
|
||||
public const string LEPKozpontiKretaConfig = nameof(LEPKozpontiKretaConfig);
|
||||
public const string UgyfelszolgalatConfig = nameof(UgyfelszolgalatConfig);
|
||||
public const string TananyagtarConfiguration = nameof(TananyagtarConfiguration);
|
||||
public const string FileServiceClientConfiguration = nameof(FileServiceClientConfiguration);
|
||||
public const string MkbBankszamlaIgenylesConfiguration = nameof(MkbBankszamlaIgenylesConfiguration);
|
||||
public const string OtpBankszamlaIgenylesConfiguration = nameof(OtpBankszamlaIgenylesConfiguration);
|
||||
public const string CoreApiClientConfiguration = nameof(CoreApiClientConfiguration);
|
||||
public const string KGRClientConfiguration = nameof(KGRClientConfiguration);
|
||||
public const string EESZTConfig = nameof(EESZTConfig);
|
||||
public const string FirebaseConfiguration = nameof(FirebaseConfiguration);
|
||||
public const string LeltarClientConfiguration = nameof(LeltarClientConfiguration);
|
||||
public const string SzirApiClientConfiguration = nameof(SzirApiClientConfiguration);
|
||||
public const string GlobalApiConfiguration = nameof(GlobalApiConfiguration);
|
||||
}
|
||||
|
||||
#region General
|
||||
|
||||
public static class General
|
||||
{
|
||||
public const string KretaConstansIsObsolate = "KretaConstans is obsolate! Please use Kreta.Core.Constants instead!";
|
||||
|
||||
public const string HangfireConnectionString = nameof(HangfireConnectionString);
|
||||
|
||||
public const string Error = nameof(Error);
|
||||
|
||||
public const string Obsolete = nameof(Obsolete);
|
||||
|
||||
public const string Required = " *";
|
||||
|
||||
public const string HungarianCulture = "hu-HU";
|
||||
|
||||
public const string NumberDecimalSeparator = ".";
|
||||
|
||||
public const string LineSeparator = "\n\r";
|
||||
|
||||
public const string Sortores = "<br />";
|
||||
|
||||
public const string VesszoSeparator = ",";
|
||||
|
||||
public const int TantargyfelosztasImportMaxOraszam = 50;
|
||||
|
||||
public const int BaiAdatszinkronRetryAttempts = 4;
|
||||
|
||||
public const int EugySzinkronRetryAttempts = 9;
|
||||
public const int EugyElemekSzamaBoardListaban = 8;
|
||||
|
||||
public const int JelszoMinimumKarakterekSzama = 8;
|
||||
public const int JelszoMaximumKarakterekSzama = 100;
|
||||
public const int EmailMaximumKarakterekSzama = 200;
|
||||
|
||||
public const int CsaladiEsUtonevEgyuttMaxLength = 61;
|
||||
public const int SzuletesiCsaladiEsUtonevEgyuttMaxLength = 63;
|
||||
public const int AnyaCsaladiEsUtonevEgyuttMaxLength = 63;
|
||||
|
||||
public const int EgybefuggoSzakmaiGyakorlatMegjegyzesMaxHossza = 4000;
|
||||
|
||||
/// <summary>
|
||||
/// TODO évente változtatni a megfelelő összegre
|
||||
/// </summary>
|
||||
public const int JuttatasAlap = 100000;
|
||||
|
||||
/// <summary>
|
||||
/// Az .xlsx-ben elérhető utolsó sor száma, 1-től indul a számozás!
|
||||
/// </summary>
|
||||
public const int MaxRowNumberXlsx = 1048576;
|
||||
|
||||
public const int MaxFeltolthetoAdatmennyisegInKByte = 2097152;
|
||||
public const string Intezmeny = "Intézmény";
|
||||
public const int MaxHazifeladatSzovegHossz = 30000;
|
||||
|
||||
public const string Budapest = nameof(Budapest);
|
||||
|
||||
/// <summary>
|
||||
/// Osztály tanulóinak léptetésekor szükség van megkülönböztetni a be nem sorolt tanulókat,
|
||||
/// ezért szükség van erre a temp osztály id value-ra.
|
||||
/// </summary>
|
||||
public const int OsztalybaNemSoroltTanulokValue = 0;
|
||||
|
||||
public const string BankAccountNumberRegexPattern = "^(\\d{8})-(\\d{8})(-)?(\\d{8})?$";
|
||||
public const string HianyzoOktatasiAzonositoJeloles = " (-)";
|
||||
|
||||
public const string UgyfelszolgalatSpecialisElvalaszto = " \n\r\n\r";
|
||||
|
||||
public const string ImportMD5InvalidInput = "invalid_input";
|
||||
}
|
||||
|
||||
public static class Configuration
|
||||
{
|
||||
public const string EventHubBaseUrl = "servicebus.windows.net";
|
||||
}
|
||||
|
||||
public static class EncodingName
|
||||
{
|
||||
public const string ISO_8859_8 = "ISO-8859-8";
|
||||
}
|
||||
|
||||
public static class Cache
|
||||
{
|
||||
public static readonly string CacheKeyPrefix = $"{nameof(Kreta)}_";
|
||||
}
|
||||
|
||||
public static class ToStringPattern
|
||||
{
|
||||
public const string SortableDateTimePattern = "s";
|
||||
|
||||
public const string DateTimeWithoutSecondsPattern = "g";
|
||||
|
||||
public const string HungarianDate = "yyyy.MM.dd.";
|
||||
|
||||
public const string HungarianDateWithSpaces = "yyyy. MM. dd.";
|
||||
|
||||
public const string HungarianTime = "HH:mm";
|
||||
|
||||
public const string HungarianLongDate = "yyyy. MMMM dd.";
|
||||
|
||||
public const string HungarianDateTime = "yyyy.MM.dd. HH:mm:ss";
|
||||
|
||||
public const string HungarianLongDateTime = "yyyy. MMMM dd. HH:mm:ss";
|
||||
|
||||
public const string HungarianDateTimeWithoutSeconds = "yyyy.MM.dd. HH:mm";
|
||||
|
||||
public const string HungarianLongDateTimeWithoutSeconds = "yyyy. MMMM dd. HH:mm";
|
||||
|
||||
//NOTE: Toldalékos dátum kiírásnál, nincs szükség pontra a végén. Pl.: 2018.06.08-én
|
||||
public const string HungarianDateWithSuffix = "yyyy.MM.dd";
|
||||
|
||||
public const string OtherLanguageDate = "dd.MM.yyyy";
|
||||
|
||||
public const string HungarianDateExportPattern = "yyyy_MM_dd";
|
||||
}
|
||||
|
||||
public static class DaysOfWeek
|
||||
{
|
||||
public const string Hetfo = "Hétfő";
|
||||
public const string Kedd = "Kedd";
|
||||
public const string Szerda = "Szerda";
|
||||
public const string Csutortok = "Csütörtök";
|
||||
public const string Pentek = "Péntek";
|
||||
public const string Szombat = "Szombat";
|
||||
public const string Vasarnap = "Vasárnap";
|
||||
}
|
||||
|
||||
public static class ImportExport
|
||||
{
|
||||
public const string ExcelContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||
public const string FileExtensionWord = ".doc";
|
||||
public const string FileExtensionExcel = ".xls";
|
||||
public const string FileExtensionPdf = ".pdf";
|
||||
public const string FileExtensionExcelX = ".xlsx";
|
||||
public const string FileExtensionDocx = ".docx";
|
||||
}
|
||||
|
||||
public static class RegularExpressions
|
||||
{
|
||||
public const string OktatasiAzonosito = @"^7\d{10}$";
|
||||
public const string OktatasiAzonositoTanulo = @"^[78]\d{10}$";
|
||||
public const string Telefon = @"^\+\d{1,20}$";
|
||||
public const string Bankszamla = @"^\d{8}([ -]?\d{8}){1,2}$";
|
||||
public const string TimePicker = @"^(\d|0\d|1\d|2[0-3]):[0-5]\d$";
|
||||
public const string TorzslapszamSablon = @"^(?:(?!(<#>)).)*(<#>)(?!.*(<#>)).*$";
|
||||
public const string AMITorzslapszamSablon = @"^(?:(?!(<#>)).)*(<#>)(?!.*(<#>))([\\s\\S]{1,51}[/]\\d{1,4}[-]\\d{1,4})?$";
|
||||
public const string EvesOraszam = @"\d+[,.]?\d{0,2}";
|
||||
public const string OMAzonosito = @"^\d{6}$";
|
||||
public const string GyartasiEv = @"^\d{4}$";
|
||||
public const string MukodesiHelyAzonosito = @"^\d{3}$";
|
||||
public const string AdoazonositoJel = @"^\d{10}$";
|
||||
public const string UjUrlName = @"^[a-z]([a-z]*|(.[a-z])*)*$";
|
||||
public const string OneOfLineBreak = @"\r?\n";
|
||||
public const string ThisOrThatLineBreak = @"\r|\n";
|
||||
public const string TajSzam = @"^\d{9}$";
|
||||
public const string KIRFeladatellatasiHelySorszama = @"^\d{3}$";
|
||||
public static string NevElotagEllenorzes = string.Format(@"^({0})((\.?\ )|(\.))", string.Join("|", ElotagList.Select(x => x.TrimEnd(".".ToCharArray())).Distinct()));
|
||||
public const string Adoszam = @"^\d{8}-\d{1}-\d{2}$";
|
||||
public const string AkarhanySzammalKezdodo = @"^[0-9]*";
|
||||
public const string OszlopNevHelyettesito = @"{\w*}+";
|
||||
public const string URLPattern = @"(http|ftp|https)://([\w+?\.\w+])+([a-zA-Z0-9\~\!\@\#\$\%\^\&\*\(\)_\-\=\+\\\/\?\.\:\;\'\,]*)?";
|
||||
public static string RemoveLinkFromText = $"(?'eleje'<a[^<]*>)(?'url'{URLPattern})(?'vege'</a>)";
|
||||
}
|
||||
|
||||
public static class MinMaxValues
|
||||
{
|
||||
//NOTE: formátum kötött, javascript-ben is használjuk (_MasterLayout)
|
||||
public const string MinDate = "1/1/1900";
|
||||
public const string MaxDate = "1/1/2100";
|
||||
public const int MaxKulcsszoErtekLength = 200;
|
||||
public const double MerohelyMaxValue = 99999999.99;
|
||||
public const int MinTantargySorszam = 0;
|
||||
public const int MaxTantargySorszam = 1000;
|
||||
public const int MaxSzovegesErtekelesHossz = 4000;
|
||||
public const double MinOsztondijAtlag = 2.00;
|
||||
public const double MinEpjErtekeles = 2.00;
|
||||
public const double MinApaczaiAtlag = 3.50;
|
||||
public const int MaxIgazolatlanJuttatasokhoz = 6;
|
||||
public const double OratervTantargyEvesOraszamMaxValue = 99999999.99;
|
||||
public const int MaxApaczaiKategoriankentFeltotlhetoFajlokSzama = 10;
|
||||
public const int EgyediSzotarelemMinId = 100000;
|
||||
public const int MaxApaczaiFellebbezesSzovegHossz = 4000;
|
||||
}
|
||||
|
||||
public static class FrxNames
|
||||
{
|
||||
public const string HozzatartozoJelszoAdatok = "HozzatartozoJelszoAdatok";
|
||||
public const string TanuloBelepesiAdatok = "TanuloBelepesiAdatok";
|
||||
}
|
||||
|
||||
public class ContentTypes
|
||||
{
|
||||
public const string ApplicationJson = "application/json";
|
||||
public const string Docx = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
||||
public const string Xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||
public const string Excel = "application/excel";
|
||||
public const string Word = "application/msword";
|
||||
public const string Pdf = "application/pdf";
|
||||
public const string Doc = "application/doc";
|
||||
}
|
||||
|
||||
public static class Megye
|
||||
{
|
||||
public static string Budapest = CommonResource.Budapest;
|
||||
public static string Baranya = CommonResource.Baranya;
|
||||
public static string BacsKiskun = CommonResource.BacsKiskun;
|
||||
public static string Bekes = CommonResource.Bekes;
|
||||
public static string BorsodAbaujZemplen = CommonResource.BorsodAbaujZemplen;
|
||||
public static string Csongrad = CommonResource.Csongrad;
|
||||
public static string Fejer = CommonResource.Fejer;
|
||||
public static string GyorMosonSopron = CommonResource.GyorMosonSopron;
|
||||
public static string HajduBihar = CommonResource.HajduBihar;
|
||||
public static string Heves = CommonResource.Heves;
|
||||
public static string JaszNagykunSzolnok = CommonResource.JaszNagykunSzolnok;
|
||||
public static string KomaromEsztergom = CommonResource.KomaromEsztergom;
|
||||
public static string Nograd = CommonResource.Nograd;
|
||||
public static string Pest = CommonResource.Pest;
|
||||
public static string Somogy = CommonResource.Somogy;
|
||||
public static string SzabolcsSzatmarBereg = CommonResource.SzabolcsSzatmarBereg;
|
||||
public static string Tolna = CommonResource.Tolna;
|
||||
public static string Vas = CommonResource.Vas;
|
||||
public static string Veszprem = CommonResource.Veszprem;
|
||||
public static string Zala = CommonResource.Zala;
|
||||
}
|
||||
|
||||
public static class Elotag
|
||||
{
|
||||
public static string Ifj = CommonResource.IfjElotag;
|
||||
public static string IfjPont = $"{Ifj}.";
|
||||
public static string Id = CommonResource.IdElotag;
|
||||
public static string IdPont = $"{Id}.";
|
||||
public static string Ozv = CommonResource.OzvElotag;
|
||||
public static string OzvPont = $"{Ozv}.";
|
||||
public static string Dr = CommonResource.DrElotag;
|
||||
public static string DrPont = $"{Dr}.";
|
||||
public static string Prof = CommonResource.ProfElotag;
|
||||
public static string ProfPont = $"{Prof}.";
|
||||
}
|
||||
|
||||
public static IList<string> ElotagList = new List<string>
|
||||
{
|
||||
Elotag.Ifj,
|
||||
Elotag.IfjPont,
|
||||
Elotag.Id,
|
||||
Elotag.IdPont,
|
||||
Elotag.Ozv,
|
||||
Elotag.OzvPont,
|
||||
Elotag.Dr,
|
||||
Elotag.DrPont,
|
||||
Elotag.Prof,
|
||||
Elotag.ProfPont,
|
||||
};
|
||||
|
||||
public static class DataFormats
|
||||
{
|
||||
public const string EvesOraszam = "{0:#.##}";
|
||||
}
|
||||
|
||||
#endregion General
|
||||
|
||||
#region Speciális felhasználók
|
||||
|
||||
public static class SpecialUserName
|
||||
{
|
||||
public const string KretaAdminisztrator = "Kréta Adminisztrátor";
|
||||
|
||||
public const string Rendszeruzenet = "Rendszerüzenet";
|
||||
|
||||
public const string KretaTechnicalUserName = "KRETA_TECHNICAL_FORI";
|
||||
|
||||
public const string KretaAdminisztratorUserName = "admin";
|
||||
}
|
||||
|
||||
#endregion General
|
||||
|
||||
#region FeatureName
|
||||
|
||||
public static class FeatureName
|
||||
{
|
||||
public const string KirSzinkron = nameof(KirSzinkron);
|
||||
public const string TTFImportFileUpload = nameof(TTFImportFileUpload);
|
||||
public const string KIRImport = nameof(KIRImport);
|
||||
public const string MunkaugyiAdatokKlebelsberg = nameof(MunkaugyiAdatokKlebelsberg);
|
||||
public const string InfoAdatszolgaltatas = nameof(InfoAdatszolgaltatas);
|
||||
public const string HOIAdatbazis = nameof(HOIAdatbazis);
|
||||
public const string SendMobileNotification = nameof(SendMobileNotification);
|
||||
public const string SendErtekelesNotification = nameof(SendErtekelesNotification);
|
||||
public const string SendFeljegyzesNotification = nameof(SendFeljegyzesNotification);
|
||||
public const string SendHazifeladatNotification = nameof(SendHazifeladatNotification);
|
||||
public const string SendRendszerUzenetNotification = nameof(SendRendszerUzenetNotification);
|
||||
public const string SendMulasztasNotification = nameof(SendMulasztasNotification);
|
||||
public const string SendBejelentettSzamonkeresNotification = nameof(SendBejelentettSzamonkeresNotification);
|
||||
public const string SendKozelgoFogadooraMail = nameof(SendKozelgoFogadooraMail);
|
||||
public const string SendOrarendValtozasNotification = nameof(SendOrarendValtozasNotification);
|
||||
public const string SendNemNaplozottTanorakMail = nameof(SendNemNaplozottTanorakMail);
|
||||
public const string MunkaugyiAdatokNSZFH = nameof(MunkaugyiAdatokNSZFH);
|
||||
public const string PoszeidonIktatas = nameof(PoszeidonIktatas);
|
||||
public const string LetesitmenyBerbeadas = nameof(LetesitmenyBerbeadas);
|
||||
public const string BeiratkozasEugyHatarozat = nameof(BeiratkozasEugyHatarozat);
|
||||
public const string AlkalmazottTanuloKirSzinkron = nameof(AlkalmazottTanuloKirSzinkron);
|
||||
public const string HRModul = nameof(HRModul);
|
||||
public const string HangfireServer = nameof(HangfireServer);
|
||||
public const string ReCaptcha = nameof(ReCaptcha);
|
||||
public const string Tananyagtar = nameof(Tananyagtar);
|
||||
public const string DeleteInvalidLinks = nameof(DeleteInvalidLinks);
|
||||
public const string MobileEllenorzoApiCache = nameof(MobileEllenorzoApiCache);
|
||||
public const string IERSzerepkorokHozzaadasa = nameof(IERSzerepkorokHozzaadasa);
|
||||
public const string MkbBankszamlaIgenyles = nameof(MkbBankszamlaIgenyles);
|
||||
public const string UpdateCOVIDFlag = nameof(UpdateCOVIDFlag);
|
||||
public const string EESZTInterfaceUsage = nameof(EESZTInterfaceUsage);
|
||||
public const string SAPSync = nameof(SAPSync);
|
||||
public const string UpdateTanuloDualisSzerzodesei = nameof(UpdateTanuloDualisSzerzodesei);
|
||||
public const string OtpBankszamlaIgenyles = nameof(OtpBankszamlaIgenyles);
|
||||
public const string UseGlobalApiConnectionString = nameof(UseGlobalApiConnectionString);
|
||||
}
|
||||
|
||||
public static class FileServiceStorageName
|
||||
{
|
||||
public const string Default = nameof(Default);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Version
|
||||
|
||||
/// <summary>
|
||||
/// Version
|
||||
/// </summary>
|
||||
public static class Version
|
||||
{
|
||||
/// <summary>
|
||||
/// Not available
|
||||
/// </summary>
|
||||
public const string NotAvailable = "N/A";
|
||||
|
||||
/// <summary>
|
||||
/// The branch name
|
||||
/// </summary>
|
||||
public static readonly string BranchName = nameof(BranchName);
|
||||
|
||||
/// <summary>
|
||||
/// The commit number
|
||||
/// </summary>
|
||||
public static readonly string CommitNumber = nameof(CommitNumber);
|
||||
|
||||
/// <summary>
|
||||
/// The build version
|
||||
/// </summary>
|
||||
public static readonly string BuildVersion = nameof(BuildVersion);
|
||||
|
||||
/// <summary>
|
||||
/// The build date time UTC
|
||||
/// </summary>
|
||||
public static readonly string BuildDateTimeUtc = nameof(BuildDateTimeUtc);
|
||||
}
|
||||
|
||||
#endregion Version
|
||||
|
||||
#region AdatszotarTipus
|
||||
|
||||
public static List<int> NemBovithetoAdatszotarTipusLista = new List<int>
|
||||
{
|
||||
(int)GeneratedAdatszotarTipusEnum.OktatasiNevelesiFeladat,
|
||||
(int)GeneratedAdatszotarTipusEnum.MunkakorTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.HittanTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.IgazolasTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.EvfolyamTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.ReszszakkepesitesTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.SzakkepesitesTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.AgazatTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.SzakmacsoportTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.TanterviJelleg,
|
||||
(int)GeneratedAdatszotarTipusEnum.CsoportTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.Anyanyelv,
|
||||
(int)GeneratedAdatszotarTipusEnum.Allampolgarsag,
|
||||
(int)GeneratedAdatszotarTipusEnum.Vallas,
|
||||
(int)GeneratedAdatszotarTipusEnum.RokonsagiFok,
|
||||
(int)GeneratedAdatszotarTipusEnum.OrszagTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.TeremTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.TevekenysegTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.MunkaviszonyTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.FoglalkoztatasTipusa,
|
||||
(int)GeneratedAdatszotarTipusEnum.TavolletTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.TargyKategoriaTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.AgazatUjSzktTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.SzakmaTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.SzakmairanyTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.SzakiranyNktTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.SzakkepesitesNktTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.TanulmanyiTeruletNktTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.MufajTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.DigEszkozTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.DigPlatformTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.DigTamEszkozTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.AgazatReszSzakmaTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.SzakmaReszSzakmaTipus,
|
||||
(int)GeneratedAdatszotarTipusEnum.ReszSzakmaTipus
|
||||
};
|
||||
|
||||
#endregion AdatszotarTipus
|
||||
|
||||
public static class Mulasztas
|
||||
{
|
||||
public const int OraSorszamMinValue = -2;
|
||||
public const int OraSorszamMaxValue = 24;
|
||||
public const int FoglalkozasCount = 20;
|
||||
}
|
||||
|
||||
public static class Header
|
||||
{
|
||||
public const string ApiKey = nameof(ApiKey);
|
||||
|
||||
public const string ApplicationJson = "application/json";
|
||||
}
|
||||
|
||||
public static class Export
|
||||
{
|
||||
public static Color HeaderColor = Color.FromArgb(255, 191, 191, 191);
|
||||
public const bool HeaderIsBold = true;
|
||||
}
|
||||
|
||||
public static IEnumerable<int> AMIEgyeniCsoportok = new List<int>
|
||||
{
|
||||
(int)CsoportTipusEnum.AlapfMuvOktZenemuveszetiCsoportEgyeniFotanszak,
|
||||
(int)CsoportTipusEnum.AlapfMuvOktZenemuveszetiCsoportEgyeniKotelezoenValaszthato,
|
||||
(int)CsoportTipusEnum.AlapfMuvOktZenemuveszetiCsoportEgyeniKotelezo,
|
||||
(int)CsoportTipusEnum.AlapfMuvOktZenemuveszetiCsoportEgyeniValaszthato
|
||||
};
|
||||
|
||||
public static List<int> NyelvesitendoEsemenyTipuslist = new List<int>
|
||||
{
|
||||
(int)EsemenyTipusEnum.AKozossegiSzolgalatTeljesitesevelKapcsolatosAdatok,
|
||||
(int)EsemenyTipusEnum.FeljegyzesekASzemelyiAdatokValtozasahozTorzslaponMegjelenik,
|
||||
(int)EsemenyTipusEnum.EvVegiBizonyitvanybanMegjelenoTantestuletiFeljegyzesHatarozatDicseretFelmentesStb,
|
||||
(int)EsemenyTipusEnum.TorzslaponMegjelenoEgyebFeljegyzesVagyHatarozat,
|
||||
};
|
||||
|
||||
public static List<int> BankszamlatIgenyelhetoTanuloOsztalyEvfolyamTipusIdList = new List<int>
|
||||
{
|
||||
(int)EvfolyamTipusEnum._9,
|
||||
(int)EvfolyamTipusEnum._13,
|
||||
(int)EvfolyamTipusEnum._1_9,
|
||||
(int)EvfolyamTipusEnum._1_13,
|
||||
(int)EvfolyamTipusEnum._3_13,
|
||||
(int)EvfolyamTipusEnum._9_Ny,
|
||||
(int)EvfolyamTipusEnum._9_Kny,
|
||||
(int)EvfolyamTipusEnum._9_N,
|
||||
(int)EvfolyamTipusEnum._9_AJTP,
|
||||
(int)EvfolyamTipusEnum._9_AJKP,
|
||||
(int)EvfolyamTipusEnum._9_E,
|
||||
(int)EvfolyamTipusEnum._5_13,
|
||||
(int)EvfolyamTipusEnum._9_s,
|
||||
(int)EvfolyamTipusEnum._kk13,
|
||||
(int)EvfolyamTipusEnum._9_szakgimnazium,
|
||||
(int)EvfolyamTipusEnum._9_gimnazium,
|
||||
(int)EvfolyamTipusEnum._9_szakiskola,
|
||||
(int)EvfolyamTipusEnum._9_keszsegfejleszto_iskola,
|
||||
(int)EvfolyamTipusEnum._9Ny_gimnazium_nyelvi_elokeszito,
|
||||
(int)EvfolyamTipusEnum._9Kny_gimnazium_ket_tanitasi_nyelvu_elokeszito,
|
||||
(int)EvfolyamTipusEnum._1_9_4_es_szintu_szakkepzo_iskola,
|
||||
(int)EvfolyamTipusEnum._9_orientacios_evfolyam,
|
||||
(int)EvfolyamTipusEnum._9_ny_technikum_nyelvi_elokeszito,
|
||||
(int)EvfolyamTipusEnum._9_kny_technikum_ket_tanitasi_nyelvu_elokeszito,
|
||||
(int)EvfolyamTipusEnum._9_technikum,
|
||||
(int)EvfolyamTipusEnum._9_technikum_ket_tanitasi_nyelvu_,
|
||||
(int)EvfolyamTipusEnum._13_technikum,
|
||||
(int)EvfolyamTipusEnum._13_technikum_ket_tanitasi_nyelvu_,
|
||||
(int)EvfolyamTipusEnum._1_13_5_os_szintu_technikum,
|
||||
(int)EvfolyamTipusEnum.kk_13_szakkepzo_iskola_ket_eves_erettsegire_felkeszito,
|
||||
(int)EvfolyamTipusEnum._9_ny_szakgimnazium_nkt_nyelvi_elokeszito,
|
||||
(int)EvfolyamTipusEnum._9_szakgimnazium_nkt,
|
||||
(int)EvfolyamTipusEnum._5_13_5_os_szintu_technikum_beszamitasos_egy_eves,
|
||||
(int)EvfolyamTipusEnum.ksz_13_4_es_szintu_szakkepzo_iskola_kozismeret_nelkuli,
|
||||
(int)EvfolyamTipusEnum._9_szakgimnazium_nkt_ket_tanitasi_nyelvu_,
|
||||
(int)EvfolyamTipusEnum.dobbanto_elokeszito,
|
||||
};
|
||||
|
||||
public static readonly List<int> KilencesEvfolyamList = new List<int>()
|
||||
{
|
||||
(int)EvfolyamTipusEnum._9,
|
||||
(int)EvfolyamTipusEnum._9_Ny,
|
||||
(int)EvfolyamTipusEnum._9_Kny,
|
||||
(int)EvfolyamTipusEnum._9_N,
|
||||
(int)EvfolyamTipusEnum._9_AJTP,
|
||||
(int)EvfolyamTipusEnum._9_AJKP,
|
||||
(int)EvfolyamTipusEnum._9_E,
|
||||
(int)EvfolyamTipusEnum._9_s,
|
||||
(int)EvfolyamTipusEnum._9_szakgimnazium,
|
||||
(int)EvfolyamTipusEnum._9_gimnazium,
|
||||
(int)EvfolyamTipusEnum._9_szakiskola,
|
||||
(int)EvfolyamTipusEnum._9_keszsegfejleszto_iskola,
|
||||
(int)EvfolyamTipusEnum._9Ny_gimnazium_nyelvi_elokeszito,
|
||||
(int)EvfolyamTipusEnum._9Kny_gimnazium_ket_tanitasi_nyelvu_elokeszito,
|
||||
(int)EvfolyamTipusEnum._9_orientacios_evfolyam,
|
||||
(int)EvfolyamTipusEnum._9_ny_technikum_nyelvi_elokeszito,
|
||||
(int)EvfolyamTipusEnum._9_kny_technikum_ket_tanitasi_nyelvu_elokeszito,
|
||||
(int)EvfolyamTipusEnum._9_technikum,
|
||||
(int)EvfolyamTipusEnum._9_technikum_ket_tanitasi_nyelvu_,
|
||||
(int)EvfolyamTipusEnum._9_ny_szakgimnazium_nkt_nyelvi_elokeszito,
|
||||
(int)EvfolyamTipusEnum._9_szakgimnazium_nkt,
|
||||
(int)EvfolyamTipusEnum._9_szakgimnazium_nkt_ket_tanitasi_nyelvu_
|
||||
};
|
||||
|
||||
|
||||
public static List<int> ApaczaiODJogosultEvfolyamTipusIdList = new List<int>
|
||||
{
|
||||
(int)EvfolyamTipusEnum._9_technikum,
|
||||
(int)EvfolyamTipusEnum._10_technikum,
|
||||
(int)EvfolyamTipusEnum._1_9_4_es_szintu_szakkepzo_iskola,
|
||||
(int)EvfolyamTipusEnum._2_10_4_es_szintu_szakkepzo_iskola,
|
||||
(int)EvfolyamTipusEnum._9_technikum_ket_tanitasi_nyelvu_,
|
||||
(int)EvfolyamTipusEnum._10_technikum_ket_tanitasi_nyelvu_,
|
||||
(int)EvfolyamTipusEnum._11_technikum,
|
||||
(int)EvfolyamTipusEnum._11_technikum_ket_tanitasi_nyelvu_,
|
||||
(int)EvfolyamTipusEnum._3_11_4_es_szintu_szakkepzo_iskola,
|
||||
};
|
||||
|
||||
public static List<int> GyakorlatigenyessegTargyKategoriaTipusIdList = new List<int>
|
||||
{
|
||||
(int)TargyKategoriaTipusEnum.szakmai,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_banyaszat_es_kohaszat_01_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_egeszsegugyi_technika_02_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_egeszsegugy_03_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_elektronika_es_elektrotechnika_04_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_elelmiszeripar_05_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_epitoipar_06_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_epuletgepeszet_07_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_fa_es_butoripar_08_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_gazdalkodas_es_menedzsment_09_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_gepeszet_10_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_honvedelem_11_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_informatika_es_tavkozles_12_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_kereskedelem_13_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_kornyezetvedelem_es_vizugy_14_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_kozlekedes_es_szallitmanyozas_15_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_kreativ_16_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_mezogazdasag_es_erdeszet_17_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_rendeszet_es_kozszolgalat_18_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_specializalt_gep_es_jarmugyartas_19_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_sport_20_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_szepeszet_21_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_szocialis_22_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_turizmus_vendeglatas_23_2020_,
|
||||
(int)TargyKategoriaTipusEnum.szakmai_vegyipar_24_2020_
|
||||
};
|
||||
|
||||
public static List<int> NszfhTovabbiMunkakorTipusIdList = new List<int>
|
||||
{
|
||||
(int)MunkakorTipusEnum.apolo,
|
||||
(int)MunkakorTipusEnum.dajka,
|
||||
(int)MunkakorTipusEnum.gondozono_es_takarito,
|
||||
(int)MunkakorTipusEnum.gyermek_es_ifjusagvedelmi_felelos,
|
||||
(int)MunkakorTipusEnum.gyogypedagogiai_asszisztens,
|
||||
(int)MunkakorTipusEnum.gyogytornasz,
|
||||
(int)MunkakorTipusEnum.hangszerkarbantarto,
|
||||
(int)MunkakorTipusEnum.iskolatitkar,
|
||||
(int)MunkakorTipusEnum.konyvtaros,
|
||||
(int)MunkakorTipusEnum.laborans,
|
||||
(int)MunkakorTipusEnum.muszaki_vezeto,
|
||||
(int)MunkakorTipusEnum.ovodatitkar,
|
||||
(int)MunkakorTipusEnum.pedagogiai_asszisztens,
|
||||
(int)MunkakorTipusEnum.pedagogiai_felugyelo,
|
||||
(int)MunkakorTipusEnum.rendszergazda,
|
||||
(int)MunkakorTipusEnum.szabadido_szervezo,
|
||||
(int)MunkakorTipusEnum.szakorvos,
|
||||
(int)MunkakorTipusEnum.uszomester,
|
||||
(int)MunkakorTipusEnum.jelmez_es_viselettaros,
|
||||
(int)MunkakorTipusEnum.kollegiumi_titkar,
|
||||
(int)MunkakorTipusEnum.pszichopedagogus,
|
||||
(int)MunkakorTipusEnum.szakszolgalati_titkar,
|
||||
(int)MunkakorTipusEnum.NOKSPedagogiaiFelugyelo,
|
||||
(int)MunkakorTipusEnum.gazdasagi_dolgozo,
|
||||
(int)MunkakorTipusEnum.kisegito_dolgozo,
|
||||
(int)MunkakorTipusEnum.konyvtaros_asszisztens,
|
||||
(int)MunkakorTipusEnum.konyvtaros_technikus,
|
||||
(int)MunkakorTipusEnum.muszaki_dolgozo,
|
||||
(int)MunkakorTipusEnum.oktatastechnikus,
|
||||
(int)MunkakorTipusEnum.szamitogep_kezelo,
|
||||
(int)MunkakorTipusEnum.szamitogep_rendszerprogramozo,
|
||||
(int)MunkakorTipusEnum.ugyviteli_dolgozo,
|
||||
(int)MunkakorTipusEnum.ugyviteli_gepkezelo,
|
||||
(int)MunkakorTipusEnum.munkaugyi_szemelyzeti_eloado
|
||||
};
|
||||
|
||||
public static List<int> KonyvtarosMunkakorTipusIdList = new List<int>
|
||||
{
|
||||
(int)MunkakorTipusEnum.konyvtaros,
|
||||
(int)MunkakorTipusEnum.konyvtarostanar,
|
||||
(int)MunkakorTipusEnum.konyvtarostanar_tanito,
|
||||
(int)MunkakorTipusEnum.konyvtarostanito,
|
||||
(int)MunkakorTipusEnum.konyvtaros_asszisztens,
|
||||
(int)MunkakorTipusEnum.konyvtaros_oktato_kizarolag_konyvtarosi_feladatokat_lat_el_,
|
||||
(int)MunkakorTipusEnum.konyvtaros_oktato_oktatoi_feladatokat_is_ellat_,
|
||||
(int)MunkakorTipusEnum.konyvtaros_technikus
|
||||
};
|
||||
|
||||
public static List<int> VezetoiOraszamokTipusIdList = new List<int>
|
||||
{
|
||||
(int)VezetoiOraszamokTipusEnum.foigazgato,
|
||||
(int)VezetoiOraszamokTipusEnum.foigazgato_helyettes,
|
||||
(int)VezetoiOraszamokTipusEnum.GyakorlatiOktatasvezeto,
|
||||
(int)VezetoiOraszamokTipusEnum.igazgato,
|
||||
(int)VezetoiOraszamokTipusEnum.igazgatohelyettes,
|
||||
(int)VezetoiOraszamokTipusEnum.IntezmenyegysegVezeto,
|
||||
(int)VezetoiOraszamokTipusEnum.IntezmenyegysegvezetoHelyettes,
|
||||
(int)VezetoiOraszamokTipusEnum.Intezmenyvezeto,
|
||||
(int)VezetoiOraszamokTipusEnum.IntezmenyvezetoHelyettes,
|
||||
(int)VezetoiOraszamokTipusEnum.kollegiumvezeto,
|
||||
(int)VezetoiOraszamokTipusEnum.MasikIntezmenybenVezeto,
|
||||
(int)VezetoiOraszamokTipusEnum.Nincs,
|
||||
(int)VezetoiOraszamokTipusEnum.szakiranyu_oktatasert_felelos_igazgatohelyettes,
|
||||
(int)VezetoiOraszamokTipusEnum.TagintezmenyVezeto,
|
||||
(int)VezetoiOraszamokTipusEnum.TagintezmenyvezetoHelyettes
|
||||
};
|
||||
|
||||
public static List<int> SzirStatVezetoiOraszamokTipusIdList = new List<int>
|
||||
{
|
||||
(int)VezetoiOraszamokTipusEnum.TagintezmenyVezeto,
|
||||
(int)VezetoiOraszamokTipusEnum.igazgato,
|
||||
(int)VezetoiOraszamokTipusEnum.IntezmenyegysegVezeto,
|
||||
(int)VezetoiOraszamokTipusEnum.kollegiumvezeto,
|
||||
(int)VezetoiOraszamokTipusEnum.TagintezmenyvezetoHelyettes,
|
||||
(int)VezetoiOraszamokTipusEnum.igazgatohelyettes,
|
||||
(int)VezetoiOraszamokTipusEnum.IntezmenyegysegvezetoHelyettes,
|
||||
(int)VezetoiOraszamokTipusEnum.GyakorlatiOktatasvezeto,
|
||||
(int)VezetoiOraszamokTipusEnum.foigazgato,
|
||||
(int)VezetoiOraszamokTipusEnum.foigazgato_helyettes,
|
||||
(int)VezetoiOraszamokTipusEnum.Intezmenyvezeto,
|
||||
(int)VezetoiOraszamokTipusEnum.IntezmenyvezetoHelyettes,
|
||||
(int)VezetoiOraszamokTipusEnum.szakiranyu_oktatasert_felelos_igazgatohelyettes,
|
||||
};
|
||||
|
||||
#region Enum-ból összeállított constant-ok
|
||||
|
||||
/// <summary>
|
||||
/// Távollét státusza alapján meghatározott törölhetőség.
|
||||
/// </summary>
|
||||
public static class TavolletStatuszTorolhetoseg
|
||||
{
|
||||
public static readonly List<int> BarkiAltalTorolhetok = new List<int>
|
||||
{
|
||||
(int)TavolletStatuszEnum.Fuggo,
|
||||
(int)TavolletStatuszEnum.HianypotlasraVisszakuldve,
|
||||
(int)TavolletStatuszEnum.Tankerulet_altal_hianypotlasra_visszakuldve,
|
||||
};
|
||||
|
||||
public static readonly List<int> IntezmenyVezetoAltalTorolhetok = new List<int>(BarkiAltalTorolhetok)
|
||||
{
|
||||
(int)TavolletStatuszEnum.Elfogadva_atadva_tankeruletnek,
|
||||
(int)TavolletStatuszEnum.Engedelyezve_atadva_tankeruletnek,
|
||||
(int)TavolletStatuszEnum.Tudomasul_veve_atadva_tankeruletnek,
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static List<int> INegyedevVegetIgenyloDokumentIdList = new List<int>
|
||||
{
|
||||
70,72,73,74,75,582,
|
||||
76,77,78,79,80,583
|
||||
};
|
||||
public static List<int> IIINegyedevVegetIgenyloDokumentIdList = new List<int>
|
||||
{
|
||||
81,82,83,84,85,584,
|
||||
86,87,88,89,90,585
|
||||
};
|
||||
|
||||
public static List<int> FeleviErtesitokWithSzovegesErtekelesHosszLimit = new List<int>
|
||||
{
|
||||
60, 61
|
||||
};
|
||||
|
||||
public static List<int> EvVegiErtesitokWithSzovegesErtekelesHosszLimit = new List<int>
|
||||
{
|
||||
133, 134
|
||||
};
|
||||
|
||||
public static List<int> INegyedeviErtesitokWithSzovegesErtekelesHosszLimit = new List<int>
|
||||
{
|
||||
72, 73
|
||||
};
|
||||
|
||||
public static List<int> IINegyedeviErtesitokWithSzovegesErtekelesHosszLimit = new List<int>
|
||||
{
|
||||
77, 78
|
||||
};
|
||||
|
||||
public static List<int> IIINegyedeviErtesitokWithSzovegesErtekelesHosszLimit = new List<int>
|
||||
{
|
||||
82, 83
|
||||
};
|
||||
|
||||
public static List<int> IVNegyedeviErtesitokWithSzovegesErtekelesHosszLimit = new List<int>
|
||||
{
|
||||
87, 88
|
||||
};
|
||||
|
||||
public static List<int> OsszesErtesitokWithSzovegesErtekelesHosszLimit()
|
||||
{
|
||||
var result = new List<int>();
|
||||
result.AddRange(FeleviErtesitokWithSzovegesErtekelesHosszLimit);
|
||||
result.AddRange(EvVegiErtesitokWithSzovegesErtekelesHosszLimit);
|
||||
result.AddRange(INegyedeviErtesitokWithSzovegesErtekelesHosszLimit);
|
||||
result.AddRange(IINegyedeviErtesitokWithSzovegesErtekelesHosszLimit);
|
||||
result.AddRange(IIINegyedeviErtesitokWithSzovegesErtekelesHosszLimit);
|
||||
result.AddRange(IVNegyedeviErtesitokWithSzovegesErtekelesHosszLimit);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Dictionary<string, string> OraszamList = new Dictionary<string, string>
|
||||
{
|
||||
{ "1", NyomtatvanyokResource._1Ora},
|
||||
{ "2", NyomtatvanyokResource._2Ora},
|
||||
{ "3", NyomtatvanyokResource._3Ora},
|
||||
{ "4", NyomtatvanyokResource._4Ora},
|
||||
{ "5", NyomtatvanyokResource._5Ora},
|
||||
{ "6", NyomtatvanyokResource._6Ora},
|
||||
{ "7", NyomtatvanyokResource._7Ora},
|
||||
{ "8", NyomtatvanyokResource._8Ora},
|
||||
{ "9", NyomtatvanyokResource._9Ora},
|
||||
{ "10", NyomtatvanyokResource._10Ora}
|
||||
};
|
||||
|
||||
#region Értékelés
|
||||
|
||||
public static class TanuloErtekelesHaviAtlagColumnNames
|
||||
{
|
||||
public const string Szeptember_HaviAtlag = nameof(Szeptember_HaviAtlag);
|
||||
public const string Oktober_HaviAtlag = nameof(Oktober_HaviAtlag);
|
||||
public const string November_HaviAtlag = nameof(November_HaviAtlag);
|
||||
public const string December_HaviAtlag = nameof(December_HaviAtlag);
|
||||
public const string JanuarI_HaviAtlag = nameof(JanuarI_HaviAtlag);
|
||||
public const string I_HaviAtlag = nameof(I_HaviAtlag);
|
||||
public const string JanuarII_HaviAtlag = nameof(JanuarII_HaviAtlag);
|
||||
public const string Februar_HaviAtlag = nameof(Februar_HaviAtlag);
|
||||
public const string Marcius_HaviAtlag = nameof(Marcius_HaviAtlag);
|
||||
public const string Aprilis_HaviAtlag = nameof(Aprilis_HaviAtlag);
|
||||
public const string Majus_HaviAtlag = nameof(Majus_HaviAtlag);
|
||||
public const string Junius_HaviAtlag = nameof(Junius_HaviAtlag);
|
||||
public const string II_HaviAtlag = nameof(II_HaviAtlag);
|
||||
}
|
||||
|
||||
public static class TanuloErtekelesColorCodes
|
||||
{
|
||||
public const string Felevi = "65BD5E";
|
||||
public const string Evvegi = "CC5B5B";
|
||||
public const string I_Ne = "5E9CBD";
|
||||
public const string II_Ne = "815EBD";
|
||||
public const string III_Ne = "A05EBD";
|
||||
public const string IV_Ne = "29B5D0";
|
||||
public const string Modulzaro = "F37030";
|
||||
public const string Potvizsga = "F49663";
|
||||
public const string Osztalyozo = "186835";
|
||||
public const string Kulonbozeti = "F49663";
|
||||
public const string Na = "111111";
|
||||
public const string Evkozi = "000000";
|
||||
}
|
||||
|
||||
#endregion Értékelés
|
||||
|
||||
public static List<int> UjTorzslapBetuMeretek = new List<int>
|
||||
{
|
||||
5,6,7,8,9,10,11,12
|
||||
};
|
||||
|
||||
public static List<int> PalyavalasztasiEvfolyamok = new List<int>
|
||||
{
|
||||
/*Jelenleg minden itt van*/
|
||||
1303,1317,1326,7901,1319,7883,1337,7911,1324,1316,7862,1312,7118,7117,7116,7115,7907,8397,7873,7874,6703,1313,7120,7122,
|
||||
7121,7119,7908,8398,7875,7876,6704,1314,7126,7125,7124,7123,7909,8399,7877,7878,6705,1315,7879,7880,7881,7882,1304,1323,
|
||||
7863,1318,1320,7884,1305,1325,7864,1322,1321,8395,1306,6520,7865,6468,1307,6469,7910,1334,1330,1308,1309,7109,1335,1331,
|
||||
1310,7110,1311,7114,7113,7112,7111,7868,7906,8396,7871,7872,3019,3018,3020,1333,7128,7870,1336,1332,7905,7869,7127,6702,
|
||||
7904,1301,1302,8401,6471,6473,6475,6472,6474,6476,1297,6818,7902,6819,7903,7129,1298,3016,7866,3017,7867,8408,8394,8409,
|
||||
7889,1296,1299,6470,1300,6908,6909,6910,6911,6912,6913,7366,3021,3022,6477,6479,6481,6478,6480,6482,6964,6965,6966,6963
|
||||
};
|
||||
|
||||
public static DateTime SZIRAdatszolgaltatasDatum = new DateTime(2021, 10, 01);
|
||||
public static DateTime SZIRAdatszolgaltatasVegeDatum = new DateTime(2022, 10, 15);
|
||||
|
||||
public static DateTime ApaczaiVegeDatum = new DateTime(2022, 10, 29, 21, 59, 00);
|
||||
|
||||
public static List<int> LepEnabledEvfolyam = new List<int>
|
||||
{
|
||||
(int)EvfolyamTipusEnum._1,
|
||||
(int)EvfolyamTipusEnum._2,
|
||||
(int)EvfolyamTipusEnum._3,
|
||||
(int)EvfolyamTipusEnum._4,
|
||||
(int)EvfolyamTipusEnum._5,
|
||||
(int)EvfolyamTipusEnum._6,
|
||||
(int)EvfolyamTipusEnum._7,
|
||||
(int)EvfolyamTipusEnum._8,
|
||||
(int)EvfolyamTipusEnum._8_gimnazium,
|
||||
(int)EvfolyamTipusEnum.Osszevont_osztaly
|
||||
};
|
||||
|
||||
public static List<int> FeltarEvfolyamList = new List<int>()
|
||||
{
|
||||
(int)EvfolyamTipusEnum._10,
|
||||
(int)EvfolyamTipusEnum._2_10,
|
||||
(int)EvfolyamTipusEnum._10_s,
|
||||
(int)EvfolyamTipusEnum._10_szakgimnazium,
|
||||
(int)EvfolyamTipusEnum._10_gimnazium,
|
||||
(int)EvfolyamTipusEnum._10_szakiskola,
|
||||
(int)EvfolyamTipusEnum._10_keszsegfejleszto_iskola,
|
||||
(int)EvfolyamTipusEnum._2_10_4_es_szintu_szakkepzo_iskola,
|
||||
(int)EvfolyamTipusEnum._10_szakgimnazium_nkt,
|
||||
(int)EvfolyamTipusEnum._10_szakgimnazium_nkt_ket_tanitasi_nyelvu_
|
||||
};
|
||||
|
||||
public static List<int> FeltarAlkalmazottEszkozigenylesMunkakorTipusList = new List<int>()
|
||||
{
|
||||
(int)MunkakorTipusEnum.konyvtarostanar_tanito,
|
||||
(int)MunkakorTipusEnum.logopedus,
|
||||
(int)MunkakorTipusEnum.pszichologus,
|
||||
(int)MunkakorTipusEnum.szocialpedagogus,
|
||||
(int)MunkakorTipusEnum.gyogypedagogus,
|
||||
(int)MunkakorTipusEnum.konduktor,
|
||||
(int)MunkakorTipusEnum.egyuttnevelest_segito_pedagogus,
|
||||
(int)MunkakorTipusEnum.enekzene_tanar,
|
||||
(int)MunkakorTipusEnum.gimnaziumi_tanar,
|
||||
(int)MunkakorTipusEnum.gyogytestnevelo_tanar,
|
||||
(int)MunkakorTipusEnum.idegennyelvtanar,
|
||||
(int)MunkakorTipusEnum.kozismereti_tantargyat_nemzetisegi_nyelven_oktato_tanar,
|
||||
(int)MunkakorTipusEnum.kozismereti_tantargyat_oktato_kozepiskolai_tanar,
|
||||
(int)MunkakorTipusEnum.kozismereti_tantargyat_oktato_tanar_szakkozepiskola,
|
||||
(int)MunkakorTipusEnum.nemzetisegi_nyelvtanar,
|
||||
(int)MunkakorTipusEnum.nemzetisegi_tanito,
|
||||
(int)MunkakorTipusEnum.Iskolapszichologus,
|
||||
(int)MunkakorTipusEnum.szakmai_elmeleti_tantargyat_oktato_tanar,
|
||||
(int)MunkakorTipusEnum.szakmai_tanar_szakoktato_gyakorlati_oktato,
|
||||
(int)MunkakorTipusEnum.szakmai_tantargyat_tanito_tanar,
|
||||
(int)MunkakorTipusEnum.szakoktato,
|
||||
(int)MunkakorTipusEnum.tanar,
|
||||
(int)MunkakorTipusEnum.tanar_a_szakmai_elmeleti_oktatasban,
|
||||
(int)MunkakorTipusEnum.tanito_tanar,
|
||||
(int)MunkakorTipusEnum.testnevelo,
|
||||
(int)MunkakorTipusEnum.FejlesztoPedagogus,
|
||||
(int)MunkakorTipusEnum.kollegiumi_nevelotanar,
|
||||
(int)MunkakorTipusEnum.Tanito,
|
||||
(int)MunkakorTipusEnum.fejlesztopedagogus,
|
||||
(int)MunkakorTipusEnum.AltalAnosIskolaiTanar,
|
||||
(int)MunkakorTipusEnum.SzakmaiTanar,
|
||||
(int)MunkakorTipusEnum.GyakorlatiOktato,
|
||||
(int)MunkakorTipusEnum.konyvtarostanar,
|
||||
(int)MunkakorTipusEnum.konyvtarostanito,
|
||||
(int)MunkakorTipusEnum.utazo_gyogypedagogus,
|
||||
(int)MunkakorTipusEnum.utazo_konduktor,
|
||||
(int)MunkakorTipusEnum.idegennyelv_tantagykategoriat_oktato_oktato_,
|
||||
(int)MunkakorTipusEnum.konyvtaros_oktato_oktatoi_feladatokat_is_ellat_,
|
||||
(int)MunkakorTipusEnum.kozismereti_tantargyat_oktato_kozepiskolai_oktato_,
|
||||
(int)MunkakorTipusEnum.kozismereti_tantargyat_oktato_oktato_,
|
||||
(int)MunkakorTipusEnum.szakmai_oktato_felsofoku_vegzettseggel_,
|
||||
(int)MunkakorTipusEnum.szakmai_oktato_kozepfoku_vegzettseggel_,
|
||||
(int)MunkakorTipusEnum.kozismereti_tantargyat_oktato_kozepiskola,
|
||||
(int)MunkakorTipusEnum.kozismereti_tantargyat_oktato_szakgimnaziumi_tanar,
|
||||
(int)MunkakorTipusEnum.kozismereti_tantargyat_oktato_tanar,
|
||||
(int)MunkakorTipusEnum.muveszeti_szakmai_tantargyat_oktato_tanar,
|
||||
(int)MunkakorTipusEnum.szakmai_tantargyat_oktato_tanar,
|
||||
(int)MunkakorTipusEnum.tanacsado_pedagogus,
|
||||
};
|
||||
|
||||
public static List<string> EnableTeremberlesIntezmenyAzonList = new List<string>()
|
||||
{
|
||||
"szrszc-kossuth",
|
||||
"szrszc-tokaji",
|
||||
"szrszc-brassai",
|
||||
"sszc-fay",
|
||||
"sszc-berg",
|
||||
"sszc-idegenforgalmi",
|
||||
"sszc-vasvilla",
|
||||
"sszc-handler",
|
||||
"sszc-csornai",
|
||||
"bgaszc-budai",
|
||||
"bgaszc-budaigimn",
|
||||
"bgaszc-karolyi",
|
||||
"bgaszc-terezvarosi",
|
||||
"bgaszc-bekesy",
|
||||
"bgaszc-keleti",
|
||||
"bgaszc-teleki",
|
||||
"bgaszc-varga",
|
||||
"bgaszc-harsanyi",
|
||||
"bgaszc-pestszentlorinci",
|
||||
"bgaszc-berzeviczy",
|
||||
"bgaszc-hunfalvy",
|
||||
"bgaszc-szechenyi",
|
||||
"bgaszc-pesterzsebeti",
|
||||
"bgaszc-rakoczi",
|
||||
"bgaszc-szasz",
|
||||
"bgaszc-szentistvan",
|
||||
"bgaszc-vasarhelyi",
|
||||
"bgaszc-belvarosi",
|
||||
"bgaszc-csete",
|
||||
"bgaszc-perlasca",
|
||||
"bgaszc-dobos",
|
||||
"dszc-pechy",
|
||||
"dszc-mechwart",
|
||||
"dszc-beregszaszi",
|
||||
"szkszc-valyi",
|
||||
"szkszc-ady",
|
||||
"bardos",
|
||||
"klik037166001",
|
||||
"klik037119001"
|
||||
#if DEBUG
|
||||
,"biatorbagyi"
|
||||
#endif
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Kreta.Core.CustomAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
|
||||
public class AdoszamExtendedAttribute : DataTypeAttribute
|
||||
{
|
||||
public bool IsNullValid { get; }
|
||||
|
||||
public bool IsEmptyValid { get; }
|
||||
|
||||
public AdoszamExtendedAttribute(bool isNullValid = true, bool isEmptyValid = true) : base(DataType.Custom)
|
||||
{
|
||||
IsNullValid = isNullValid;
|
||||
IsEmptyValid = isEmptyValid;
|
||||
}
|
||||
|
||||
public override bool IsValid(object value)
|
||||
{
|
||||
//NOTE: Null esetében, az IsNullValid property értékétől függően térünk vissza, hogy valid-e vagy sem!
|
||||
if (value == null)
|
||||
{
|
||||
return IsNullValid;
|
||||
}
|
||||
|
||||
string valueAsString = value as string;
|
||||
|
||||
//NOTE: Ha nem sikerül string-é alakítani a nem null value-t, akkor rossz a value típusa, ezért nem lesz valid!
|
||||
if (valueAsString == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//NOTE: Üres string esetében, az IsEmptyValid property értékétől függően térünk vissza, hogy valid-e vagy sem!
|
||||
if (valueAsString == string.Empty)
|
||||
{
|
||||
return IsEmptyValid;
|
||||
}
|
||||
|
||||
//NOTE: Levalidáljuk a Regex alapján!
|
||||
Match match = new Regex(Constants.RegularExpressions.Adoszam).Match(valueAsString);
|
||||
return match.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Kreta.Core.Enum;
|
||||
using Kreta.Core.Exceptions;
|
||||
|
||||
namespace Kreta.Core.CustomAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class ColumnNameAttribute : Attribute
|
||||
{
|
||||
public string[] ColumnName { get; private set; }
|
||||
|
||||
public ColumnNameAttribute(params string[] columnNames)
|
||||
{
|
||||
if (columnNames == null || columnNames.Length == 0)
|
||||
{
|
||||
throw new BlException(BlExceptionType.ListaNemTartalmazElemet);
|
||||
}
|
||||
|
||||
foreach (string columnName in columnNames)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(columnName))
|
||||
{
|
||||
throw new BlException(BlExceptionType.ValtozoErtekeNemLehetNull);
|
||||
}
|
||||
}
|
||||
|
||||
ColumnName = columnNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text;
|
||||
|
||||
namespace Kreta.Core.CustomAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
|
||||
public class EmailAddressExtendedAttribute : DataTypeAttribute
|
||||
{
|
||||
public bool IsNullValid { get; }
|
||||
|
||||
public bool IsEmptyValid { get; }
|
||||
|
||||
//NOTE: A beépített EmailAddressAttribute a null-t valid true-nak, az üres string-et valid false-nak veszi alapból, ezért ezek a default értékek itt is!
|
||||
public EmailAddressExtendedAttribute(bool isNullValid = true, bool isEmptyValid = false) : base(DataType.EmailAddress)
|
||||
{
|
||||
IsNullValid = isNullValid;
|
||||
IsEmptyValid = isEmptyValid;
|
||||
}
|
||||
|
||||
public override bool IsValid(object value)
|
||||
{
|
||||
//NOTE: Null esetében, az IsNullValid property értékétől függően térünk vissza, hogy valid-e vagy sem!
|
||||
if (value == null)
|
||||
{
|
||||
return IsNullValid;
|
||||
}
|
||||
|
||||
string valueAsString = value as string;
|
||||
|
||||
//NOTE: Ha nem sikerül string-é alakítani a nem null value-t, akkor rossz a value típusa, ezért nem lesz valid!
|
||||
if (valueAsString == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//NOTE: Üres string esetében, az IsEmptyValid property értékétől függően térünk vissza, hogy valid-e vagy sem!
|
||||
if (valueAsString == string.Empty)
|
||||
{
|
||||
return IsEmptyValid;
|
||||
}
|
||||
|
||||
//NOTE: Azért encode-oljuk ISO-8859-8-ra, mert ezzel kiszedjük az ékezeteket(és az esetleges egyéb nem engedélyezett karaktereket) a valueAsString-ből.
|
||||
// Ha az encode-olás utáni string nem egyezik meg az eredeti valueAsString-el, akkor volt benne ékezet(vagy egyéb nem engedélyezett karakter) és nem valid az email cím!
|
||||
byte[] tempByteArray = Encoding.GetEncoding(Constants.EncodingName.ISO_8859_8).GetBytes(valueAsString);
|
||||
string encodedString = Encoding.UTF8.GetString(tempByteArray);
|
||||
if (!encodedString.Equals(valueAsString))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//NOTE: Végül levalidáljuk a beépített EmailAddressAttribute validációjával!
|
||||
bool result = new EmailAddressAttribute().IsValid(valueAsString);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace Kreta.Core.CustomAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class IgnoreAttribute : Attribute
|
||||
{
|
||||
public IgnoreAttribute()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Kreta.Core.CustomAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
|
||||
public class PhoneExtendedAttribute : DataTypeAttribute
|
||||
{
|
||||
public bool IsNullValid { get; }
|
||||
|
||||
public bool IsEmptyValid { get; }
|
||||
|
||||
//NOTE: A beépített PhoneAttribute a null-t valid true-nak, az üres string-et valid false-nak veszi alapból, ezért ezek a default értékek itt is!
|
||||
public PhoneExtendedAttribute(bool isNullValid = true, bool isEmptyValid = false) : base(DataType.PhoneNumber)
|
||||
{
|
||||
IsNullValid = isNullValid;
|
||||
IsEmptyValid = isEmptyValid;
|
||||
}
|
||||
|
||||
public override bool IsValid(object value)
|
||||
{
|
||||
//NOTE: Null esetében, az IsNullValid property értékétől függően térünk vissza, hogy valid-e vagy sem!
|
||||
if (value == null)
|
||||
{
|
||||
return IsNullValid;
|
||||
}
|
||||
|
||||
string valueAsString = value as string;
|
||||
|
||||
//NOTE: Ha nem sikerül string-é alakítani a nem null value-t, akkor rossz a value típusa, ezért nem lesz valid!
|
||||
if (valueAsString == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//NOTE: Üres string esetében, az IsEmptyValid property értékétől függően térünk vissza, hogy valid-e vagy sem!
|
||||
if (valueAsString == string.Empty)
|
||||
{
|
||||
return IsEmptyValid;
|
||||
}
|
||||
|
||||
//NOTE: Levalidáljuk a Regex alapján! "+00000000000000000000"
|
||||
Match match = new Regex(Constants.RegularExpressions.Telefon).Match(valueAsString);
|
||||
if (!match.Success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//NOTE: Végül levalidáljuk a beépített PhoneAttribute validációjával!
|
||||
bool result = new PhoneAttribute().IsValid(valueAsString);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
using System;
|
||||
using System.Resources;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
|
||||
namespace Kreta.Core.CustomAttributes
|
||||
{
|
||||
/// <summary>
|
||||
/// Model, Co vagy egyéb objektumok property-jéhez használható attribute, ami egy excel export egy oszlopát definiálja.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
|
||||
public class SimpleExportColumnAttribute : Attribute
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private string _columnHeaderName;
|
||||
|
||||
private string _dropDownColumnSourceSheetGroupName;
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Az attribute egyedi "azonosítója".
|
||||
/// Ez azért kell, hogyha egy property-t, akár több export-hoz használunk, akkor egyértelműen be tudjuk azonosítani.
|
||||
/// Javaslat, hogy erre legyen egy kivezett konstans, aminek nameof()-al adunk értéket, hogy ha át akaruk nevezni, akkor ne egy string-et kelljen.
|
||||
/// Pl.: public const string ExportPropertyId = nameof(ExportPropertyId);
|
||||
/// Használat: ExportPropertyId
|
||||
/// </summary>
|
||||
public string AttributeId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Az oszlop indexe az excelben, ahová export-áljuk.
|
||||
/// 0-tól indexelünk!
|
||||
/// Használat: 00 vagy 12 vagy stb...
|
||||
/// </summary>
|
||||
public int Index { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Az oszlop header-jének a neve, azaz ami az első sorba fog kerülni export-áláskor a tényleges adatok felett.
|
||||
/// Használat: nameof(ImportExportEszkozResource.ImportHeaderNameMennyiseg)
|
||||
/// </summary>
|
||||
public string HeaderName
|
||||
{
|
||||
get => new ResourceManager(HeaderNameResourceType).GetString(_columnHeaderName);
|
||||
|
||||
set => _columnHeaderName = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az oszlop header-jének a Resource típusa, hogy honnan szedjük elő a header-nek a nevét.
|
||||
/// Használat: typeof(ImportExportEszkozResource)
|
||||
/// </summary>
|
||||
public Type HeaderNameResourceType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Ha megadjuk, akkor az oszlophoz tartozó lenyíló lista adatforrásának sheet neve lesz.
|
||||
/// Ezt akkor kell használni, ha több lenyíló listának kell használni egy sheet-et adatforrásként. Pl.: Állampolgárság/Állampolgárság2
|
||||
/// FONTOS: Ha ennek értéket adtunk, akkor kötelező a DropDownColumnSourceSheetGroupNameResourceType-nak is értéket adni!
|
||||
/// Használat: nameof(ImportExportEszkozResource.ImportHeaderNameMennyiseg)
|
||||
/// </summary>
|
||||
public string DropDownColumnSourceSheetGroupName
|
||||
{
|
||||
get => !string.IsNullOrWhiteSpace(_dropDownColumnSourceSheetGroupName) ? new ResourceManager(DropDownColumnSourceSheetGroupNameResourceType).GetString(_dropDownColumnSourceSheetGroupName) : null;
|
||||
set => _dropDownColumnSourceSheetGroupName = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ha megadjuk, akkor az oszlop header-jének a Resource típusa, hogy honnan szedjük elő az oszlophoz tartozó lenyíló lista adatforrásának sheet nevét.
|
||||
/// FONTOS: Ha ennek értéket adtunk, akkor kötelező a DropDownColumnSourceSheetGroupName-nak is értéket adni!
|
||||
/// Használat: typeof(ImportExportEszkozResource)
|
||||
/// </summary>
|
||||
public Type DropDownColumnSourceSheetGroupNameResourceType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Ha megadjuk, akkor az oszlophoz generál egy aggregált értéket az oszlop értékeiből az utolsó sor után.
|
||||
/// FONTOS: AGGREGATE function is designed vertical ranges, not horizontal ranges.
|
||||
/// https://support.microsoft.com/en-us/office/aggregate-function-43b9278e-6aa7-4f17-92b6-e19993fa26df
|
||||
/// Default értéke: ExcelAggregateFunctionEnum.NONE és így nem lesz figyelembe véve.
|
||||
/// Használat: AggregateFunction = ExcelAggregateFunctionEnum.SUM
|
||||
/// </summary>
|
||||
public ExcelAggregateFunctionEnum AggregateFunction { get; set; } = ExcelAggregateFunctionEnum.NONE;
|
||||
|
||||
/// <summary>
|
||||
/// Ha az oszlop bool típusú, akkor annak a megjelenítéséhez használható paraméter.
|
||||
/// Default értéke: BooleanDisplayFormatEnum.Teljes(azaz Igen/Nem fog megjelenni)
|
||||
/// Használat: BooleanDisplayFormat = BooleanDisplayFormatEnum.IN
|
||||
/// </summary>
|
||||
public BooleanDisplayFormatEnum BooleanDisplayFormat { get; set; } = BooleanDisplayFormatEnum.Teljes;
|
||||
|
||||
/// <summary>
|
||||
/// Ha az oszlop DateTime típusú, akkor annak a formázáshoz használható paraméter.
|
||||
/// Default értéke: Kreta.Core.Constants.ToStringPattern.HungarianDate
|
||||
/// Használat: DateTimeToStringPattern = Constants.ToStringPattern.HungarianDateTimeWithoutSeconds
|
||||
/// </summary>
|
||||
public string DateTimeToStringPattern { get; set; } = Constants.ToStringPattern.HungarianDate;
|
||||
|
||||
/// <summary>
|
||||
/// Ha az oszlop decimal/decimal?/double/double? típusú, akkor az excel-ben megjelenő tizedesjegyek számának meghatározásához használható paraméter.
|
||||
/// Default értéke: 2
|
||||
/// Használat: DecimalDigitCount = 0
|
||||
/// </summary>
|
||||
public int DecimalDigitCount { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Force-olhatunk egy oszlopot, hogy az excel-ben milyen típusént viselkedjen, az eredeti típusához képest.
|
||||
/// Erre példa, hogyha egy van egy string mezőnk, de mi szeretnénk, hogy bool-ként viselkedjen és az oszlophoz tartozzon egy bool lenyíló lista.
|
||||
/// Ezzel óvatosan kell bánni, mert ha nagyon eltér az excel-ben a mező értéke és a típusa az hibát okozhat vagy rosszul jelenhet meg.
|
||||
/// Pl.: DateTime int-ként nem dátum formátumú lesz, hanem a az adot dátum-ból csinál egy int-et az excel(2020.08.01. -> 44044).
|
||||
/// Használat: ForcedType = typeof(int)
|
||||
/// </summary>
|
||||
public Type ForcedType { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Ez alapján dől el, hogy a szöveget a cellában HTML-ként, vagy sima szövegként fogja megjeleníteni.
|
||||
/// Default értéke: false
|
||||
/// Használat: AsHtml = true
|
||||
/// </summary>
|
||||
public bool AsHtml { get; set; } = false;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Model, Co vagy egyéb objektumok property-jéhez használható attribute, ami egy excel export egy oszlopát definiálja.
|
||||
/// </summary>
|
||||
/// <param name="attributeId">Az attribute egyedi "azonosítója".</param>
|
||||
/// <param name="index">Az oszlop indexe az excelben, ahová export-áljuk.</param>
|
||||
/// <param name="headerName">Az oszlop header-jének a neve, azaz ami az első sorba fog kerülni export-áláskor a tényleges adatok felett.</param>
|
||||
/// <param name="headerNameResourceType">Az oszlop header-jének a Resource típusa, hogy honnan szedjük elő a header-nek a nevét.</param>
|
||||
/// <param name="dropDownColumnSourceSheetGroupName">Ha megadjuk, akkor az oszlophoz tartozó lenyíló lista adatforrásának sheet neve lesz.</param>
|
||||
/// <param name="dropDownColumnSourceSheetGroupNameResourceType">Ha megadjuk, akkor az oszlop header-jének a Resource típusa, hogy honnan szedjük elő az oszlophoz tartozó lenyíló lista adatforrásának sheet nevét.</param>
|
||||
public SimpleExportColumnAttribute(
|
||||
string attributeId,
|
||||
int index,
|
||||
string headerName,
|
||||
Type headerNameResourceType,
|
||||
string dropDownColumnSourceSheetGroupName = null,
|
||||
Type dropDownColumnSourceSheetGroupNameResourceType = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(dropDownColumnSourceSheetGroupName) && dropDownColumnSourceSheetGroupNameResourceType != null ||
|
||||
!string.IsNullOrWhiteSpace(dropDownColumnSourceSheetGroupName) && dropDownColumnSourceSheetGroupNameResourceType == null)
|
||||
{
|
||||
throw new ArgumentException($"Ha bármelyiknek a kettőből érték lett adva, akkor kötelező a másiknak is: {nameof(dropDownColumnSourceSheetGroupName)}, {nameof(dropDownColumnSourceSheetGroupNameResourceType)}");
|
||||
}
|
||||
|
||||
AttributeId = attributeId;
|
||||
Index = index;
|
||||
HeaderName = headerName;
|
||||
HeaderNameResourceType = headerNameResourceType;
|
||||
DropDownColumnSourceSheetGroupName = dropDownColumnSourceSheetGroupName;
|
||||
DropDownColumnSourceSheetGroupNameResourceType = dropDownColumnSourceSheetGroupNameResourceType;
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.Core.Enum;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class DetailedErrorItem
|
||||
{
|
||||
public DetailedErrorItem(string propertyName, string message, BlExceptionType exceptionType)
|
||||
{
|
||||
PropertyName = propertyName;
|
||||
Message = message;
|
||||
ExceptionType = exceptionType;
|
||||
}
|
||||
|
||||
[Required, Description("FE property azonosítására vagy entitás azonosítására szolgáló érték")]
|
||||
public string PropertyName { get; set; }
|
||||
|
||||
[Required, Description("Ember által olvasható hibaüzenet<br>kliens dönti el, hogy megjeleníti-e a felhasználó számára")]
|
||||
public string Message { get; set; }
|
||||
|
||||
[Required, Description("Az exception típusa; röviden az ok, ami kiváltotta"), JsonConverter(typeof(StringEnumConverter))]
|
||||
public BlExceptionType ExceptionType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Core.Domain.EqualityComparer
|
||||
{
|
||||
public class KirFelhasznaloEqualityComparer : IEqualityComparer<KirFelhasznalo>
|
||||
{
|
||||
public bool Equals(KirFelhasznalo x, KirFelhasznalo y)
|
||||
{
|
||||
if (x == null && y == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (x == null || y == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
x.SzuletesiHely.Equals(y.SzuletesiHely, StringComparison.OrdinalIgnoreCase) &&
|
||||
x.SzuletesiNev.Equals(y.SzuletesiNev, StringComparison.OrdinalIgnoreCase) &&
|
||||
x.SzuletesiDatum.Equals(y.SzuletesiDatum) &&
|
||||
x.AnyjaNeve.Equals(y.AnyjaNeve, StringComparison.OrdinalIgnoreCase) &&
|
||||
x.OktatasiAzonosito.Equals(y.OktatasiAzonosito, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public int GetHashCode(KirFelhasznalo obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return obj.SzuletesiHely.GetHashCode() ^
|
||||
obj.SzuletesiNev.GetHashCode() ^
|
||||
obj.SzuletesiDatum.GetHashCode() ^
|
||||
obj.AnyjaNeve.GetHashCode() ^
|
||||
obj.OktatasiAzonosito.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class FelhasznaloElerhetosegTelCO
|
||||
{
|
||||
public int? ID { get; set; }
|
||||
public int FelhasznaloId { get; set; }
|
||||
|
||||
public string Telefonszam { get; set; }
|
||||
public bool Alapertelmezett { get; set; }
|
||||
public string Leiras { get; set; }
|
||||
public int TelefonTipusa { get; set; }
|
||||
}
|
||||
|
||||
public class FelhasznaloElerhetosegEmailCO
|
||||
{
|
||||
public int? ID { get; set; }
|
||||
public int FelhasznaloId { get; set; }
|
||||
|
||||
public string EmailCim { get; set; }
|
||||
public bool Alapertelmezett { get; set; }
|
||||
public int EmailTipusa { get; set; }
|
||||
}
|
||||
|
||||
public class FelhasznaloElerhetosegCimCO
|
||||
{
|
||||
public int? ID { get; set; }
|
||||
public int FelhasznaloId { get; set; }
|
||||
public int? Orszag { get; set; }
|
||||
public int? CimTipus { get; set; }
|
||||
public string Iranyitoszam { get; set; }
|
||||
public string HelysegNev { get; set; }
|
||||
public string KozteruletNev { get; set; }
|
||||
public string KozteruletTipusNev { get; set; }
|
||||
public string Hazszam { get; set; }
|
||||
public string Emelet { get; set; }
|
||||
public string Ajto { get; set; }
|
||||
public bool Alapertelmezett { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace Kreta.Core.Domain.Interface
|
||||
{
|
||||
public interface IKirAlkalmazott : IKirFelhasznalo
|
||||
{
|
||||
DateTime? AlkalmazasKezdete { get; set; }
|
||||
DateTime? AlkalmazasMegszunese { get; set; }
|
||||
string FoglalkoztatasTipusa { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
|
||||
namespace Kreta.Core.Domain.Interface
|
||||
{
|
||||
public interface IKirFelhasznalo
|
||||
{
|
||||
int Id { get; set; }
|
||||
string NevElotag { get; set; }
|
||||
string Vezeteknev { get; set; }
|
||||
string Utonev { get; set; }
|
||||
string SzuletesiNev { get; set; }
|
||||
string NyomtatasiNev { get; set; }
|
||||
bool NevSorrend { get; set; }
|
||||
string SzuletesiVezeteknev { get; set; }
|
||||
string SzuletesiUtonev { get; set; }
|
||||
string SzuletesiNevSorrenddel { get; set; }
|
||||
bool SzuletesiNevSorrend { get; set; }
|
||||
string AnyjaVezetekNeve { get; set; }
|
||||
string AnyjaUtoneve { get; set; }
|
||||
string AnyjaNeveSorrenddel { get; set; }
|
||||
bool AnyjaNeveSorrend { get; set; }
|
||||
DateTime? SzuletesiDatum { get; set; }
|
||||
string OktatasiAzonosito { get; set; }
|
||||
string SzuletesiOrszag { get; set; }
|
||||
string Allampolgarsag { get; set; }
|
||||
string Allampolgarsag2 { get; set; }
|
||||
string SzuletesiHely { get; set; }
|
||||
string AnyjaNeve { get; set; }
|
||||
string Nem { get; set; }
|
||||
string Email { get; set; }
|
||||
string Telefonszam { get; set; }
|
||||
string TajSzam { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace Kreta.Core.Domain.Interface
|
||||
{
|
||||
public interface IKirTanulo : IKirFelhasznalo
|
||||
{
|
||||
DateTime? TankotelezettsegVege { get; set; }
|
||||
bool TankotelezettsegetTeljesito { get; set; }
|
||||
bool SajatosNevelesIgenyu { get; set; }
|
||||
bool BeilleszkedesselKuzd { get; set; }
|
||||
bool JogviszonyStatusza { get; set; }
|
||||
DateTime? JogviszonyKezdete { get; set; }
|
||||
DateTime? JogviszonyVarBefejezese { get; set; }
|
||||
string JogviszonyJellege { get; set; }
|
||||
bool Vendegtanulo { get; set; }
|
||||
bool Magantanulo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using Kreta.Core.Domain.Interface;
|
||||
using Kreta.Core.KIR.Domain.Model.KirExport;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class KirAlkalmazott : KirFelhasznalo, IKirAlkalmazott, IEquatable<KirAlkalmazott>
|
||||
{
|
||||
public DateTime? AlkalmazasKezdete { get; set; }
|
||||
public DateTime? AlkalmazasMegszunese { get; set; }
|
||||
public string FoglalkoztatasTipusa { get; set; }
|
||||
|
||||
public bool Equals(KirAlkalmazott other)
|
||||
=> other != null &&
|
||||
base.Equals(other) &&
|
||||
AlkalmazasKezdete == other.AlkalmazasKezdete &&
|
||||
AlkalmazasMegszunese == other.AlkalmazasMegszunese &&
|
||||
FoglalkoztatasTipusa == other.FoglalkoztatasTipusa;
|
||||
|
||||
public static implicit operator KirAlkalmazott(AlkalmazottModel alkalmazottModel) => new KirAlkalmazott
|
||||
{
|
||||
Allampolgarsag = alkalmazottModel.Allampolgarsag,
|
||||
Allampolgarsag2 = alkalmazottModel.Allampolgarsag2,
|
||||
AllandoLakcim = alkalmazottModel.AllandoLakcim,
|
||||
TartozkodasiCim = alkalmazottModel.TartozkodasiCim,
|
||||
AnyjaNeve = alkalmazottModel.AnyjaNeve,
|
||||
AnyjaUtoneve = alkalmazottModel.AnyjaKeresztNeve,
|
||||
AnyjaNeveSorrend = alkalmazottModel.AnyjaNeveSorrend,
|
||||
AnyjaVezetekNeve = alkalmazottModel.AnyjaVezetekNeve,
|
||||
Email = alkalmazottModel.EmailCim,
|
||||
AlkalmazasMegszunese = alkalmazottModel.JogviszonyBefejezese,
|
||||
AlkalmazasKezdete = alkalmazottModel.JogviszonyKezdete,
|
||||
FoglalkoztatasTipusa = alkalmazottModel.JogviszonyTipusa,
|
||||
OktatasiAzonosito = alkalmazottModel.OktatasiAzonosito,
|
||||
SzuletesiDatum = alkalmazottModel.SzuletesiDatum,
|
||||
SzuletesiHely = alkalmazottModel.SzuletesiHely,
|
||||
SzuletesiNev = $"{alkalmazottModel.SzuletesiVezetekNev} {alkalmazottModel.SzuletesiKeresztNev}",
|
||||
SzuletesiUtonev = alkalmazottModel.SzuletesiKeresztNev,
|
||||
SzuletesiNevSorrend = alkalmazottModel.SzuletesiNevSorrend,
|
||||
SzuletesiVezeteknev = alkalmazottModel.SzuletesiVezetekNev,
|
||||
SzuletesiOrszag = alkalmazottModel.SzuletesiOrszag,
|
||||
Telefonszam = alkalmazottModel.Telefonszam,
|
||||
NevElotag = alkalmazottModel.ViseltNevElotag,
|
||||
Utonev = alkalmazottModel.ViseltKeresztNev,
|
||||
NevSorrend = alkalmazottModel.ViseltNevSorrend,
|
||||
Vezeteknev = alkalmazottModel.ViseltVezetekNev,
|
||||
Nem = alkalmazottModel.Nem
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class KirAlkalmazottAlapadatok : KirAlkalmazottBase
|
||||
{
|
||||
[JsonProperty(Order = 1)]
|
||||
public string OktatasiAzonosito { get; set; }
|
||||
|
||||
[JsonProperty(Order = 3)]
|
||||
public string NevElotag { get; set; }
|
||||
|
||||
[JsonProperty(Order = 3)]
|
||||
public string Vezeteknev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 4)]
|
||||
public string Utonev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 5)]
|
||||
public string SzuletesiVezeteknev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 6)]
|
||||
public string SzuletesiUtonev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 7)]
|
||||
public string AnyjaNeveVezeteknev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 8)]
|
||||
public string AnyjaNeveUtonev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 2)]
|
||||
public string Nem { get; set; }
|
||||
|
||||
[JsonProperty(Order = 10)]
|
||||
public new DateTime? SzuletesiDatum { get; set; }
|
||||
|
||||
[JsonProperty(Order = 9)]
|
||||
public new string SzuletesiHely { get; set; }
|
||||
|
||||
[JsonProperty(Order = 10)]
|
||||
public string SzuletesiOrszag { get; set; }
|
||||
|
||||
[JsonProperty(Order = 11)]
|
||||
public string Allampolgarsag { get; set; }
|
||||
|
||||
[JsonProperty(Order = 12)]
|
||||
public string Allampolgarsag2 { get; set; }
|
||||
|
||||
public static implicit operator KirAlkalmazottAlapadatok(KirAlkalmazott kirAlkalmazott) => new KirAlkalmazottAlapadatok
|
||||
{
|
||||
AnyjaNeveUtonev = kirAlkalmazott.AnyjaUtoneve,
|
||||
NevElotag = kirAlkalmazott.NevElotag,
|
||||
AnyjaNeveVezeteknev = kirAlkalmazott.AnyjaVezetekNeve,
|
||||
OktatasiAzonosito = kirAlkalmazott.OktatasiAzonosito,
|
||||
SzuletesiDatum = kirAlkalmazott.SzuletesiDatum,
|
||||
SzuletesiHely = kirAlkalmazott.SzuletesiHely,
|
||||
SzuletesiUtonev = kirAlkalmazott.SzuletesiUtonev,
|
||||
SzuletesiVezeteknev = kirAlkalmazott.SzuletesiVezeteknev,
|
||||
Utonev = kirAlkalmazott.Utonev,
|
||||
Vezeteknev = kirAlkalmazott.Vezeteknev,
|
||||
Allampolgarsag = kirAlkalmazott.Allampolgarsag,
|
||||
Allampolgarsag2 = kirAlkalmazott.Allampolgarsag2,
|
||||
SzuletesiOrszag = kirAlkalmazott.SzuletesiOrszag,
|
||||
Nem = kirAlkalmazott.Nem
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public abstract class KirAlkalmazottBase
|
||||
{
|
||||
[JsonIgnore]
|
||||
public string SzuletesiNev { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string AnyjaNeve { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public DateTime? SzuletesiDatum { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SzuletesiHely { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class KirAlkalmazottElerhetosegek : KirAlkalmazottBase
|
||||
{
|
||||
[JsonProperty(Order = 11)]
|
||||
public string Email { get; set; }
|
||||
|
||||
[JsonProperty(Order = 12)]
|
||||
public string Telefonszam { get; set; }
|
||||
|
||||
[JsonProperty(Order = 1)]
|
||||
public string AllandoLakcimIranyitoszam { get; set; }
|
||||
|
||||
[JsonProperty(Order = 2)]
|
||||
public string AllandoLakcimVaros { get; set; }
|
||||
|
||||
[JsonProperty(Order = 3)]
|
||||
public string AllandoLakcimKozteruletNev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 4)]
|
||||
public string AllandoLakcimKozteruletJellegeNev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 5)]
|
||||
public string AllandoLakcimHazszam { get; set; }
|
||||
|
||||
[JsonProperty(Order = 6)]
|
||||
public string TartozkodasiCimIranyitoszam { get; set; }
|
||||
|
||||
[JsonProperty(Order = 7)]
|
||||
public string TartozkodasiCimVaros { get; set; }
|
||||
|
||||
[JsonProperty(Order = 8)]
|
||||
public string TartozkodasiCimKozteruletNev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 9)]
|
||||
public string TartozkodasiCimKozteruletJellegeNev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 10)]
|
||||
public string TartozkodasiCimHazszam { get; set; }
|
||||
|
||||
public static implicit operator KirAlkalmazottElerhetosegek(KirAlkalmazott kirAlkalmazott) => new KirAlkalmazottElerhetosegek
|
||||
{
|
||||
Email = kirAlkalmazott.Email,
|
||||
Telefonszam = kirAlkalmazott.Telefonszam,
|
||||
AllandoLakcimHazszam = kirAlkalmazott.AllandoLakcim.Hazszam,
|
||||
AllandoLakcimIranyitoszam = kirAlkalmazott.AllandoLakcim.Iranyitoszam,
|
||||
AllandoLakcimKozteruletNev = kirAlkalmazott.AllandoLakcim.KozteruletNev,
|
||||
AllandoLakcimKozteruletJellegeNev = kirAlkalmazott.AllandoLakcim.KozteruletJellege,
|
||||
AllandoLakcimVaros = kirAlkalmazott.AllandoLakcim.Varos,
|
||||
TartozkodasiCimIranyitoszam = kirAlkalmazott.TartozkodasiCim.Iranyitoszam,
|
||||
TartozkodasiCimVaros = kirAlkalmazott.TartozkodasiCim.Varos,
|
||||
TartozkodasiCimKozteruletNev = kirAlkalmazott.TartozkodasiCim.KozteruletNev,
|
||||
TartozkodasiCimKozteruletJellegeNev = kirAlkalmazott.TartozkodasiCim.KozteruletJellege,
|
||||
TartozkodasiCimHazszam = kirAlkalmazott.TartozkodasiCim.Hazszam
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class KirAlkalmazottMunkaugyiAdatok : KirAlkalmazottBase
|
||||
{
|
||||
[JsonProperty(Order = 1)]
|
||||
public DateTime? AlkalmazasKezdete { get; set; }
|
||||
|
||||
[JsonProperty(Order = 2)]
|
||||
public DateTime? AlkalmazasMegszunese { get; set; }
|
||||
|
||||
[JsonProperty(Order = 3)]
|
||||
public string FoglalkoztatasTipusa { get; set; }
|
||||
|
||||
public static implicit operator KirAlkalmazottMunkaugyiAdatok(KirAlkalmazott kirAlkalmazott) => new KirAlkalmazottMunkaugyiAdatok
|
||||
{
|
||||
AlkalmazasKezdete = kirAlkalmazott.AlkalmazasKezdete,
|
||||
AlkalmazasMegszunese = kirAlkalmazott.AlkalmazasMegszunese,
|
||||
FoglalkoztatasTipusa = kirAlkalmazott.FoglalkoztatasTipusa
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using Kreta.Core.KIR.Domain.Model.KirExport;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class KirCim
|
||||
{
|
||||
public int FelhasznaloId { get; set; }
|
||||
public string Iranyitoszam { get; set; }
|
||||
public string Varos { get; set; }
|
||||
public string KozteruletNev { get; set; }
|
||||
public string KozteruletJellege { get; set; }
|
||||
public string Hazszam { get; set; }
|
||||
|
||||
public static implicit operator KirCim(CimModel cimModel) => new KirCim
|
||||
{
|
||||
Iranyitoszam = cimModel?.Iranyitoszam,
|
||||
Varos = cimModel?.Telepules,
|
||||
KozteruletNev = cimModel?.KozteruletNev,
|
||||
KozteruletJellege = cimModel?.KozteruletJellege,
|
||||
//AllandoLakcimPontositas = cimModel.Pontositas,
|
||||
Hazszam = cimModel?.Hazszam
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using Kreta.Core.CustomAttributes;
|
||||
using Kreta.Core.Domain.Interface;
|
||||
using Kreta.Enums;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class KirFelhasznalo : IKirFelhasznalo, IEquatable<KirFelhasznalo>
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string NevElotag { get; set; }
|
||||
public string Vezeteknev { get; set; }
|
||||
public string Utonev { get; set; }
|
||||
public string SzuletesiNev { get; set; }
|
||||
public string NyomtatasiNev { get; set; }
|
||||
public bool NevSorrend { get; set; }
|
||||
public string SzuletesiVezeteknev { get; set; }
|
||||
public string SzuletesiUtonev { get; set; }
|
||||
//Nem biztos hogy erre szükség van
|
||||
public string SzuletesiNevSorrenddel { get; set; }
|
||||
public bool SzuletesiNevSorrend { get; set; }
|
||||
public string AnyjaVezetekNeve { get; set; }
|
||||
public string AnyjaUtoneve { get; set; }
|
||||
public string AnyjaNeveSorrenddel { get; set; }
|
||||
public bool AnyjaNeveSorrend { get; set; }
|
||||
public DateTime? SzuletesiDatum { get; set; }
|
||||
public string OktatasiAzonosito { get; set; }
|
||||
public string SzuletesiOrszag { get; set; }
|
||||
public string Allampolgarsag { get; set; }
|
||||
public string Allampolgarsag2 { get; set; }
|
||||
public string SzuletesiHely { get; set; }
|
||||
public string AnyjaNeve { get; set; }
|
||||
public string Nem { get; set; }
|
||||
public string TajSzam { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Telefonszam { get; set; }
|
||||
|
||||
[Ignore()]
|
||||
public KirCim AllandoLakcim { get; set; }
|
||||
|
||||
[Ignore()]
|
||||
public KirCim TartozkodasiCim { get; set; }
|
||||
|
||||
public bool Equals(KirFelhasznalo other)
|
||||
=> other != null &&
|
||||
SzuletesiUtonev == other.SzuletesiUtonev &&
|
||||
OktatasiAzonosito == other.OktatasiAzonosito &&
|
||||
NevElotag == other.NevElotag &&
|
||||
Vezeteknev == other.Vezeteknev &&
|
||||
Utonev == other.Utonev &&
|
||||
SzuletesiVezeteknev == other.SzuletesiVezeteknev &&
|
||||
AnyjaVezetekNeve == other.AnyjaVezetekNeve &&
|
||||
AnyjaUtoneve == other.AnyjaUtoneve &&
|
||||
SzuletesiOrszag == other.SzuletesiOrszag &&
|
||||
Allampolgarsag == other.Allampolgarsag &&
|
||||
Allampolgarsag2 == other.Allampolgarsag2 &&
|
||||
Nem == other.Nem &&
|
||||
Email == other.Email &&
|
||||
Telefonszam == other.Telefonszam;
|
||||
|
||||
public static FelhasznaloElerhetosegCimCO ModelToAllandoLakcimToElerhetosegCimCo(KirFelhasznalo kirFelhasznalo)
|
||||
=> new FelhasznaloElerhetosegCimCO
|
||||
{
|
||||
FelhasznaloId = kirFelhasznalo.Id,
|
||||
Alapertelmezett = true,
|
||||
CimTipus = (int)CimTipusEnum.allando_lakcim,
|
||||
Hazszam = kirFelhasznalo.AllandoLakcim.Hazszam,
|
||||
Iranyitoszam = kirFelhasznalo.AllandoLakcim.Iranyitoszam,
|
||||
KozteruletTipusNev = kirFelhasznalo.AllandoLakcim.KozteruletJellege,
|
||||
KozteruletNev = kirFelhasznalo.AllandoLakcim.KozteruletNev,
|
||||
HelysegNev = kirFelhasznalo.AllandoLakcim.Varos
|
||||
};
|
||||
|
||||
public static FelhasznaloElerhetosegCimCO ModelToTartozkodasiCimToElerhetosegCimCo(KirFelhasznalo kirFelhasznalo)
|
||||
=> new FelhasznaloElerhetosegCimCO
|
||||
{
|
||||
FelhasznaloId = kirFelhasznalo.Id,
|
||||
Alapertelmezett = true,
|
||||
CimTipus = (int)CimTipusEnum.tartozkodasi_hely,
|
||||
Hazszam = kirFelhasznalo.TartozkodasiCim.Hazszam,
|
||||
Iranyitoszam = kirFelhasznalo.TartozkodasiCim.Iranyitoszam,
|
||||
KozteruletTipusNev = kirFelhasznalo.TartozkodasiCim.KozteruletJellege,
|
||||
KozteruletNev = kirFelhasznalo.TartozkodasiCim.KozteruletNev,
|
||||
HelysegNev = kirFelhasznalo.TartozkodasiCim.Varos
|
||||
};
|
||||
|
||||
public static implicit operator FelhasznaloElerhetosegTelCO(KirFelhasznalo kirFelhasznalo)
|
||||
=> new FelhasznaloElerhetosegTelCO
|
||||
{
|
||||
Alapertelmezett = true,
|
||||
Telefonszam = kirFelhasznalo.Telefonszam,
|
||||
TelefonTipusa = (int)TelefonTipusEnum.Ismeretlen
|
||||
};
|
||||
|
||||
public static implicit operator FelhasznaloElerhetosegEmailCO(KirFelhasznalo kirFelhasznalo)
|
||||
=> new FelhasznaloElerhetosegEmailCO
|
||||
{
|
||||
Alapertelmezett = true,
|
||||
EmailCim = kirFelhasznalo.Email,
|
||||
EmailTipusa = (int)EmailTipusEnum.Na
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class KirFelhasznaloElerhetosegek : KirAlkalmazottBase
|
||||
{
|
||||
[JsonProperty(Order = 11)]
|
||||
public string Email { get; set; }
|
||||
|
||||
[JsonProperty(Order = 12)]
|
||||
public string Telefonszam { get; set; }
|
||||
|
||||
[JsonProperty(Order = 1)]
|
||||
public string AllandoLakcimIranyitoszam { get; set; }
|
||||
|
||||
[JsonProperty(Order = 2)]
|
||||
public string AllandoLakcimVaros { get; set; }
|
||||
|
||||
[JsonProperty(Order = 3)]
|
||||
public string AllandoLakcimKozteruletNev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 4)]
|
||||
public string AllandoLakcimKozteruletJellegeNev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 5)]
|
||||
public string AllandoLakcimHazszam { get; set; }
|
||||
|
||||
[JsonProperty(Order = 6)]
|
||||
public string TartozkodasiCimIranyitoszam { get; set; }
|
||||
|
||||
[JsonProperty(Order = 7)]
|
||||
public string TartozkodasiCimVaros { get; set; }
|
||||
|
||||
[JsonProperty(Order = 8)]
|
||||
public string TartozkodasiCimKozteruletNev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 9)]
|
||||
public string TartozkodasiCimKozteruletJellegeNev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 10)]
|
||||
public string TartozkodasiCimHazszam { get; set; }
|
||||
|
||||
public static implicit operator KirFelhasznaloElerhetosegek(KirFelhasznalo kirFelhasznalo) => new KirFelhasznaloElerhetosegek
|
||||
{
|
||||
Email = kirFelhasznalo.Email,
|
||||
Telefonszam = kirFelhasznalo.Telefonszam,
|
||||
AllandoLakcimHazszam = kirFelhasznalo.AllandoLakcim.Hazszam,
|
||||
AllandoLakcimIranyitoszam = kirFelhasznalo.AllandoLakcim.Iranyitoszam,
|
||||
AllandoLakcimKozteruletNev = kirFelhasznalo.AllandoLakcim.KozteruletNev,
|
||||
AllandoLakcimKozteruletJellegeNev = kirFelhasznalo.AllandoLakcim.KozteruletJellege,
|
||||
AllandoLakcimVaros = kirFelhasznalo.AllandoLakcim.Varos,
|
||||
TartozkodasiCimIranyitoszam = kirFelhasznalo.TartozkodasiCim.Iranyitoszam,
|
||||
TartozkodasiCimVaros = kirFelhasznalo.TartozkodasiCim.Varos,
|
||||
TartozkodasiCimKozteruletNev = kirFelhasznalo.TartozkodasiCim.KozteruletNev,
|
||||
TartozkodasiCimKozteruletJellegeNev = kirFelhasznalo.TartozkodasiCim.KozteruletJellege,
|
||||
TartozkodasiCimHazszam = kirFelhasznalo.TartozkodasiCim.Hazszam
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using Kreta.Core.Domain.Interface;
|
||||
using Kreta.Core.KIR.Domain.Model.KirExport;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class KirTanulo : KirFelhasznalo, IKirTanulo, IEquatable<KirTanulo>
|
||||
{
|
||||
public DateTime? TankotelezettsegVege { get; set; }
|
||||
public bool TankotelezettsegetTeljesito { get; set; }
|
||||
public bool SajatosNevelesIgenyu { get; set; }
|
||||
public bool BeilleszkedesselKuzd { get; set; }
|
||||
public bool JogviszonyStatusza { get; set; }
|
||||
public DateTime? JogviszonyKezdete { get; set; }
|
||||
public DateTime? JogviszonyVarBefejezese { get; set; }
|
||||
public string JogviszonyJellege { get; set; }
|
||||
public bool Vendegtanulo { get; set; }
|
||||
public bool Magantanulo { get; set; }
|
||||
|
||||
public bool Equals(KirTanulo other)
|
||||
=> other != null &&
|
||||
base.Equals(other) &&
|
||||
TankotelezettsegVege == other.TankotelezettsegVege &&
|
||||
TankotelezettsegetTeljesito == other.TankotelezettsegetTeljesito &&
|
||||
SajatosNevelesIgenyu == other.SajatosNevelesIgenyu &&
|
||||
BeilleszkedesselKuzd == other.BeilleszkedesselKuzd &&
|
||||
JogviszonyStatusza == other.JogviszonyStatusza &&
|
||||
JogviszonyKezdete == other.JogviszonyKezdete &&
|
||||
JogviszonyVarBefejezese == other.JogviszonyVarBefejezese &&
|
||||
JogviszonyJellege == other.JogviszonyJellege &&
|
||||
Vendegtanulo == other.Vendegtanulo &&
|
||||
Magantanulo == other.Magantanulo;
|
||||
|
||||
public static implicit operator KirTanulo(TanuloModel tanuloModel) => new KirTanulo
|
||||
{
|
||||
AllandoLakcim = tanuloModel.AllandoLakcim,
|
||||
TartozkodasiCim = tanuloModel.TartozkodasiCim,
|
||||
Allampolgarsag = tanuloModel.Allampolgarsag,
|
||||
Allampolgarsag2 = tanuloModel.Allampolgarsag2,
|
||||
AnyjaNeve = tanuloModel.AnyjaNeve,
|
||||
AnyjaUtoneve = tanuloModel.AnyjaKeresztNeve,
|
||||
AnyjaNeveSorrend = tanuloModel.AnyjaNeveSorrend,
|
||||
AnyjaVezetekNeve = tanuloModel.AnyjaVezetekNeve,
|
||||
TankotelezettsegVege = tanuloModel.TankotelezettsegVege,
|
||||
TankotelezettsegetTeljesito = tanuloModel.TankotelezettsegetTeljesito,
|
||||
SajatosNevelesIgenyu = tanuloModel.SajatosNevelesIgenyu,
|
||||
BeilleszkedesselKuzd = tanuloModel.BeilleszkedesselKuzd,
|
||||
JogviszonyStatusza = tanuloModel.JogviszonyStatusza,
|
||||
JogviszonyKezdete = tanuloModel.JogviszonyKezdete,
|
||||
JogviszonyVarBefejezese = tanuloModel.JogviszonyVarBefejezese,
|
||||
OktatasiAzonosito = tanuloModel.OktatasiAzonosito,
|
||||
SzuletesiDatum = tanuloModel.SzuletesiDatum,
|
||||
SzuletesiHely = tanuloModel.SzuletesiHely,
|
||||
SzuletesiNev = $"{tanuloModel.SzuletesiVezetekNev} {tanuloModel.SzuletesiKeresztNev}",
|
||||
SzuletesiUtonev = tanuloModel.SzuletesiKeresztNev,
|
||||
SzuletesiNevSorrend = tanuloModel.SzuletesiNevSorrend,
|
||||
SzuletesiVezeteknev = tanuloModel.SzuletesiVezetekNev,
|
||||
SzuletesiOrszag = tanuloModel.SzuletesiOrszag,
|
||||
Telefonszam = tanuloModel.Telefonszam,
|
||||
NevElotag = tanuloModel.ViseltNevElotag,
|
||||
Utonev = tanuloModel.ViseltKeresztNev,
|
||||
NevSorrend = tanuloModel.ViseltNevSorrend,
|
||||
Vezeteknev = tanuloModel.ViseltVezetekNev,
|
||||
Nem = tanuloModel.Nem
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class KirTanuloAlapadatok : KirTanuloBase
|
||||
{
|
||||
[JsonProperty(Order = 1)]
|
||||
public string OktatasiAzonosito { get; set; }
|
||||
|
||||
[JsonProperty(Order = 3)]
|
||||
public string NevElotag { get; set; }
|
||||
|
||||
[JsonProperty(Order = 3)]
|
||||
public string Vezeteknev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 4)]
|
||||
public string Utonev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 5)]
|
||||
public string SzuletesiVezeteknev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 6)]
|
||||
public string SzuletesiUtonev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 7)]
|
||||
public string AnyjaNeveVezeteknev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 8)]
|
||||
public string AnyjaNeveUtonev { get; set; }
|
||||
|
||||
[JsonProperty(Order = 2)]
|
||||
public string Nem { get; set; }
|
||||
|
||||
[JsonProperty(Order = 10)]
|
||||
public new DateTime? SzuletesiDatum { get; set; }
|
||||
|
||||
[JsonProperty(Order = 9)]
|
||||
public new string SzuletesiHely { get; set; }
|
||||
|
||||
[JsonProperty(Order = 10)]
|
||||
public string SzuletesiOrszag { get; set; }
|
||||
|
||||
[JsonProperty(Order = 11)]
|
||||
public string Allampolgarsag { get; set; }
|
||||
|
||||
[JsonProperty(Order = 12)]
|
||||
public string Allampolgarsag2 { get; set; }
|
||||
|
||||
public static implicit operator KirTanuloAlapadatok(KirTanulo kirAlkalmazott) => new KirTanuloAlapadatok
|
||||
{
|
||||
AnyjaNeveUtonev = kirAlkalmazott.AnyjaUtoneve,
|
||||
NevElotag = kirAlkalmazott.NevElotag,
|
||||
AnyjaNeveVezeteknev = kirAlkalmazott.AnyjaVezetekNeve,
|
||||
OktatasiAzonosito = kirAlkalmazott.OktatasiAzonosito,
|
||||
SzuletesiDatum = kirAlkalmazott.SzuletesiDatum,
|
||||
SzuletesiHely = kirAlkalmazott.SzuletesiHely,
|
||||
SzuletesiUtonev = kirAlkalmazott.SzuletesiUtonev,
|
||||
SzuletesiVezeteknev = kirAlkalmazott.SzuletesiVezeteknev,
|
||||
Utonev = kirAlkalmazott.Utonev,
|
||||
Vezeteknev = kirAlkalmazott.Vezeteknev,
|
||||
Allampolgarsag = kirAlkalmazott.Allampolgarsag,
|
||||
Allampolgarsag2 = kirAlkalmazott.Allampolgarsag2,
|
||||
SzuletesiOrszag = kirAlkalmazott.SzuletesiOrszag,
|
||||
Nem = kirAlkalmazott.Nem
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public abstract class KirTanuloBase
|
||||
{
|
||||
[JsonIgnore]
|
||||
public string SzuletesiNev { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string AnyjaNeve { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public DateTime? SzuletesiDatum { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SzuletesiHely { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Core.Domain
|
||||
{
|
||||
public class KirTanuloJogviszonyAdatok : KirTanuloBase
|
||||
{
|
||||
[JsonProperty(Order = 1)]
|
||||
public bool JogviszonyStatusza { get; set; }
|
||||
|
||||
[JsonProperty(Order = 2)]
|
||||
public DateTime? JogviszonyKezdete { get; set; }
|
||||
|
||||
[JsonProperty(Order = 3)]
|
||||
public DateTime? JogviszonyVarBefejezese { get; set; }
|
||||
|
||||
[JsonProperty(Order = 4)]
|
||||
public string JogviszonyJellege { get; set; }
|
||||
|
||||
[JsonProperty(Order = 5)]
|
||||
public bool Vendegtanulo { get; set; }
|
||||
|
||||
[JsonProperty(Order = 6)]
|
||||
public bool Magantanulo { get; set; }
|
||||
|
||||
public static implicit operator KirTanuloJogviszonyAdatok(KirTanulo kirTanulo) => new KirTanuloJogviszonyAdatok
|
||||
{
|
||||
JogviszonyStatusza = kirTanulo.JogviszonyStatusza,
|
||||
JogviszonyKezdete = kirTanulo.JogviszonyKezdete,
|
||||
JogviszonyVarBefejezese = kirTanulo.JogviszonyVarBefejezese,
|
||||
JogviszonyJellege = kirTanulo.JogviszonyJellege,
|
||||
Vendegtanulo = kirTanulo.Vendegtanulo,
|
||||
Magantanulo = kirTanulo.Magantanulo
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace Kreta.Core.EntityInfos
|
||||
{
|
||||
public static class EntityLengths
|
||||
{
|
||||
public static class Cim
|
||||
{
|
||||
public const int AjtoLength = SDA.Kreta.Entities.Cim.AttributeLengthInfo.AjtoLength;
|
||||
public const int EmeletLength = SDA.Kreta.Entities.Cim.AttributeLengthInfo.EmeletLength;
|
||||
public const int HazszamLength = SDA.Kreta.Entities.Cim.AttributeLengthInfo.HazszamLength;
|
||||
}
|
||||
|
||||
public static class OraSorszamozasHalmaz
|
||||
{
|
||||
public const int NevLength = SDA.Kreta.Entities.OraSorszamozasHalmaz.AttributeLengthInfo.NevLength;
|
||||
}
|
||||
|
||||
public static class TanuloTanugyiAdatok
|
||||
{
|
||||
public const int BizonyitvanySzamaLength = SDA.Kreta.Entities.TanuloTanugyiAdatok.AttributeLengthInfo.BizonyitvanySzamaLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Kreta.Core.Enum
|
||||
{
|
||||
public enum BlExceptionType
|
||||
{
|
||||
[Display(Name = "Ismeretlen hiba történt!")]
|
||||
None = 0,
|
||||
[Display(Name = "Nem létező entitás!")]
|
||||
NemLetezoEntitas,
|
||||
[Display(Name = "Validációs hiba történt!")]
|
||||
ModelValidacio,
|
||||
[Display(Name = "Nincs jogosultsága!")]
|
||||
NincsJogosultsag,
|
||||
[Display(Name = "A response túl sok elemet tartalmaz az elvárthoz képest")]
|
||||
TulSokVisszateresiElem,
|
||||
[Display(Name = "Változó vagy paraméter nem lehet null")]
|
||||
ValtozoErtekeNemLehetNull,
|
||||
[Display(Name = "A kérés túllépte a maximálisan megengedett futási időt!")]
|
||||
TimeOut,
|
||||
[Display(Name = "A tanuló intézményében tanévváltás történt! A tanévváltást követően az előző tanév adatai már nem, de az új tanévben rögzített adatok válnak elérhetővé.")]
|
||||
IntezmenyMarTanevetValtott,
|
||||
[Display(Name = "Nem megfelelő intézményhez intézte a kérést!")]
|
||||
IntezmenyAzonositoUtkozes,
|
||||
[Display(Name = "A lista nem tartalmaz elemet!")]
|
||||
ListaNemTartalmazElemet,
|
||||
[Display(Name = "A lista több, mint 50 elemet tartalmaz!")]
|
||||
ListaTobbMint50ElemetTartalmaz,
|
||||
[Display(Name = "Az elvárt érték nem található!")]
|
||||
ElvartErtekNemTalalhato,
|
||||
[Display(Name = "A művelet nem végezhető el többször!")]
|
||||
AMuveletNemVegezhetoElTobbszor,
|
||||
[Display(Name = "Duplikált kulcs!")]
|
||||
DuplikaltKulcs,
|
||||
[Display(Name = "A funkció ki van kapcsolva!")]
|
||||
FunkcioKikapcsolva,
|
||||
NaploZaras,
|
||||
JiraFileError,
|
||||
[Display(Name = "A kérés meg lett szakítva!")]
|
||||
TaskCancelled,
|
||||
[Display(Name = "Nem tölthető fel a fájl!")]
|
||||
NemTolthetoFelAFajl,
|
||||
[Display(Name = "A kérés során azonosító ütközés történt!")]
|
||||
AzonositoUtkozes
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using Kreta.Core.Domain;
|
||||
using Kreta.Core.Enum;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Core.Exceptions
|
||||
{
|
||||
public class BlException : Exception
|
||||
{
|
||||
public HttpStatusCode StatusCode { get; set; }
|
||||
|
||||
public BlExceptionType ExceptionType { get; }
|
||||
|
||||
public BlException(BlExceptionType exceptionType) : base(exceptionType.ToDisplayName() ?? ErrorResource.IsmeretlenHibaTortent)
|
||||
{
|
||||
ExceptionType = exceptionType;
|
||||
}
|
||||
|
||||
public BlException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public BlException(string message, HttpStatusCode statusCode) : base(message)
|
||||
{
|
||||
StatusCode = statusCode;
|
||||
}
|
||||
|
||||
public BlException(string message, Exception exception) : base(message)
|
||||
{
|
||||
UnHandledException = exception;
|
||||
}
|
||||
|
||||
public BlException(string message, BlExceptionType exceptionType) : base(message)
|
||||
{
|
||||
ExceptionType = exceptionType;
|
||||
}
|
||||
|
||||
public BlException(string message, BlExceptionType exceptionType, Exception exception) : base(message)
|
||||
{
|
||||
ExceptionType = exceptionType;
|
||||
UnHandledException = exception;
|
||||
}
|
||||
|
||||
public List<DetailedErrorItem> ErrorList { get; set; } = new List<DetailedErrorItem>();
|
||||
|
||||
//Exception filter miatt raktam bele, ezeket a hibákat külön leloggolja, ha beleforgatjuk a StatusError-ba
|
||||
public Exception UnHandledException { get; }
|
||||
|
||||
public bool IsUnHandled => InnerException != null;
|
||||
|
||||
private static readonly Dictionary<BlExceptionType, HttpStatusCode> ResponseStatusCodeLookUpTable
|
||||
= new Dictionary<BlExceptionType, HttpStatusCode>
|
||||
{
|
||||
{ BlExceptionType.NemLetezoEntitas, HttpStatusCode.NotFound },
|
||||
{ BlExceptionType.ModelValidacio, HttpStatusCode.BadRequest },
|
||||
{ BlExceptionType.NincsJogosultsag, HttpStatusCode.Forbidden },
|
||||
{ BlExceptionType.TulSokVisszateresiElem, HttpStatusCode.InternalServerError },
|
||||
{ BlExceptionType.ValtozoErtekeNemLehetNull, HttpStatusCode.InternalServerError },
|
||||
{ BlExceptionType.None, HttpStatusCode.InternalServerError },
|
||||
{ BlExceptionType.ListaNemTartalmazElemet, HttpStatusCode.InternalServerError },
|
||||
{ BlExceptionType.IntezmenyMarTanevetValtott, HttpStatusCode.Conflict },
|
||||
{ BlExceptionType.IntezmenyAzonositoUtkozes, HttpStatusCode.Conflict },
|
||||
{ BlExceptionType.AzonositoUtkozes, HttpStatusCode.Conflict },
|
||||
{ BlExceptionType.ElvartErtekNemTalalhato, HttpStatusCode.InternalServerError },
|
||||
{ BlExceptionType.ListaTobbMint50ElemetTartalmaz, HttpStatusCode.BadRequest },
|
||||
{ BlExceptionType.AMuveletNemVegezhetoElTobbszor, HttpStatusCode.BadRequest },
|
||||
{ BlExceptionType.DuplikaltKulcs, HttpStatusCode.InternalServerError },
|
||||
{ BlExceptionType.NaploZaras, HttpStatusCode.BadRequest },
|
||||
{ BlExceptionType.TaskCancelled, HttpStatusCode.BadRequest },
|
||||
{ BlExceptionType.FunkcioKikapcsolva, HttpStatusCode.BadRequest }
|
||||
};
|
||||
|
||||
public HttpStatusCode GetResponseStatusCode()
|
||||
{
|
||||
return StatusCode == 0 ? ResponseStatusCodeLookUpTable.TryGetValue(ExceptionType, out HttpStatusCode statusCode)
|
||||
? statusCode
|
||||
: HttpStatusCode.InternalServerError
|
||||
: StatusCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Core.Exceptions
|
||||
{
|
||||
public class WebApiException : Exception
|
||||
{
|
||||
public WebApiException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public WebApiException(string message, Exception inner) : base(message, inner)
|
||||
{
|
||||
}
|
||||
|
||||
public Dictionary<string, string> ErrorList { get; set; }
|
||||
|
||||
public bool IsUnHandled => InnerException != null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,350 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Kreta.Core.CustomAttributes;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension
|
||||
/// </summary>
|
||||
public static class Extensions
|
||||
{
|
||||
#region Convert Extensions
|
||||
|
||||
/// <summary>
|
||||
/// Converts to a bool? value to int
|
||||
/// </summary>
|
||||
/// <param name="origin">The origin.</param>
|
||||
/// <returns></returns>
|
||||
public static int ToNullableInt(this bool? origin) => origin == true ? 1 : 0;
|
||||
|
||||
/// <summary>
|
||||
/// Converts to a bool value to int
|
||||
/// </summary>
|
||||
/// <param name="origin">if set to <c>true</c> [origin].</param>
|
||||
/// <returns></returns>
|
||||
public static int ToNullableInt(this bool origin) => origin ? 1 : 0;
|
||||
|
||||
/// <summary>
|
||||
/// Converts to a bool? value to int
|
||||
/// </summary>
|
||||
/// <param name="origin">The origin.</param>
|
||||
/// <returns></returns>
|
||||
public static int ToBit(this bool? origin) => origin.ToNullableInt();
|
||||
|
||||
/// <summary>
|
||||
/// Converts to a bool value to int
|
||||
/// </summary>
|
||||
/// <param name="origin">if set to <c>true</c> [origin].</param>
|
||||
/// <returns></returns>
|
||||
public static int ToBit(this bool origin) => origin.ToNullableInt();
|
||||
|
||||
/// <summary>
|
||||
/// Converts to a int? value to bool
|
||||
/// </summary>
|
||||
/// <param name="origin">The origin.</param>
|
||||
/// <returns></returns>
|
||||
public static bool ToBool(this int? origin) => origin == 1;
|
||||
|
||||
/// <summary>
|
||||
/// Converts to a string value to bool
|
||||
/// </summary>
|
||||
/// <param name="origin">The origin.</param>
|
||||
/// <returns></returns>
|
||||
public static bool ToBool(this string origin) => string.Equals(origin, "T", StringComparison.OrdinalIgnoreCase) || string.Equals(origin, "TRUE", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether [is not null and positive] [the specified value].
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsNotNullAndPositive(this int? value)
|
||||
{
|
||||
return value.HasValue && 0 < value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether [is not null and positive] [the specified value].
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsNotNullAndPositive(this int value)
|
||||
{
|
||||
return 0 < value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Megvizsgálja, hogy az int? lehetséges EntityId-e (nem null és nagyobb mint 0)
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsEntityId(this int? value)
|
||||
{
|
||||
return value.IsNotNullAndPositive();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Megvizsgálja, hogy az int lehetséges EntityId-e (nagyobb mint 0)
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsEntityId(this int value)
|
||||
{
|
||||
return 0 < value;
|
||||
}
|
||||
|
||||
public static int? ToNullableInt(this string stringValue)
|
||||
{
|
||||
if (int.TryParse(stringValue, out int intValue))
|
||||
{
|
||||
return intValue;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts to a bool? value to bool
|
||||
/// </summary>
|
||||
/// <param name="value">The origin.</param>
|
||||
/// <returns>False when it is null</returns>
|
||||
public static bool ToBool(this bool? value)
|
||||
{
|
||||
return value ?? false;
|
||||
}
|
||||
|
||||
public static string ToSDABoolean(this bool value) => value ? "T" : "F";
|
||||
|
||||
public static bool? ToNullableBoolean(this int? value) => value.HasValue ? (value.Value == 1) : (bool?)null;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Validation Extensions
|
||||
|
||||
public static bool IsValidEmail(this string value)
|
||||
{
|
||||
//NOTE: A null-t és az üres string-et is validnak vesszük, ha azt szeretnénk, hogy ezek ne legyenek validok, azokat külön kint kell vizsgálni string.IsNullOrWhiteSpace()-vel!
|
||||
bool result = new EmailAddressExtendedAttribute(true, true).IsValid(value);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool IsValidPhone(this string value)
|
||||
{
|
||||
//NOTE: A null-t és az üres string-et is validnak vesszük, ha azt szeretnénk, hogy ezek ne legyenek validok, azokat külön kint kell vizsgálni string.IsNullOrWhiteSpace()-vel!
|
||||
bool result = new PhoneExtendedAttribute(true, true).IsValid(value);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool Is18EvesElmult(this DateTime szuletesiIdo)
|
||||
{
|
||||
bool result = szuletesiIdo.Date.AddYears(18) < DateTime.Today;
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region String Extensions
|
||||
|
||||
public static string Truncate(this string value, int maxChars)
|
||||
{
|
||||
return value.Length <= maxChars ? value : value.Substring(0, maxChars - 3) + "...";
|
||||
}
|
||||
|
||||
public static string RemoveDiacritics(this string text)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
return text;
|
||||
}
|
||||
|
||||
text = text.Normalize(NormalizationForm.FormD);
|
||||
|
||||
var chars = text
|
||||
.Where(c => CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark)
|
||||
.ToArray();
|
||||
|
||||
return new string(chars).Normalize(NormalizationForm.FormC);
|
||||
}
|
||||
|
||||
public static string ReplaceMultipleSpacesAndTrim(this string text, string defaultValue = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
//NOTE: "\u00A0" = NO-BREAK SPACE
|
||||
// "\u0009" = CHARACTER TABULATION
|
||||
// "\u0020" = SPACE
|
||||
// Replace-elni kell a NO-BREAK SPACE-eket, mert a SPACE-el nem ekvivalens és jöhet be ilyen adat és okozhat problémát.
|
||||
// Replace-elni kell a CHARACTER TABULATION-öket, mert a SPACE-el nem ekvivalens és jöhet be ilyen adat és okozhat problémát.
|
||||
// Ezt követően replace-eljük a többszörös szóközöket egyre.
|
||||
// Ezt követően trim-elünk.
|
||||
string result = Regex.Replace(text.Replace("\u00A0", "\u0020").Replace("\u0009", "\u0020"), @"\s+", " ").Trim();
|
||||
if (string.IsNullOrWhiteSpace(result))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static string RemoveSpecialCharacters(this string text)
|
||||
=> Regex.Replace(text, @"[ \-'`~!@#$%^&*()_|+=?;:"",.<>{ }[\]\\/]", "");
|
||||
|
||||
#endregion
|
||||
|
||||
#region Collection Extensions
|
||||
|
||||
public static int GetSequenceHashCode<T>(this IReadOnlyCollection<T> sequence)
|
||||
{
|
||||
if (sequence == null || sequence.Count == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return sequence.Select(item => item.GetHashCode()).Aggregate((total, nextCode) => total ^ nextCode);
|
||||
}
|
||||
|
||||
public static void RemoveRange<T>(this List<T> self, IEnumerable<T> items)
|
||||
{
|
||||
var exceptItems = self.Except(items).ToList();
|
||||
self.Clear();
|
||||
self.AddRange(exceptItems);
|
||||
}
|
||||
|
||||
public static bool NotNullAndAny<T>(this IEnumerable<T> enumerable)
|
||||
{
|
||||
return enumerable != null && enumerable.Any();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A generikus objektumlistában sorba rendezzük az adatokat és beállítjuk a lapozást a bejövő paraméterek alapján reflection-el.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">A T bármilyen típus lehet.</typeparam>
|
||||
/// <param name="itemList">A T típusú objektumlista, amivel dolgozunk. Ha ez az érték null, akkor null-al térünk vissza, hogy ne legyen exception.</param>
|
||||
/// <param name="orderDictionary">A dictionary, amiben benne van, hogy mely property-k(Key) alapján és milyen irányba(Value) kell rendezni az adatokat. Ha ez az érték null vagy üres, akkor nincs sorbarendezés, hanem az eredeti sorrenddel dolgozunk tovább.</param>
|
||||
/// <param name="firstItemIndex">A lapozáshoz az első elem indexe. Ha ez az érték null, akkor nincs lapozás és visszaadunk minden elemet.</param>
|
||||
/// <param name="lastItemIndex">A lapozáshoz az utolsó elem indexe. Ha ez az érték null, akkor nincs lapozás és visszaadunk minden elemet.</param>
|
||||
/// <returns></returns>
|
||||
public static List<T> SortingAndPaging<T>(this IEnumerable<T> itemList, Dictionary<string, ListSortDirection> orderDictionary = null, int? firstItemIndex = null, int? lastItemIndex = null)
|
||||
{
|
||||
if (itemList == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
List<T> result;
|
||||
if (orderDictionary != null && orderDictionary.Count > 0)
|
||||
{
|
||||
IOrderedEnumerable<T> orderedList = null;
|
||||
bool isOrderBy = true;
|
||||
foreach (var orderItem in orderDictionary)
|
||||
{
|
||||
PropertyInfo propInfo = typeof(T).GetProperty(orderItem.Key);
|
||||
if (isOrderBy)
|
||||
{
|
||||
orderedList = orderItem.Value == ListSortDirection.Ascending ?
|
||||
itemList.OrderBy(x => propInfo.GetValue(x, null)) :
|
||||
itemList.OrderByDescending(x => propInfo.GetValue(x, null));
|
||||
isOrderBy = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
orderedList = orderItem.Value == ListSortDirection.Ascending ?
|
||||
orderedList.ThenBy(x => propInfo.GetValue(x, null)) :
|
||||
orderedList.ThenByDescending(x => propInfo.GetValue(x, null));
|
||||
}
|
||||
}
|
||||
|
||||
result = orderedList.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
result = itemList.ToList();
|
||||
}
|
||||
|
||||
if (firstItemIndex.HasValue && lastItemIndex.HasValue)
|
||||
{
|
||||
if (firstItemIndex <= lastItemIndex)
|
||||
{
|
||||
int pageSize = lastItemIndex.Value - firstItemIndex.Value + 1;
|
||||
if (pageSize < result.Count)
|
||||
{
|
||||
result = result.Skip(firstItemIndex.Value).Take(pageSize).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
|
||||
{
|
||||
var keys = new HashSet<TKey>();
|
||||
foreach (TSource element in source)
|
||||
{
|
||||
if (keys.Add(keySelector(element)))
|
||||
{
|
||||
yield return element;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<T> Difference<T>(this IEnumerable<T> first, IEnumerable<T> second)
|
||||
{
|
||||
return first.Except(second).Union(second.Except(first));
|
||||
}
|
||||
|
||||
public static void RemoveDictionaryItemByValue(this Dictionary<string, string> self, string value)
|
||||
{
|
||||
var valuesList = self.Where(s => s.Value == value).ToList();
|
||||
valuesList.ForEach(i => self.Remove(i.Key));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Enumeration Extensions
|
||||
|
||||
/// <summary>
|
||||
/// GetAttribute by Type
|
||||
/// </summary>
|
||||
/// <typeparam name="T">type of attribute</typeparam>
|
||||
/// <returns>type of Attribute</returns>
|
||||
public static T GetAttribute<T>(this System.Enum value) where T : Attribute
|
||||
{
|
||||
return (T)value.GetType()
|
||||
.GetMember(value.ToString())[0].GetCustomAttributes(typeof(T), false)
|
||||
.FirstOrDefault();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
///Get Display Name Attribute
|
||||
/// </summary>
|
||||
/// <example> [Display(Name = "xy")]</example>
|
||||
/// <returns>xy</returns>
|
||||
public static string ToDisplayName(this System.Enum value) => value.GetAttribute<DisplayAttribute>()?.Name;
|
||||
|
||||
#endregion
|
||||
|
||||
#region DateTimeExtensions
|
||||
|
||||
public static DateTime StartOfTheDay(this DateTime dateTime)
|
||||
{
|
||||
return dateTime.Date;
|
||||
}
|
||||
|
||||
public static DateTime EndOfTheDay(this DateTime dateTime)
|
||||
{
|
||||
return dateTime.Date.AddDays(1).AddTicks(-1);
|
||||
}
|
||||
|
||||
#endregion DateTimeExtensions
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FeatureToggle.Configuration
|
||||
{
|
||||
public class FeatureConfigurationSection : ConfigurationSection
|
||||
{
|
||||
[ConfigurationProperty(nameof(SimpleFeatures))]
|
||||
public SimpleFeatureConfigurationCollection SimpleFeatures => (SimpleFeatureConfigurationCollection)base[nameof(SimpleFeatures)];
|
||||
|
||||
[ConfigurationProperty(nameof(SendErtekelesNotification))]
|
||||
public ExtendedSendMobileNotification SendErtekelesNotification => (ExtendedSendMobileNotification)base[nameof(SendErtekelesNotification)];
|
||||
|
||||
[ConfigurationProperty(nameof(SendHazifeladatNotification))]
|
||||
public ExtendedSendMobileNotification SendHazifeladatNotification => (ExtendedSendMobileNotification)base[nameof(SendHazifeladatNotification)];
|
||||
|
||||
[ConfigurationProperty(nameof(SendRendszerUzenetNotification))]
|
||||
public ExtendedSendMobileNotification SendRendszerUzenetNotification => (ExtendedSendMobileNotification)base[nameof(SendRendszerUzenetNotification)];
|
||||
|
||||
[ConfigurationProperty(nameof(SendBejelentettSzamonkeresNotification))]
|
||||
public ExtendedSendMobileNotification SendBejelentettSzamonkeresNotification => (ExtendedSendMobileNotification)base[nameof(SendBejelentettSzamonkeresNotification)];
|
||||
|
||||
[ConfigurationProperty(nameof(SendFeljegyzesNotification))]
|
||||
public ExtendedSendMobileNotification SendFeljegyzesNotification => (ExtendedSendMobileNotification)base[nameof(SendFeljegyzesNotification)];
|
||||
|
||||
[ConfigurationProperty(nameof(SendMulasztasNotification))]
|
||||
public ExtendedSendMobileNotification SendMulasztasNotification => (ExtendedSendMobileNotification)base[nameof(SendMulasztasNotification)];
|
||||
|
||||
[ConfigurationProperty(nameof(SendOrarendValtozasNotification))]
|
||||
public ExtendedSendMobileNotification SendOrarendValtozasNotification => (ExtendedSendMobileNotification)base[nameof(SendOrarendValtozasNotification)];
|
||||
|
||||
[ConfigurationProperty(nameof(SendNemNaplozottTanorakMail))]
|
||||
public ExtendedSendMobileNotification SendNemNaplozottTanorakMail => (ExtendedSendMobileNotification)base[nameof(SendNemNaplozottTanorakMail)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
|
||||
namespace Kreta.Core.FeatureToggle.Configuration
|
||||
{
|
||||
public class SimpleFeatureConfiguration : ConfigurationElement
|
||||
{
|
||||
[ConfigurationProperty(nameof(Name), IsKey = true, IsRequired = true)]
|
||||
public string Name => base[nameof(Name)].ToString();
|
||||
|
||||
[ConfigurationProperty(nameof(IsEnabled), IsKey = false, IsRequired = true)]
|
||||
public bool IsEnabled => bool.Parse(base[nameof(IsEnabled)].ToString());
|
||||
|
||||
[ConfigurationProperty(nameof(InstituteIds), IsKey = false, IsRequired = false)]
|
||||
[TypeConverter(typeof(CommaDelimitedStringCollectionConverter))]
|
||||
public IEnumerable<string> InstituteIds
|
||||
{
|
||||
get
|
||||
{
|
||||
var instituteIds = ((CommaDelimitedStringCollection)base[nameof(InstituteIds)]);
|
||||
|
||||
return (instituteIds != null) ? instituteIds.OfType<string>() : new List<string>();
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty(nameof(Environments), IsKey = false, IsRequired = false)]
|
||||
[TypeConverter(typeof(CommaDelimitedStringCollectionConverter))]
|
||||
public IEnumerable<string> Environments
|
||||
{
|
||||
get
|
||||
{
|
||||
var environments = ((CommaDelimitedStringCollection)base[nameof(Environments)]);
|
||||
|
||||
return (environments != null) ? environments.OfType<string>() : new List<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FeatureToggle.Configuration
|
||||
{
|
||||
[ConfigurationCollection(typeof(SimpleFeatureConfiguration))]
|
||||
public class SimpleFeatureConfigurationCollection : ConfigurationElementCollection
|
||||
{
|
||||
protected override string ElementName => nameof(SimpleFeature);
|
||||
|
||||
protected override ConfigurationElement CreateNewElement() => new SimpleFeatureConfiguration();
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element) => ((SimpleFeatureConfiguration)element).Name;
|
||||
|
||||
public override ConfigurationElementCollectionType CollectionType => ConfigurationElementCollectionType.BasicMapAlternate;
|
||||
}
|
||||
|
||||
public class ExtendedSendMobileNotification : ConfigurationElement
|
||||
{
|
||||
[ConfigurationProperty(nameof(CustomCronExpression))]
|
||||
public string CustomCronExpression => base[nameof(CustomCronExpression)].ToString();
|
||||
|
||||
[ConfigurationProperty(nameof(SendItervalInMinute))]
|
||||
public string SendItervalInMinute => base[nameof(SendItervalInMinute)].ToString();
|
||||
|
||||
[ConfigurationProperty(nameof(RunningIntervalStartHour))]
|
||||
public string RunningIntervalStartHour => base[nameof(RunningIntervalStartHour)].ToString();
|
||||
|
||||
[ConfigurationProperty(nameof(RunningIntervalEndHour))]
|
||||
public string RunningIntervalEndHour => base[nameof(RunningIntervalEndHour)].ToString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using Kreta.Core.FeatureToggle.Configuration;
|
||||
|
||||
namespace Kreta.Core.FeatureToggle
|
||||
{
|
||||
public class FeatureContext : IFeatureContext
|
||||
{
|
||||
private Dictionary<string, IFeature> Features { get; }
|
||||
|
||||
private static readonly Lazy<FeatureContext> instance;
|
||||
public static FeatureContext Instance => instance.Value;
|
||||
|
||||
static FeatureContext()
|
||||
{
|
||||
instance = new Lazy<FeatureContext>(() => new FeatureContext((FeatureConfigurationSection)ConfigurationManager.GetSection(Constants.ConfigurationSectionNames.FeatureConfig)));
|
||||
}
|
||||
|
||||
public FeatureContext(FeatureConfigurationSection config)
|
||||
{
|
||||
Features = GetFeaturesFromConfig(config);
|
||||
}
|
||||
|
||||
private static Dictionary<string, IFeature> GetFeaturesFromConfig(FeatureConfigurationSection config)
|
||||
{
|
||||
var features = new Dictionary<string, IFeature>();
|
||||
|
||||
foreach (SimpleFeatureConfiguration featureConfiguration in config.SimpleFeatures)
|
||||
{
|
||||
var feature = new SimpleFeature
|
||||
{
|
||||
Name = featureConfiguration.Name,
|
||||
IsEnabled = featureConfiguration.IsEnabled,
|
||||
InstituteIds = featureConfiguration.InstituteIds,
|
||||
Environments = featureConfiguration.Environments
|
||||
};
|
||||
|
||||
features[feature.Name] = feature;
|
||||
}
|
||||
|
||||
return features;
|
||||
}
|
||||
|
||||
public bool IsEnabled(string featureName, string environment = null, string instituteId = null, List<string> instituteIds = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(featureName))
|
||||
{
|
||||
throw new ArgumentException($"{nameof(featureName)} null vagy üres");
|
||||
}
|
||||
|
||||
if (!Features.ContainsKey(featureName))
|
||||
{
|
||||
throw new ArgumentException($"{featureName} nem létező feature");
|
||||
}
|
||||
|
||||
bool isFeatureEnabled = Features[featureName].IsEnabled;
|
||||
|
||||
if (isFeatureEnabled && (!string.IsNullOrWhiteSpace(environment) || !string.IsNullOrWhiteSpace(instituteId)))
|
||||
{
|
||||
IFeature feature = Features[featureName];
|
||||
|
||||
return CheckEnvironment(feature, environment) && CheckInstituteId(feature, instituteId, instituteIds);
|
||||
}
|
||||
|
||||
return isFeatureEnabled;
|
||||
}
|
||||
|
||||
private bool CheckEnvironment(IFeature feature, string environment)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(environment))
|
||||
{
|
||||
return !feature.Environments.Any() || feature.Environments.Contains(environment);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool CheckInstituteId(IFeature feature, string instituteId, List<string> instituteIds = null)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(instituteId))
|
||||
{
|
||||
if (instituteIds != null && instituteIds.Any())
|
||||
{
|
||||
return instituteIds.Contains(instituteId, StringComparer.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
return !feature.InstituteIds.Any() || feature.InstituteIds.Contains(instituteId, StringComparer.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Core.FeatureToggle
|
||||
{
|
||||
public interface IFeature
|
||||
{
|
||||
string Name { get; }
|
||||
|
||||
bool IsEnabled { get; }
|
||||
|
||||
IEnumerable<string> InstituteIds { get; }
|
||||
|
||||
IEnumerable<string> Environments { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Core.FeatureToggle
|
||||
{
|
||||
public interface IFeatureContext
|
||||
{
|
||||
bool IsEnabled(string featureName, string environment = null, string instituteId = null, List<string> instituteIds = null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
using System.Collections.Generic;
|
||||
using Kreta.Core.FeatureToggle.Configuration;
|
||||
|
||||
namespace Kreta.Core.FeatureToggle
|
||||
{
|
||||
public class SimpleFeature : IFeature
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public bool IsEnabled { get; set; }
|
||||
|
||||
public IEnumerable<string> InstituteIds { get; set; }
|
||||
|
||||
public IEnumerable<string> Environments { get; set; }
|
||||
}
|
||||
|
||||
public class FeatureBase : SimpleFeature
|
||||
{
|
||||
protected FeatureBase(FeatureConfigurationSection config, string name)
|
||||
{
|
||||
foreach (SimpleFeatureConfiguration featureConfiguration in config.SimpleFeatures)
|
||||
{
|
||||
if (featureConfiguration.Name == name)
|
||||
{
|
||||
Name = featureConfiguration.Name;
|
||||
IsEnabled = featureConfiguration.IsEnabled;
|
||||
InstituteIds = featureConfiguration.InstituteIds;
|
||||
Environments = featureConfiguration.Environments;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DeleteInvalidLinksFeature : FeatureBase
|
||||
{
|
||||
public DeleteInvalidLinksFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.DeleteInvalidLinks) { }
|
||||
}
|
||||
|
||||
public class UpdateCOVIDFlagFeature : FeatureBase
|
||||
{
|
||||
public UpdateCOVIDFlagFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.UpdateCOVIDFlag) { }
|
||||
}
|
||||
public class UpdateTanuloDualisSzerzodesei : FeatureBase
|
||||
{
|
||||
public UpdateTanuloDualisSzerzodesei(FeatureConfigurationSection config) : base(config, Constants.FeatureName.UpdateTanuloDualisSzerzodesei) { }
|
||||
}
|
||||
|
||||
public class UseGlobalApiConnectionStringFeature : FeatureBase
|
||||
{
|
||||
public UseGlobalApiConnectionStringFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.UseGlobalApiConnectionString) { }
|
||||
}
|
||||
|
||||
public class IntervalFeatureBase : FeatureBase
|
||||
{
|
||||
public string CustomCronExpression { get; }
|
||||
public int SendItervalInMinute { get; } = 59;
|
||||
public int? RunningIntervalStartHour { get; }
|
||||
public int? RunningIntervalEndHour { get; }
|
||||
|
||||
public IntervalFeatureBase(FeatureConfigurationSection config, string name, ExtendedSendMobileNotification extendedSendMobileNotification) : base(config, name)
|
||||
{
|
||||
CustomCronExpression = extendedSendMobileNotification.CustomCronExpression;
|
||||
|
||||
if (int.TryParse(extendedSendMobileNotification.SendItervalInMinute, out int sendItervalInMinute))
|
||||
{
|
||||
if (sendItervalInMinute > 0)
|
||||
{
|
||||
SendItervalInMinute = sendItervalInMinute;
|
||||
}
|
||||
}
|
||||
|
||||
if (int.TryParse(extendedSendMobileNotification.RunningIntervalStartHour, out int runningIntervalStartHour))
|
||||
{
|
||||
if (runningIntervalStartHour > -1 && runningIntervalStartHour < 24)
|
||||
{
|
||||
RunningIntervalStartHour = runningIntervalStartHour;
|
||||
|
||||
if (int.TryParse(extendedSendMobileNotification.RunningIntervalEndHour, out int runningIntervalEndHour))
|
||||
{
|
||||
if (runningIntervalEndHour >= runningIntervalStartHour && runningIntervalEndHour < 24)
|
||||
{
|
||||
RunningIntervalEndHour = runningIntervalEndHour;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SendErtekelesNotificationFeature : IntervalFeatureBase
|
||||
{
|
||||
public SendErtekelesNotificationFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.SendErtekelesNotification, config.SendErtekelesNotification) { }
|
||||
}
|
||||
|
||||
public class SendHazifeladatNotificationFeature : IntervalFeatureBase
|
||||
{
|
||||
public SendHazifeladatNotificationFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.SendHazifeladatNotification, config.SendHazifeladatNotification) { }
|
||||
}
|
||||
|
||||
public class SendRendszerUzenetNotificationFeature : IntervalFeatureBase
|
||||
{
|
||||
public SendRendszerUzenetNotificationFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.SendRendszerUzenetNotification, config.SendRendszerUzenetNotification) { }
|
||||
}
|
||||
|
||||
public class SendMulasztasNotificationFeature : IntervalFeatureBase
|
||||
{
|
||||
public SendMulasztasNotificationFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.SendMulasztasNotification, config.SendMulasztasNotification) { }
|
||||
}
|
||||
|
||||
public class SendBejelentettSzamonkeresNotificationFeature : IntervalFeatureBase
|
||||
{
|
||||
public SendBejelentettSzamonkeresNotificationFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.SendBejelentettSzamonkeresNotification, config.SendBejelentettSzamonkeresNotification) { }
|
||||
}
|
||||
|
||||
public class SendFeljegyzesNotificationFeature : IntervalFeatureBase
|
||||
{
|
||||
public SendFeljegyzesNotificationFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.SendFeljegyzesNotification, config.SendFeljegyzesNotification) { }
|
||||
}
|
||||
|
||||
public class SendNemNaplozottTanorakMailFeature : IntervalFeatureBase
|
||||
{
|
||||
public SendNemNaplozottTanorakMailFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.SendNemNaplozottTanorakMail, config.SendNemNaplozottTanorakMail) { }
|
||||
}
|
||||
|
||||
public class SendKozelgoFogadooraMailFeature : FeatureBase
|
||||
{
|
||||
public SendKozelgoFogadooraMailFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.SendKozelgoFogadooraMail) { }
|
||||
}
|
||||
|
||||
public class SendOrarendValtozasNotificationFeature : IntervalFeatureBase
|
||||
{
|
||||
public SendOrarendValtozasNotificationFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.SendOrarendValtozasNotification, config.SendOrarendValtozasNotification) { }
|
||||
}
|
||||
|
||||
public class MkbBankszamlaIgenylesFeature : FeatureBase
|
||||
{
|
||||
public MkbBankszamlaIgenylesFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.MkbBankszamlaIgenyles) { }
|
||||
}
|
||||
|
||||
public class OtpBankszamlaIgenylesFeature : FeatureBase
|
||||
{
|
||||
public OtpBankszamlaIgenylesFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.OtpBankszamlaIgenyles) { }
|
||||
}
|
||||
|
||||
public class sapSyncFeature : FeatureBase
|
||||
{
|
||||
public sapSyncFeature(FeatureConfigurationSection config) : base(config, Constants.FeatureName.SAPSync) { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public class FileServiceConfiguration : ConfigurationSection, IFileServiceConfiguration
|
||||
{
|
||||
[ConfigurationProperty("", IsDefaultCollection = true)]
|
||||
public StorageElementCollection Storages => (StorageElementCollection)base[string.Empty];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public interface IFileServiceConfiguration
|
||||
{
|
||||
StorageElementCollection Storages { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public class Path : ConfigurationElement
|
||||
{
|
||||
[ConfigurationProperty(nameof(Value), IsRequired = true, IsKey = true)]
|
||||
public string Value => (string)this[nameof(Value)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public class PathElementCollection : ConfigurationElementCollection
|
||||
{
|
||||
protected override string ElementName => nameof(Path);
|
||||
|
||||
protected override ConfigurationElement CreateNewElement() => new Path();
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element) => ((Path)element).Value;
|
||||
|
||||
public override ConfigurationElementCollectionType CollectionType => ConfigurationElementCollectionType.BasicMap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public class Storage : ConfigurationElement
|
||||
{
|
||||
[ConfigurationProperty(nameof(Key), IsRequired = true, IsKey = true)]
|
||||
public string Key => (string)this[nameof(Key)];
|
||||
|
||||
[ConfigurationProperty(nameof(MaxFileSizeInBytes), IsRequired = true)]
|
||||
public int MaxFileSizeInBytes => (int)this[nameof(MaxFileSizeInBytes)];
|
||||
|
||||
[ConfigurationProperty(nameof(MinimumRequiredFreeSpaceInBytes), IsRequired = true)]
|
||||
public int MinimumRequiredFreeSpaceInBytes => (int)this[nameof(MinimumRequiredFreeSpaceInBytes)];
|
||||
|
||||
[ConfigurationProperty(nameof(Paths), IsDefaultCollection = false)]
|
||||
public PathElementCollection Paths => (PathElementCollection)base[nameof(Paths)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public class StorageElementCollection : ConfigurationElementCollection
|
||||
{
|
||||
protected override string ElementName => nameof(Storage);
|
||||
|
||||
protected override ConfigurationElement CreateNewElement() => new Storage();
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element) => ((Storage)element).Key;
|
||||
|
||||
public override ConfigurationElementCollectionType CollectionType => ConfigurationElementCollectionType.BasicMap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using Kreta.Core.FileService.Configuration;
|
||||
|
||||
namespace Kreta.Core.FileService
|
||||
{
|
||||
public class FileService : IFileService
|
||||
{
|
||||
private readonly IFileServiceConfiguration FileServiceConfiguration;
|
||||
|
||||
public FileService(IFileServiceConfiguration fileServiceConfiguration)
|
||||
{
|
||||
FileServiceConfiguration = fileServiceConfiguration ?? throw new ArgumentNullException(nameof(fileServiceConfiguration));
|
||||
}
|
||||
|
||||
//konfigból jobb lenne
|
||||
private readonly Dictionary<string, string> _allowedFileTypes =
|
||||
new Dictionary<string, string>() {
|
||||
{ ".txt", "text/plain" },
|
||||
{ ".pdf", "application/pdf" },
|
||||
{ ".png", "image/png" },
|
||||
{ ".bmp", "image/bmp" },
|
||||
{ ".jpg", "image/jpeg" },
|
||||
{ ".jpeg", "image/jpeg" },
|
||||
{ ".xls", "application/vnd.ms-excel" },
|
||||
{ ".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" },
|
||||
{ ".doc", "application/msword" },
|
||||
{ ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document" },
|
||||
{ ".xml", "text/xml" },
|
||||
{ ".roz", "application/roz" },
|
||||
{".rar", "application/octet-stream"},
|
||||
{".zip", "application/x-zip-compressed"}
|
||||
};
|
||||
|
||||
private Storage GetStorage(string storageName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(storageName))
|
||||
{
|
||||
throw new ArgumentException(nameof(storageName));
|
||||
}
|
||||
|
||||
Storage storage = null;
|
||||
|
||||
foreach (Storage storageElement in FileServiceConfiguration.Storages)
|
||||
{
|
||||
if (storageElement.Key.Equals(storageName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
storage = storageElement;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (storage == null)
|
||||
{
|
||||
throw new Exception("Nem létező storage name van megadva!");
|
||||
}
|
||||
|
||||
return storage;
|
||||
}
|
||||
|
||||
public string WriteToFile(string base64EncodedContent, string storageName)
|
||||
{
|
||||
Storage storage = GetStorage(storageName);
|
||||
|
||||
string newFileName = Guid.NewGuid().ToString();
|
||||
string directoryPath = System.IO.Path.Combine(GetFileSharePath(storage), System.IO.Path.Combine(newFileName.Split('-')[0].Substring(0, 4).Select(x => x.ToString()).ToArray()));
|
||||
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(directoryPath);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw new Exception($"Hiba történt a mappa létrehozása során!", exception);
|
||||
}
|
||||
|
||||
string filePath = System.IO.Path.Combine(directoryPath, newFileName);
|
||||
string[] parts = base64EncodedContent.Split(new string[] { ";", ":", "," }, StringSplitOptions.None);
|
||||
byte[] binaryFile = Convert.FromBase64String(parts[3]);
|
||||
|
||||
AttachmentValidation(binaryFile.Length, storage.MaxFileSizeInBytes, _allowedFileTypes.FirstOrDefault(x => x.Value == parts[1]).Key);
|
||||
|
||||
try
|
||||
{
|
||||
File.WriteAllBytes(filePath, binaryFile);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw new Exception($"Hiba történt a fájl írása közben: {exception.Message}", exception);
|
||||
}
|
||||
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public byte[] ReadFromFile(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
return File.ReadAllBytes(filePath);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw new Exception($"Hiba történt a fájl olvasása közben: {exception.Message}", exception);
|
||||
}
|
||||
}
|
||||
|
||||
public string ReadImage(string filePath, string fileExtension)
|
||||
{
|
||||
byte[] imageContent = ReadFromFile(filePath);
|
||||
|
||||
if (imageContent != null)
|
||||
{
|
||||
return $"data:image/{fileExtension};base64,{Convert.ToBase64String(imageContent)}";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public string ReadAndResizeImage(string filePath, int width, int height)
|
||||
{
|
||||
byte[] imageContent = ReadFromFile(filePath);
|
||||
|
||||
if (imageContent != null)
|
||||
{
|
||||
Image image = CreateImage(imageContent);
|
||||
|
||||
return $"data:image/jpeg;base64,{Convert.ToBase64String(ResizeImage(image, width, height))}";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private Image CreateImage(byte[] pictureByteArray)
|
||||
{
|
||||
using (var memoryStream = new MemoryStream(pictureByteArray, 0, pictureByteArray.Length))
|
||||
{
|
||||
return Image.FromStream(memoryStream, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
private byte[] ResizeImage(Image image, int width, int height)
|
||||
{
|
||||
var destRect = new Rectangle(0, 0, width, height);
|
||||
|
||||
using (var destImage = new Bitmap(width, height))
|
||||
{
|
||||
destImage.SetResolution(image.HorizontalResolution, image.VerticalResolution);
|
||||
|
||||
using (var graphics = Graphics.FromImage(destImage))
|
||||
{
|
||||
graphics.CompositingMode = CompositingMode.SourceCopy;
|
||||
graphics.CompositingQuality = CompositingQuality.HighQuality;
|
||||
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
graphics.SmoothingMode = SmoothingMode.HighQuality;
|
||||
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
|
||||
using (var wrapMode = new ImageAttributes())
|
||||
{
|
||||
wrapMode.SetWrapMode(WrapMode.TileFlipXY);
|
||||
graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, wrapMode);
|
||||
}
|
||||
}
|
||||
|
||||
using (var memoryStream = new MemoryStream())
|
||||
{
|
||||
destImage.Save(memoryStream, ImageFormat.Jpeg);
|
||||
|
||||
return memoryStream.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AttachmentValidation(long contentLength, int maxFileSizeInBytes, string contentType)
|
||||
{
|
||||
if (contentType == null)
|
||||
{
|
||||
throw new Exception("Nem tölthető fel a fájl, mert nincs kiterjesztése");
|
||||
}
|
||||
|
||||
if (!_allowedFileTypes.ContainsKey(contentType))
|
||||
{
|
||||
throw new Exception("Nem megengedett a fájl formátuma!");
|
||||
}
|
||||
|
||||
if (contentLength > maxFileSizeInBytes)
|
||||
{
|
||||
throw new Exception("Nem tölthető fel a fájl, mert túl nagy a mérete");
|
||||
}
|
||||
}
|
||||
|
||||
private string GetFileSharePath(Storage storageElement)
|
||||
{
|
||||
string root = string.Empty;
|
||||
|
||||
foreach (Configuration.Path path in storageElement.Paths)
|
||||
{
|
||||
root = path.Value;
|
||||
|
||||
if (!HasEnoughFreeSpaceOnDisk(storageElement.MinimumRequiredFreeSpaceInBytes, root))
|
||||
{
|
||||
throw new Exception("Nincs elég hely a tárolón!");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(root))
|
||||
{
|
||||
throw new Exception("A megosztott meghajtó nincs megadva!");
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
private bool HasEnoughFreeSpaceOnDisk(int minimumRequiredFreeSpaceInBytes, string path)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
{
|
||||
throw new ArgumentException(nameof(path));
|
||||
}
|
||||
|
||||
//Nem működik a megosztott mappával
|
||||
//TODO Imi: ellenőrizni, h létezik-e a megadott megosztott mappa
|
||||
/*if (!Directory.Exists(path))
|
||||
{
|
||||
throw new ArgumentNullException("Nem létezik a file share!");
|
||||
}*/
|
||||
|
||||
long freeSpaceInBytes = 0, dummy1 = 0, dummy2 = 0;
|
||||
|
||||
if (!GetDiskFreeSpaceEx(path, ref freeSpaceInBytes, ref dummy1, ref dummy2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return freeSpaceInBytes > minimumRequiredFreeSpaceInBytes;
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage"), SuppressUnmanagedCodeSecurity]
|
||||
[DllImport("Kernel32", SetLastError = true, CharSet = CharSet.Auto)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool GetDiskFreeSpaceEx
|
||||
(
|
||||
string lpszPath,
|
||||
ref long lpFreeBytesAvailable,
|
||||
ref long lpTotalNumberOfBytes,
|
||||
ref long lpTotalNumberOfFreeBytes
|
||||
);
|
||||
|
||||
public void DeleteFile(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Delete(filePath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception("A fájl törlése sikertelen!", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace Kreta.Core.FileService
|
||||
{
|
||||
public interface IFileService
|
||||
{
|
||||
string WriteToFile(string base64EncodedContent, string storageName);
|
||||
void DeleteFile(string filePath);
|
||||
byte[] ReadFromFile(string filePath);
|
||||
string ReadImage(string filePath, string fileExtension);
|
||||
string ReadAndResizeImage(string filePath, int width, int height);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Kreta.Core
|
||||
{
|
||||
public interface IUgyfelszolgalatConfig
|
||||
{
|
||||
string Url { get; }
|
||||
string ProjectKey { get; }
|
||||
string CommaSeparatedGroupIdFilters { get; }
|
||||
bool IsFileUploadEnabled { get; }
|
||||
string JiraServiceApiUrl { get; }
|
||||
string JiraServiceApiKey { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
public class IktatasJobConfiguration : ConfigurationSection
|
||||
{
|
||||
[ConfigurationProperty(nameof(AlszamosIktatasJobDelayInSec), IsRequired = true, DefaultValue = 5)]
|
||||
public int AlszamosIktatasJobDelayInSec => (int)this[nameof(AlszamosIktatasJobDelayInSec)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
public class IktatoServiceConfiguration : ConfigurationSection
|
||||
{
|
||||
[ConfigurationProperty(nameof(EndpointAddress), IsRequired = true)]
|
||||
public string EndpointAddress => (string)this[nameof(EndpointAddress)];
|
||||
|
||||
[ConfigurationProperty(nameof(Username), IsRequired = true)]
|
||||
public string Username => (string)this[nameof(Username)];
|
||||
|
||||
[ConfigurationProperty(nameof(Password), IsRequired = true)]
|
||||
public string Password => (string)this[nameof(Password)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Core.JsonConverter
|
||||
{
|
||||
public class StringTrimConverter : JsonConverter<string>
|
||||
{
|
||||
public override string ReadJson(JsonReader reader, Type objectType, string existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.String)
|
||||
{
|
||||
var value = (string)reader.Value;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return value.Trim();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, string value, JsonSerializer serializer)
|
||||
{
|
||||
|
||||
if (value is null)
|
||||
{
|
||||
writer.WriteNull();
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Configuration;
|
||||
using Kreta.Core.KIR.Infrastructure.Interface;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
public class KirConfiguration : ConfigurationSection, IKirConfiguration
|
||||
{
|
||||
[ConfigurationProperty(nameof(Url), IsRequired = true)]
|
||||
public string Url => (string)this[nameof(Url)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{57418D3E-CAF1-482C-9B18-85D147ABD495}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Kreta.Core</RootNamespace>
|
||||
<AssemblyName>Kreta.Core</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="HtmlAgilityPack, Version=1.8.10.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\HtmlAgilityPack.1.8.10\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="jose-jwt, Version=2.4.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\jose-jwt.2.5.0\lib\net461\jose-jwt.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kreta.Core.KIR, Version=1.0.62351.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Kreta.Core.KIR.1.0.62351\lib\net48\Kreta.Core.KIR.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kreta.Core.SAP, Version=2.0.40.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Kreta.Core.SAP.2.0.40\lib\net48\Kreta.Core.SAP.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" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<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.Caching" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Web.Http, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.6\lib\net45\System.Web.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Tools\SharedAssemblyInfo.cs">
|
||||
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Configuratiaton\ApiKeyConfiguration.cs" />
|
||||
<Compile Include="Cache.cs" />
|
||||
<Compile Include="AsyncUtil.cs" />
|
||||
<Compile Include="Configuratiaton\EESZTConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\FirebaseConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\Interface\IBankszamlaIgenylesConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\Interface\IFirebaseConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\Interface\IMkbBankszamlaIgenylesConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\Interface\IOtpBankszamlaIgenylesConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\Interface\ITananyagtarConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\OtpBankszamlaIgenylesConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\MkbBankszamlaIgenylesConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\LepConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\Interface\IKozpontiKretaConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\Interface\ILepConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\TananyagtarConfiguration.cs" />
|
||||
<Compile Include="ConnectionType\ConnectionTypeBase.cs" />
|
||||
<Compile Include="ConnectionType\MobileConnectionType.cs" />
|
||||
<Compile Include="ConnectionType\OrganizationConnectionType.cs" />
|
||||
<Compile Include="ConnectionType\SystemConnectionType.cs" />
|
||||
<Compile Include="ConnectionType\SessionConnectionType.cs" />
|
||||
<Compile Include="ConnectionType\IConnectionType.cs" />
|
||||
<Compile Include="Constants.cs" />
|
||||
<Compile Include="CustomAttributes\AdoszamExtendedAttribute.cs" />
|
||||
<Compile Include="CustomAttributes\ColumnNameAttribute.cs" />
|
||||
<Compile Include="CustomAttributes\EmailAddressExtendedAttribute.cs" />
|
||||
<Compile Include="CustomAttributes\IgnoreAttribute.cs" />
|
||||
<Compile Include="CustomAttributes\PhoneExtendedAttribute.cs" />
|
||||
<Compile Include="CustomAttributes\SimpleExportColumnAttribute.cs" />
|
||||
<Compile Include="Domain\DetailedErrorItem.cs" />
|
||||
<Compile Include="Domain\EqualityComparer\KirFelhasznaloEqualityComparer.cs" />
|
||||
<Compile Include="Domain\FelhasznaloElerhetosegCO.cs" />
|
||||
<Compile Include="Domain\Interface\IKirTanulo.cs" />
|
||||
<Compile Include="Domain\Interface\IKirAlkalmazott.cs" />
|
||||
<Compile Include="Domain\Interface\IKirFelhasznalo.cs" />
|
||||
<Compile Include="Domain\KirCim.cs" />
|
||||
<Compile Include="Domain\KirFelhasznalo.cs" />
|
||||
<Compile Include="Domain\KirFelhasznaloElerhetosegek.cs" />
|
||||
<Compile Include="Domain\KirTanuloAlapadatok.cs" />
|
||||
<Compile Include="Domain\KirTanuloBase.cs" />
|
||||
<Compile Include="Domain\KirTanuloJogviszonyAdatok.cs" />
|
||||
<Compile Include="Domain\KirTanulo.cs" />
|
||||
<Compile Include="Domain\KirAlkalmazottMunkaugyiAdatok.cs" />
|
||||
<Compile Include="Domain\KirAlkalmazottElerhetosegek.cs" />
|
||||
<Compile Include="Domain\KirAlkalmazottAlapadatok.cs" />
|
||||
<Compile Include="Domain\KirAlkalmazottBase.cs" />
|
||||
<Compile Include="Domain\KirAlkalmazott.cs" />
|
||||
<Compile Include="EntityInfos\EntityLengths.cs" />
|
||||
<Compile Include="Enum\BlExceptionType.cs" />
|
||||
<Compile Include="Exceptions\WebApiException.cs" />
|
||||
<Compile Include="Exceptions\BlException.cs" />
|
||||
<Compile Include="Extensions.cs" />
|
||||
<Compile Include="FeatureToggle\SimpleFeature.cs" />
|
||||
<Compile Include="FeatureToggle\Configuration\SimpleFeatureConfiguration.cs" />
|
||||
<Compile Include="FeatureToggle\Configuration\SimpleFeatureConfigurationCollection.cs" />
|
||||
<Compile Include="FeatureToggle\Configuration\FeatureConfigurationSection.cs" />
|
||||
<Compile Include="FeatureToggle\FeatureContext.cs" />
|
||||
<Compile Include="FeatureToggle\IFeature.cs" />
|
||||
<Compile Include="FeatureToggle\IFeatureContext.cs" />
|
||||
<Compile Include="FileService\Configuration\IFileServiceConfiguration.cs" />
|
||||
<Compile Include="FileService\Configuration\FileServiceConfiguration.cs" />
|
||||
<Compile Include="FileService\Configuration\Storage.cs" />
|
||||
<Compile Include="FileService\Configuration\Path.cs" />
|
||||
<Compile Include="FileService\FileService.cs" />
|
||||
<Compile Include="FileService\IFileService.cs" />
|
||||
<Compile Include="Configuratiaton\Interface\IApiKeyConfiguration.cs" />
|
||||
<Compile Include="IktatasJobConfiguration.cs" />
|
||||
<Compile Include="IktatoServiceConfiguration.cs" />
|
||||
<Compile Include="JsonConverter\StringTrimConverter.cs" />
|
||||
<Compile Include="KirConfiguration.cs" />
|
||||
<Compile Include="Configuratiaton\KozpontiKretaConfiguration.cs" />
|
||||
<Compile Include="KretaConvert.cs" />
|
||||
<Compile Include="KretaJobConfig.cs" />
|
||||
<Compile Include="KretaVersion.cs" />
|
||||
<Compile Include="Logic\BankszamlaLogic.cs" />
|
||||
<Compile Include="Logic\ConfigurationLogic.cs" />
|
||||
<Compile Include="Logic\UrlLogic.cs" />
|
||||
<Compile Include="Logic\SqlLogic.cs" />
|
||||
<Compile Include="Logic\DaoLogic.cs" />
|
||||
<Compile Include="ModelBinder\StringTrimModelBinder.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="FileService\Configuration\PathElementCollection.cs" />
|
||||
<Compile Include="FileService\Configuration\StorageElementCollection.cs" />
|
||||
<Compile Include="SapConfiguration.cs" />
|
||||
<Compile Include="Tuples.cs" />
|
||||
<Compile Include="IUgyfelszolgalatConfig.cs" />
|
||||
<Compile Include="UgyfelszolgalatConfig.cs" />
|
||||
<Compile Include="VersionInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<WCFMetadata Include="Connected Services\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Kreta.DataAccessGenerated\Kreta.DataAccessGenerated.csproj">
|
||||
<Project>{b91833b5-0ba0-4e8b-9159-b991f15d3fc4}</Project>
|
||||
<Name>Kreta.DataAccessGenerated</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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,477 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
public static class KretaConvert
|
||||
{
|
||||
/// <summary>
|
||||
/// SDA db kompatibilis booleannal tér vissza
|
||||
/// </summary>
|
||||
/// <param name="data">Bemenõ adat</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public static string ToSDABoolean(int? data)
|
||||
{
|
||||
if (data.HasValue)
|
||||
{
|
||||
if (data.Value == 0)
|
||||
{
|
||||
return "F";
|
||||
}
|
||||
|
||||
if (data.Value == 1)
|
||||
{
|
||||
return "T";
|
||||
}
|
||||
|
||||
throw new Exception(ErrorResource.ErvenytelenInteger);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SDA db kompatibilis booleannal tér vissza
|
||||
/// </summary>
|
||||
/// <param name="data">Bemenõ adat</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public static string ToSDABoolean(bool? data)
|
||||
{
|
||||
if (data.HasValue)
|
||||
{
|
||||
return data.Value ? "T" : "F";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nullokat is kezelõ boolean Convert
|
||||
/// </summary>
|
||||
/// <param name="data">Bemenõ adat</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public static bool ToBoolean(object data)
|
||||
{
|
||||
return ToBoolean(data, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nullokat is kezelõ boolean Convert
|
||||
/// </summary>
|
||||
/// <param name="data">Bemenõ adat</param>
|
||||
/// <param name="NullValue">null adatra true-t vagy false-t adjon vissza</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public static bool ToBoolean(object data, bool NullValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? NullValue
|
||||
: Convert.ToBoolean(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return NullValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nullokat is kezelõ boolean Convert Nullra.
|
||||
/// </summary>
|
||||
/// <param name="data">Bemenõ adat</param>
|
||||
/// <param name="NullValue">null adatra true-t vagy false-t adjon vissza</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public static bool? ToNullableBoolean(object data)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? (bool?)null
|
||||
: Convert.ToBoolean(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return (bool?)null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// T es F stringbol csinal boolt
|
||||
/// </summary>
|
||||
/// <param name="data">bemeno adat</param>
|
||||
/// <returns>bool</returns>
|
||||
public static bool ToBooleanFromTF(object data)
|
||||
{
|
||||
return ToBooleanFromTF(data, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// T es F stringbol csinal boolt
|
||||
/// </summary>
|
||||
/// <param name="data">bemeno adat</param>
|
||||
/// <param name="NullValue">true vagy false legyen a nullbol</param>
|
||||
/// <returns>bool</returns>
|
||||
public static bool ToBooleanFromTF(object data, bool NullValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? NullValue
|
||||
: Convert.ToBoolean(data.ToString() == "T");
|
||||
}
|
||||
catch
|
||||
{
|
||||
return NullValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// T es F stringbol csinal boolt
|
||||
/// </summary>
|
||||
/// <param name="data">bemeno adat</param>
|
||||
/// <param name="NullValue">true vagy false legyen a nullbol</param>
|
||||
/// <returns>bool</returns>
|
||||
public static bool ToBooleanFromIN(object data, bool NullValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? NullValue
|
||||
: Convert.ToBoolean(data.ToString() == "I");
|
||||
}
|
||||
catch
|
||||
{
|
||||
return NullValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nullokat is kezelõ int Convert
|
||||
/// </summary>
|
||||
/// <param name="data">Bemenõ adat</param>
|
||||
/// <returns>Int32</returns>
|
||||
public static Int32 ToInt32(object data)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? 0
|
||||
: Convert.ToInt32(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static int? ToNullableInt32(object data)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? (int?)null
|
||||
: Convert.ToInt32(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return (int?)null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Int64 ToInt64(object data)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? 0L
|
||||
: Convert.ToInt64(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nullokat is kezelõ int Convert
|
||||
/// </summary>
|
||||
/// <param name="data">Bemenõ adat</param>
|
||||
/// <returns>Int32</returns>
|
||||
public static decimal ToDecimal(object data)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? 0
|
||||
: Convert.ToDecimal(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nullokat is kezelõ int Convert
|
||||
/// </summary>
|
||||
/// <param name="data">Bemenõ adat</param>
|
||||
/// <returns>Int32</returns>
|
||||
public static Int32 ToInt32(object data, int NullValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? NullValue
|
||||
: Convert.ToInt32(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return NullValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nullokat is kezelõ double Convert
|
||||
/// </summary>
|
||||
/// <param name="data">Bemenõ adat</param>
|
||||
/// <returns>Int32</returns>
|
||||
public static Double ToDouble(object data)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? 0D
|
||||
: Convert.ToDouble(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0D;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nullokat is kezelõ double Convert
|
||||
/// </summary>
|
||||
/// <param name="data">Bemenõ adat</param>
|
||||
/// <returns>Int32</returns>
|
||||
public static Double ToDouble(object data, double NullValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? NullValue
|
||||
: Convert.ToDouble(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return NullValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static double? ToNullableDouble(object data)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? (double?)null
|
||||
: Convert.ToDouble(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return (double?)null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nullokat is kezelõ byte tömb Convert
|
||||
/// </summary>
|
||||
/// <param name="data">Bemenõ adat</param>
|
||||
/// <returns>Byte []</returns>
|
||||
public static byte[] ToByteArray(object data)
|
||||
{
|
||||
return data == DBNull.Value || data == null ? null : (byte[])data;
|
||||
}
|
||||
|
||||
public static string ToString(object data)
|
||||
{
|
||||
return ToString(data, "");
|
||||
}
|
||||
|
||||
public static string ToString(object data, string defaultvalue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value))
|
||||
? defaultvalue
|
||||
: data.ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return defaultvalue;
|
||||
}
|
||||
}
|
||||
|
||||
public static DateTime? ToDateTime(object data)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? (DateTime?)null
|
||||
: Convert.ToDateTime(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return (DateTime?)null;
|
||||
}
|
||||
}
|
||||
|
||||
public static DateTime? ToDateTime(object data, DateTime? NullValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((data == null) || (data == DBNull.Value) || string.IsNullOrWhiteSpace(data.ToString()))
|
||||
? NullValue
|
||||
: Convert.ToDateTime(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return NullValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static Guid Int2Guid(int value)
|
||||
{
|
||||
byte[] bytes = new byte[16];
|
||||
BitConverter.GetBytes(value).CopyTo(bytes, 0);
|
||||
return new Guid(bytes);
|
||||
}
|
||||
|
||||
public static int Guid2Int(Guid value)
|
||||
{
|
||||
byte[] b = value.ToByteArray();
|
||||
int bint = BitConverter.ToInt32(b, 0);
|
||||
return bint;
|
||||
}
|
||||
|
||||
public static Guid? StringToNullableGuid(object data)
|
||||
{
|
||||
var value = ToString(data);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Guid(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Kiszed minden olyan elemet ami gondot okozhat a beviteli mezõknél
|
||||
/// LoadWithFilternél használandó
|
||||
/// </summary>
|
||||
/// <param name="text"></param>
|
||||
/// <returns></returns>
|
||||
public static string PreventSQLInjection(string dirtytext)
|
||||
{
|
||||
List<string> disallowedtags = new List<string>()
|
||||
{
|
||||
"'", " or ", " OR ", " and ", " AND ",
|
||||
"=", "<", ">", "<>", " not ", " NOT "
|
||||
};
|
||||
//elviekben mivel az elsõ szóköznél elvágom így nem maradhat benne and, or vagy not
|
||||
string cleartext = dirtytext;
|
||||
|
||||
if (cleartext.Contains(" "))
|
||||
{
|
||||
cleartext = cleartext.Substring(0, cleartext.IndexOf(" ") + 1).Trim();
|
||||
}
|
||||
|
||||
foreach (string tag in disallowedtags)
|
||||
{
|
||||
cleartext = cleartext.Replace(tag, "");
|
||||
}
|
||||
|
||||
return cleartext;
|
||||
}
|
||||
|
||||
public static string PreventXSSAttack(string dirtytext)
|
||||
{
|
||||
if (dirtytext == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
List<string> disallowedtags = new List<string>()
|
||||
{
|
||||
"iframe", "object", "embed", "script"
|
||||
};
|
||||
|
||||
string cleantext = dirtytext;
|
||||
|
||||
foreach (string tag in disallowedtags)
|
||||
{
|
||||
string current_tag = tag.ToLower();
|
||||
int hossz = 0;
|
||||
|
||||
int eleje = cleantext.ToLower().IndexOf(string.Format("<{0}", current_tag));
|
||||
if (eleje == -1)
|
||||
{
|
||||
eleje = cleantext.ToLower().IndexOf(string.Format("<{0}", current_tag));
|
||||
}
|
||||
|
||||
int vege = -1;
|
||||
while (eleje > -1)
|
||||
{
|
||||
hossz = current_tag.Length + 1;
|
||||
vege = cleantext.ToLower().IndexOf(string.Format("/{0}", current_tag), eleje);
|
||||
if (vege == -1)
|
||||
{
|
||||
vege = cleantext.ToLower().IndexOf("/>", eleje);
|
||||
hossz = 2;
|
||||
}
|
||||
if (cleantext.ToLower().IndexOf(">", vege) - (vege + current_tag.Length + 1) == 0)
|
||||
{
|
||||
hossz += 4;
|
||||
}
|
||||
cleantext = cleantext.Remove(eleje, vege - eleje + hossz);
|
||||
eleje = cleantext.ToLower().IndexOf(string.Format("<{0}", current_tag));
|
||||
if (eleje == -1)
|
||||
{
|
||||
eleje = cleantext.ToLower().IndexOf(string.Format("<{0}", current_tag));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return cleantext;
|
||||
}
|
||||
|
||||
public static Guid? ToNullableGuid(object data)
|
||||
{
|
||||
try
|
||||
{
|
||||
return data == null || data == DBNull.Value || string.IsNullOrWhiteSpace(data.ToString())
|
||||
? (Guid?)null
|
||||
: Guid.Parse(ToString(data));
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Guid ToGuid(object data)
|
||||
{
|
||||
try
|
||||
{
|
||||
return data == null || data == DBNull.Value || string.IsNullOrWhiteSpace(data.ToString())
|
||||
? default
|
||||
: Guid.Parse(ToString(data));
|
||||
}
|
||||
catch
|
||||
{
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
public class KretaJobConfig : ConfigurationSection
|
||||
{
|
||||
[ConfigurationProperty(nameof(IsEmailEnabled), IsRequired = true)]
|
||||
public bool IsEmailEnabled => (bool)this[nameof(IsEmailEnabled)];
|
||||
|
||||
[ConfigurationProperty(nameof(DefaultEmail), IsRequired = true)]
|
||||
public string DefaultEmail => (string)this[nameof(DefaultEmail)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
public sealed class KretaVersion
|
||||
{
|
||||
private KretaVersion()
|
||||
{
|
||||
}
|
||||
|
||||
private static readonly Lazy<VersionInfo> VersionInfo = new Lazy<VersionInfo>(GetVersionInfo);
|
||||
|
||||
public static VersionInfo Instance => VersionInfo.Value;
|
||||
|
||||
private static VersionInfo GetVersionInfo()
|
||||
{
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
|
||||
string assemblyLocation = assembly.Location;
|
||||
|
||||
DateTime assemblyCreationDateTime = File.GetCreationTime(assemblyLocation);
|
||||
var result = new VersionInfo
|
||||
{
|
||||
AssemblyCreationDateTime = assemblyCreationDateTime
|
||||
};
|
||||
|
||||
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assemblyLocation);
|
||||
|
||||
string mainVersion = fileVersionInfo.FileVersion;
|
||||
if (!string.IsNullOrWhiteSpace(mainVersion))
|
||||
{
|
||||
result.MainVersion = mainVersion;
|
||||
}
|
||||
|
||||
int fileMajorPart = fileVersionInfo.FileMajorPart;
|
||||
int fileMinorPart = fileVersionInfo.FileMinorPart;
|
||||
if (fileMajorPart > 0 && fileMinorPart >= 0)
|
||||
{
|
||||
result.ShortMainVersion = $"{fileMajorPart}.{fileMinorPart}";
|
||||
}
|
||||
|
||||
List<AssemblyMetadataAttribute> customAttributes = assembly.GetCustomAttributes().OfType<AssemblyMetadataAttribute>().ToList();
|
||||
|
||||
string branchName = customAttributes.SingleOrDefault(x => x.Key == Constants.Version.BranchName)?.Value;
|
||||
if (!string.IsNullOrWhiteSpace(branchName))
|
||||
{
|
||||
result.BranchName = branchName;
|
||||
}
|
||||
|
||||
string commitNumber = customAttributes.SingleOrDefault(x => x.Key == Constants.Version.CommitNumber)?.Value;
|
||||
if (!string.IsNullOrWhiteSpace(commitNumber))
|
||||
{
|
||||
result.CommitNumber = commitNumber;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Core.Logic
|
||||
{
|
||||
public static class BankszamlaLogic
|
||||
{
|
||||
private static readonly int[] s_sulyok = new int[] { 9, 7, 3, 1, 9, 7, 3, 1 };
|
||||
|
||||
public static string KitoltottsegValidacio(string bankszamlaSzam, int? bankszamlaTulajdonosTipusId, string bankszamlaTulajdonosNeve)
|
||||
{
|
||||
var parList = new List<string>()
|
||||
{
|
||||
bankszamlaSzam,
|
||||
bankszamlaTulajdonosTipusId.ToString(),
|
||||
bankszamlaTulajdonosNeve,
|
||||
};
|
||||
if ((parList.All(x => !string.IsNullOrWhiteSpace(x))) || (parList.All(x => string.IsNullOrWhiteSpace(x))))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return ErrorResource.BankszamlaAdatokKitoltottsegeHibas;
|
||||
}
|
||||
|
||||
public static string CDVValidacio(string bankszamlaSzam)
|
||||
{
|
||||
var bankszamlaNonSpace = bankszamlaSzam.Replace(" ", "");
|
||||
var komponensek = bankszamlaNonSpace.Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
if ((!komponensek.Skip(1).Any()) || (komponensek.Skip(3).Any()) || komponensek.Any(x => x.Length < 8))
|
||||
{
|
||||
return ErrorResource.NemMegfeleloSzamuSzamjegyuSzamlaszam;
|
||||
}
|
||||
|
||||
var replBankszamlaSzam = bankszamlaNonSpace.Replace("-", "").Select(x => int.Parse(x.ToString())).ToList();
|
||||
int szumProd = replBankszamlaSzam.Take(8).Select((n, i) => n * s_sulyok[i]).Sum();
|
||||
if ((szumProd % 10) != 0)
|
||||
{
|
||||
return ErrorResource.NemMegfeleloFormatumuElsoOktetSzamlaszamban;
|
||||
}
|
||||
szumProd = replBankszamlaSzam.Select((n, i) => n * s_sulyok[i % 8]).Sum();
|
||||
if ((szumProd % 10) != 0)
|
||||
{
|
||||
return string.Format(ErrorResource.NemMegfeleloFormatumXOktetSzamlaszamban, komponensek.Length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<string> StringSplitByChunkSize(string str, int chunkSize)
|
||||
{
|
||||
return Enumerable.Range(0, str.Length / chunkSize)
|
||||
.Select(i => str.Substring(i * chunkSize, chunkSize)).ToList();
|
||||
}
|
||||
|
||||
public static bool IsBankAccountNumberValid(string bankAccountNumber)
|
||||
{
|
||||
var bankAccountNumberRegex = new Regex(Constants.General.BankAccountNumberRegexPattern);
|
||||
return bankAccountNumberRegex.IsMatch(bankAccountNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.Logic
|
||||
{
|
||||
public static class ConfigurationLogic
|
||||
{
|
||||
public static T GetConfigurationSection<T>(string sectionName) where T : ConfigurationSection
|
||||
{
|
||||
T result = (T)ConfigurationManager.GetSection(sectionName);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Kreta.Core.CustomAttributes;
|
||||
using Kreta.Core.Enum;
|
||||
using Kreta.Core.Exceptions;
|
||||
|
||||
namespace Kreta.Core.Logic
|
||||
{
|
||||
/// <summary>
|
||||
/// Author: Kovács Kornél (DevKornél) Created On: 2019.07.
|
||||
/// </summary>
|
||||
public static class DaoLogic
|
||||
{
|
||||
public static object BoolStringToBool(this object value)
|
||||
{
|
||||
if (Equals(value, "T"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Equals(value, "F"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new BlException(Enum.BlExceptionType.None);
|
||||
}
|
||||
|
||||
public static List<TDao> ToDaoList<TDao>(this DataSet dataSet) where TDao : class, new()
|
||||
{
|
||||
return dataSet.Tables[0].ToDaoList<TDao>();
|
||||
}
|
||||
|
||||
public static List<TDao> ToDaoList<TDao>(this DataTable dataTable) where TDao : class, new()
|
||||
{
|
||||
var response = new List<TDao>();
|
||||
|
||||
foreach (DataRow dataRow in dataTable.Rows)
|
||||
{
|
||||
response.Add(dataRow.ToDao<TDao>());
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
public static HashSet<TDao> ToDaoHashSet<TDao>(this DataSet dataSet) where TDao : class, new()
|
||||
{
|
||||
return dataSet.Tables[0].ToDaoHashSet<TDao>();
|
||||
}
|
||||
|
||||
public static HashSet<TDao> ToDaoHashSet<TDao>(this DataTable dataTable) where TDao : class, new()
|
||||
{
|
||||
var response = new HashSet<TDao>();
|
||||
|
||||
foreach (DataRow dataRow in dataTable.Rows)
|
||||
{
|
||||
if (!response.Add(dataRow.ToDao<TDao>()))
|
||||
{
|
||||
throw new BlException(BlExceptionType.DuplikaltKulcs);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
public static TDao ToDao<TDao>(this DataRow dataRow) where TDao : class, new()
|
||||
{
|
||||
PropertyInfo[] properties = typeof(TDao).GetProperties();
|
||||
var dao = new TDao();
|
||||
|
||||
// Case sensitivity miatt van kiszedve külön (A Table.Columns.Contains() nem case-sensitive).
|
||||
IEnumerable<string> dataTableColumns = dataRow.Table.Columns.Cast<DataColumn>().Select(c => c.ColumnName);
|
||||
|
||||
foreach (PropertyInfo property in properties)
|
||||
{
|
||||
if (property.GetCustomAttribute<IgnoreAttribute>() == null)
|
||||
{
|
||||
string[] columnNames = property.GetCustomAttribute<ColumnNameAttribute>()?.ColumnName ?? new string[] { property.Name };
|
||||
if (dataTableColumns.Intersect(columnNames).Any())
|
||||
{
|
||||
foreach (string columnName in columnNames)
|
||||
{
|
||||
if (dataTableColumns.Contains(columnName))
|
||||
{
|
||||
var propertyValue = ParsePropertyValue(dataRow[columnName], property.PropertyType);
|
||||
if (Nullable.GetUnderlyingType(property.PropertyType) == null && propertyValue == null && property.PropertyType != typeof(string))
|
||||
{
|
||||
throw new BlException(BlExceptionType.ValtozoErtekeNemLehetNull);
|
||||
}
|
||||
|
||||
var getterSetter = property.GetSetMethod();
|
||||
getterSetter.Invoke(dao, new[] { propertyValue });
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BlException(BlExceptionType.ElvartErtekNemTalalhato);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dao;
|
||||
}
|
||||
|
||||
private static object ParsePropertyValue(object dataRowValue, Type propertyType)
|
||||
{
|
||||
if (dataRowValue == DBNull.Value)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (Nullable.GetUnderlyingType(propertyType) != null)
|
||||
{
|
||||
if (dataRowValue == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
propertyType = propertyType.GenericTypeArguments[0];
|
||||
}
|
||||
|
||||
if (propertyType == typeof(bool))
|
||||
{
|
||||
return Logic.DaoLogic.BoolStringToBool(dataRowValue);
|
||||
}
|
||||
|
||||
return Convert.ChangeType(dataRowValue, propertyType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using Kreta.Core.Enum;
|
||||
using Kreta.Core.Exceptions;
|
||||
|
||||
namespace Kreta.Core.Logic
|
||||
{
|
||||
/// <summary>
|
||||
/// Author: Kovács Kornél (DevKornél) Created On: 2019.09.
|
||||
/// </summary>
|
||||
public static class SqlLogic
|
||||
{
|
||||
public static object ParseListToParameter<T>(ICollection<T> list)
|
||||
{
|
||||
object response;
|
||||
if (list == null)
|
||||
{
|
||||
response = DBNull.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (list.Count < 1)
|
||||
{
|
||||
throw new BlException(BlExceptionType.ListaNemTartalmazElemet);
|
||||
}
|
||||
response = CleanSqlParameter(string.Join(Constants.General.VesszoSeparator, list));
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A paraméterben kapott collection elemeit egy sql-template-be menti bele, például: "...NOT IN ({0})"
|
||||
/// </summary>
|
||||
public static string ParseListIntoSqlQuery<T>(string sqlTemplate, ICollection<T> list)
|
||||
{
|
||||
string response;
|
||||
if (list == null)
|
||||
{
|
||||
return sqlTemplate;
|
||||
}
|
||||
|
||||
if (list.Count < 1)
|
||||
{
|
||||
throw new BlException(BlExceptionType.ListaNemTartalmazElemet);
|
||||
}
|
||||
response = CleanSqlParameter(string.Join(Constants.General.VesszoSeparator, list));
|
||||
return string.Format(sqlTemplate, response);
|
||||
}
|
||||
|
||||
public static string CleanSqlParameter(string parameter)
|
||||
{
|
||||
string[] blacklistCharacters = new string[] { "--", ";", "/*", "*/", "@@", "@" };
|
||||
string[] blacklistWords = new string[] {
|
||||
"CHAR", "NCHAR", "VARCHAR", "NVARCHAR", "ALTER", "BEGIN", "CAST",
|
||||
"CREATE", "CURSOR", "DECLARE", "DELETE", "DROP", "END", "EXEC",
|
||||
"EXECUTE", "FETCH", "INSERT", "KILL", "OPEN", "SELECT", "SYS",
|
||||
"SYSOBJECTS", "SYSCOLUMNS", "TABLE", "UPDATE"
|
||||
};
|
||||
|
||||
string result = parameter;
|
||||
|
||||
foreach (var blacklistItem in blacklistCharacters)
|
||||
{
|
||||
result = result.Replace(blacklistItem, "");
|
||||
}
|
||||
foreach (var blacklistItem in blacklistWords)
|
||||
{
|
||||
result = Regex.Replace(result, blacklistItem, "", RegexOptions.IgnoreCase);
|
||||
}
|
||||
|
||||
return result.Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,546 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using Jose;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Core.Logic
|
||||
{
|
||||
public static class UrlLogic
|
||||
{
|
||||
public static string Encrypt(string token, string key)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(token))
|
||||
{
|
||||
throw new ArgumentException(nameof(token));
|
||||
}
|
||||
|
||||
byte[] encryptedData;
|
||||
|
||||
using (SymmetricAlgorithm symmetricAlgorithm = Aes.Create())
|
||||
{
|
||||
using (var memoryStream = new MemoryStream())
|
||||
{
|
||||
ICryptoTransform encryptor = symmetricAlgorithm.CreateEncryptor(Encoding.UTF8.GetBytes(key), new byte[16]);
|
||||
using (var cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write))
|
||||
{
|
||||
using (var streamWriter = new StreamWriter(cryptoStream))
|
||||
{
|
||||
streamWriter.Write(token);
|
||||
}
|
||||
|
||||
encryptedData = memoryStream.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string result = WebEncoders.Base64UrlEncode(encryptedData);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static string Decrypt(string encryptData, string key)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(encryptData))
|
||||
{
|
||||
throw new ArgumentException(nameof(encryptData));
|
||||
}
|
||||
|
||||
string decryptedData;
|
||||
byte[] encryptDataBytes = WebEncoders.Base64UrlDecode(encryptData);
|
||||
|
||||
using (SymmetricAlgorithm symmetricAlgorithm = Aes.Create())
|
||||
{
|
||||
using (var memoryStream = new MemoryStream(encryptDataBytes))
|
||||
{
|
||||
ICryptoTransform encryptor = symmetricAlgorithm.CreateDecryptor(Encoding.UTF8.GetBytes(key), new byte[16]);
|
||||
using (var cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Read))
|
||||
{
|
||||
using (var streamReader = new StreamReader(cryptoStream))
|
||||
{
|
||||
decryptedData = streamReader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return decryptedData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A JweEncrypt egy jose-jwt nevű nuget-et használ és a JSON Web Encryption (JWE) formátumra enrypt-álja a bejövő objektumot.
|
||||
/// A JWE leírása: https://tools.ietf.org/html/rfc7516
|
||||
/// A jose-jwt leírása: https://github.com/dvsekhvalnov/jose-jwt
|
||||
/// Jelenleg az MKB bankos integrációhoz(tanuló bankszámlaigénylés) szükséges, ők ezt a fajta titkosítást használják.
|
||||
/// </summary>
|
||||
/// <param name="publicKeyFileName">A publikus kulcs elérési útvonala.</param>
|
||||
/// <param name="publicKeyFilePassword">A publikus kulcshoz tartozó jelszó(nem kötelező).</param>
|
||||
/// <param name="payload">Az objektum, amit enkódol a megfelelő formátumra a jose-jwt nuget.</param>
|
||||
/// <returns></returns>
|
||||
public static string JweEncrypt(string publicKeyFileName, string publicKeyFilePassword, object payload)
|
||||
{
|
||||
if (!File.Exists(publicKeyFileName))
|
||||
{
|
||||
throw new FileNotFoundException(publicKeyFileName);
|
||||
}
|
||||
|
||||
if (payload == null)
|
||||
{
|
||||
throw new ArgumentException(nameof(payload));
|
||||
}
|
||||
|
||||
RSACryptoServiceProvider key = string.IsNullOrWhiteSpace(publicKeyFilePassword) ?
|
||||
new X509Certificate2(publicKeyFileName).PublicKey.Key as RSACryptoServiceProvider :
|
||||
new X509Certificate2(publicKeyFileName, publicKeyFilePassword).PublicKey.Key as RSACryptoServiceProvider;
|
||||
|
||||
string result = JWT.Encode(payload, key, JweAlgorithm.RSA_OAEP, JweEncryption.A256GCM);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A JweDecrypt egy jose-jwt nevű nuget-et használ és a JSON Web Encryption (JWE) formátumú token-t decrypt-álja string-é, akár json formátumban.
|
||||
/// A JWE leírása: https://tools.ietf.org/html/rfc7516
|
||||
/// A jose-jwt leírása: https://github.com/dvsekhvalnov/jose-jwt
|
||||
/// Jelenleg az MKB bankos integrációhoz(tanuló bankszámlaigénylés) szükséges, ők ezt a fajta titkosítást használják.
|
||||
/// </summary>
|
||||
/// <param name="privateKeyFileName">A privát kulcs elérési útvonala.</param>
|
||||
/// <param name="privateKeyFilePassword">A privát kulcshoz tartozó jelszó(nem kötelező).</param>
|
||||
/// <param name="token">A token, amit dekódol string-é a jose-jwt nuget.</param>
|
||||
/// <param name="isJsonObject">Ha nem json objektumról van szó, akkor a dekódolás benne hagy escape karaktereket(\"), pl. Guid-nál és ezeket kiszedjük, hogy egyszerűbb legyen a típuskoncerzió.</param>
|
||||
/// <returns></returns>
|
||||
public static string JweDecrypt(string privateKeyFileName, string privateKeyFilePassword, string token, bool isJsonObject = false)
|
||||
{
|
||||
if (!File.Exists(privateKeyFileName))
|
||||
{
|
||||
throw new FileNotFoundException(privateKeyFileName);
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(token))
|
||||
{
|
||||
throw new ArgumentException(nameof(token));
|
||||
}
|
||||
|
||||
RSACryptoServiceProvider key = string.IsNullOrWhiteSpace(privateKeyFilePassword) ?
|
||||
new X509Certificate2(privateKeyFileName).PrivateKey as RSACryptoServiceProvider :
|
||||
new X509Certificate2(privateKeyFileName, privateKeyFilePassword).PrivateKey as RSACryptoServiceProvider;
|
||||
|
||||
string result = JWT.Decode(token, key);
|
||||
if (!isJsonObject)
|
||||
{
|
||||
result = result.Replace("\"", string.Empty);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static string GetEmailKezelesUrl(string intezmenyAzonosito = null, Guid? guid = null)
|
||||
{
|
||||
string url = null;
|
||||
if (!string.IsNullOrWhiteSpace(intezmenyAzonosito) && guid.HasValue)
|
||||
{
|
||||
var data = Encrypt(guid.ToString(), Constants.EncryptionKey);
|
||||
if (!string.IsNullOrWhiteSpace(data))
|
||||
{
|
||||
var builder = new UriBuilder(string.Format(CommonResource.IntezmenyUrl, intezmenyAzonosito))
|
||||
{
|
||||
Path = "/Adminisztracio/EmailKezeles",
|
||||
Query = $"data={HttpUtility.UrlEncode(data)}",
|
||||
Scheme = "https"
|
||||
};
|
||||
url = builder.Uri.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/aspnet/Extensions/blob/5c3ee37fb773db04a1aea6b67e49395e84fda223/shared/Microsoft.Extensions.WebEncoders.Sources/Properties/EncoderResources.cs
|
||||
internal static class WebEncoders
|
||||
{
|
||||
private static readonly byte[] EmptyBytes = new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a base64url-encoded string.
|
||||
/// </summary>
|
||||
/// <param name="input">The base64url-encoded input to decode.</param>
|
||||
/// <returns>The base64url-decoded form of the input.</returns>
|
||||
/// <remarks>
|
||||
/// The input must not contain any whitespace or padding characters.
|
||||
/// Throws <see cref="FormatException"/> if the input is malformed.
|
||||
/// </remarks>
|
||||
public static byte[] Base64UrlDecode(string input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
|
||||
return Base64UrlDecode(input, offset: 0, count: input.Length);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a base64url-encoded substring of a given string.
|
||||
/// </summary>
|
||||
/// <param name="input">A string containing the base64url-encoded input to decode.</param>
|
||||
/// <param name="offset">The position in <paramref name="input"/> at which decoding should begin.</param>
|
||||
/// <param name="count">The number of characters in <paramref name="input"/> to decode.</param>
|
||||
/// <returns>The base64url-decoded form of the input.</returns>
|
||||
/// <remarks>
|
||||
/// The input must not contain any whitespace or padding characters.
|
||||
/// Throws <see cref="FormatException"/> if the input is malformed.
|
||||
/// </remarks>
|
||||
public static byte[] Base64UrlDecode(string input, int offset, int count)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
|
||||
ValidateParameters(input.Length, nameof(input), offset, count);
|
||||
|
||||
// Special-case empty input
|
||||
if (count == 0)
|
||||
{
|
||||
return EmptyBytes;
|
||||
}
|
||||
|
||||
// Create array large enough for the Base64 characters, not just shorter Base64-URL-encoded form.
|
||||
var buffer = new char[GetArraySizeRequiredToDecode(count)];
|
||||
|
||||
return Base64UrlDecode(input, offset, buffer, bufferOffset: 0, count: count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a base64url-encoded <paramref name="input"/> into a <c>byte[]</c>.
|
||||
/// </summary>
|
||||
/// <param name="input">A string containing the base64url-encoded input to decode.</param>
|
||||
/// <param name="offset">The position in <paramref name="input"/> at which decoding should begin.</param>
|
||||
/// <param name="buffer">
|
||||
/// Scratch buffer to hold the <see cref="char"/>s to decode. Array must be large enough to hold
|
||||
/// <paramref name="bufferOffset"/> and <paramref name="count"/> characters as well as Base64 padding
|
||||
/// characters. Content is not preserved.
|
||||
/// </param>
|
||||
/// <param name="bufferOffset">
|
||||
/// The offset into <paramref name="buffer"/> at which to begin writing the <see cref="char"/>s to decode.
|
||||
/// </param>
|
||||
/// <param name="count">The number of characters in <paramref name="input"/> to decode.</param>
|
||||
/// <returns>The base64url-decoded form of the <paramref name="input"/>.</returns>
|
||||
/// <remarks>
|
||||
/// The input must not contain any whitespace or padding characters.
|
||||
/// Throws <see cref="FormatException"/> if the input is malformed.
|
||||
/// </remarks>
|
||||
public static byte[] Base64UrlDecode(string input, int offset, char[] buffer, int bufferOffset, int count)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(buffer));
|
||||
}
|
||||
|
||||
ValidateParameters(input.Length, nameof(input), offset, count);
|
||||
if (bufferOffset < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(bufferOffset));
|
||||
}
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
return EmptyBytes;
|
||||
}
|
||||
|
||||
// Assumption: input is base64url encoded without padding and contains no whitespace.
|
||||
|
||||
var paddingCharsToAdd = GetNumBase64PaddingCharsToAddForDecode(count);
|
||||
var arraySizeRequired = checked(count + paddingCharsToAdd);
|
||||
Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
|
||||
|
||||
if (buffer.Length - bufferOffset < arraySizeRequired)
|
||||
{
|
||||
throw new ArgumentException(
|
||||
string.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
EncoderResources.WebEncoders_InvalidCountOffsetOrLength,
|
||||
nameof(count),
|
||||
nameof(bufferOffset),
|
||||
nameof(input)),
|
||||
nameof(count));
|
||||
}
|
||||
|
||||
// Copy input into buffer, fixing up '-' -> '+' and '_' -> '/'.
|
||||
var i = bufferOffset;
|
||||
for (var j = offset; i - bufferOffset < count; i++, j++)
|
||||
{
|
||||
var ch = input[j];
|
||||
if (ch == '-')
|
||||
{
|
||||
buffer[i] = '+';
|
||||
}
|
||||
else if (ch == '_')
|
||||
{
|
||||
buffer[i] = '/';
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer[i] = ch;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the padding characters back.
|
||||
for (; paddingCharsToAdd > 0; i++, paddingCharsToAdd--)
|
||||
{
|
||||
buffer[i] = '=';
|
||||
}
|
||||
|
||||
// Decode.
|
||||
// If the caller provided invalid base64 chars, they'll be caught here.
|
||||
return Convert.FromBase64CharArray(buffer, bufferOffset, arraySizeRequired);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the minimum <c>char[]</c> size required for decoding of <paramref name="count"/> characters
|
||||
/// with the <see cref="Base64UrlDecode(string, int, char[], int, int)"/> method.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of characters to decode.</param>
|
||||
/// <returns>
|
||||
/// The minimum <c>char[]</c> size required for decoding of <paramref name="count"/> characters.
|
||||
/// </returns>
|
||||
public static int GetArraySizeRequiredToDecode(int count)
|
||||
{
|
||||
if (count < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(count));
|
||||
}
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
var numPaddingCharsToAdd = GetNumBase64PaddingCharsToAddForDecode(count);
|
||||
|
||||
return checked(count + numPaddingCharsToAdd);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encodes <paramref name="input"/> using base64url encoding.
|
||||
/// </summary>
|
||||
/// <param name="input">The binary input to encode.</param>
|
||||
/// <returns>The base64url-encoded form of <paramref name="input"/>.</returns>
|
||||
public static string Base64UrlEncode(byte[] input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
|
||||
return Base64UrlEncode(input, offset: 0, count: input.Length);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encodes <paramref name="input"/> using base64url encoding.
|
||||
/// </summary>
|
||||
/// <param name="input">The binary input to encode.</param>
|
||||
/// <param name="offset">The offset into <paramref name="input"/> at which to begin encoding.</param>
|
||||
/// <param name="count">The number of bytes from <paramref name="input"/> to encode.</param>
|
||||
/// <returns>The base64url-encoded form of <paramref name="input"/>.</returns>
|
||||
public static string Base64UrlEncode(byte[] input, int offset, int count)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
|
||||
ValidateParameters(input.Length, nameof(input), offset, count);
|
||||
|
||||
// Special-case empty input
|
||||
if (count == 0)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var buffer = new char[GetArraySizeRequiredToEncode(count)];
|
||||
var numBase64Chars = Base64UrlEncode(input, offset, buffer, outputOffset: 0, count: count);
|
||||
|
||||
return new String(buffer, startIndex: 0, length: numBase64Chars);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encodes <paramref name="input"/> using base64url encoding.
|
||||
/// </summary>
|
||||
/// <param name="input">The binary input to encode.</param>
|
||||
/// <param name="offset">The offset into <paramref name="input"/> at which to begin encoding.</param>
|
||||
/// <param name="output">
|
||||
/// Buffer to receive the base64url-encoded form of <paramref name="input"/>. Array must be large enough to
|
||||
/// hold <paramref name="outputOffset"/> characters and the full base64-encoded form of
|
||||
/// <paramref name="input"/>, including padding characters.
|
||||
/// </param>
|
||||
/// <param name="outputOffset">
|
||||
/// The offset into <paramref name="output"/> at which to begin writing the base64url-encoded form of
|
||||
/// <paramref name="input"/>.
|
||||
/// </param>
|
||||
/// <param name="count">The number of <c>byte</c>s from <paramref name="input"/> to encode.</param>
|
||||
/// <returns>
|
||||
/// The number of characters written to <paramref name="output"/>, less any padding characters.
|
||||
/// </returns>
|
||||
public static int Base64UrlEncode(byte[] input, int offset, char[] output, int outputOffset, int count)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
|
||||
if (output == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(output));
|
||||
}
|
||||
|
||||
ValidateParameters(input.Length, nameof(input), offset, count);
|
||||
if (outputOffset < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(outputOffset));
|
||||
}
|
||||
|
||||
var arraySizeRequired = GetArraySizeRequiredToEncode(count);
|
||||
if (output.Length - outputOffset < arraySizeRequired)
|
||||
{
|
||||
throw new ArgumentException(
|
||||
string.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
EncoderResources.WebEncoders_InvalidCountOffsetOrLength,
|
||||
nameof(count),
|
||||
nameof(outputOffset),
|
||||
nameof(output)),
|
||||
nameof(count));
|
||||
}
|
||||
|
||||
// Special-case empty input.
|
||||
if (count == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Use base64url encoding with no padding characters. See RFC 4648, Sec. 5.
|
||||
|
||||
// Start with default Base64 encoding.
|
||||
var numBase64Chars = Convert.ToBase64CharArray(input, offset, count, output, outputOffset);
|
||||
|
||||
// Fix up '+' -> '-' and '/' -> '_'. Drop padding characters.
|
||||
for (var i = outputOffset; i - outputOffset < numBase64Chars; i++)
|
||||
{
|
||||
var ch = output[i];
|
||||
if (ch == '+')
|
||||
{
|
||||
output[i] = '-';
|
||||
}
|
||||
else if (ch == '/')
|
||||
{
|
||||
output[i] = '_';
|
||||
}
|
||||
else if (ch == '=')
|
||||
{
|
||||
// We've reached a padding character; truncate the remainder.
|
||||
return i - outputOffset;
|
||||
}
|
||||
}
|
||||
|
||||
return numBase64Chars;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the minimum output <c>char[]</c> size required for encoding <paramref name="count"/>
|
||||
/// <see cref="byte"/>s with the <see cref="Base64UrlEncode(byte[], int, char[], int, int)"/> method.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of characters to encode.</param>
|
||||
/// <returns>
|
||||
/// The minimum output <c>char[]</c> size required for encoding <paramref name="count"/> <see cref="byte"/>s.
|
||||
/// </returns>
|
||||
public static int GetArraySizeRequiredToEncode(int count)
|
||||
{
|
||||
var numWholeOrPartialInputBlocks = checked(count + 2) / 3;
|
||||
return checked(numWholeOrPartialInputBlocks * 4);
|
||||
}
|
||||
|
||||
private static int GetNumBase64PaddingCharsToAddForDecode(int inputLength)
|
||||
{
|
||||
switch (inputLength % 4)
|
||||
{
|
||||
case 0:
|
||||
return 0;
|
||||
case 2:
|
||||
return 2;
|
||||
case 3:
|
||||
return 1;
|
||||
default:
|
||||
throw new FormatException(
|
||||
string.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
EncoderResources.WebEncoders_MalformedInput,
|
||||
inputLength));
|
||||
}
|
||||
}
|
||||
|
||||
private static void ValidateParameters(int bufferLength, string inputName, int offset, int count)
|
||||
{
|
||||
if (offset < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(offset));
|
||||
}
|
||||
|
||||
if (count < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(count));
|
||||
}
|
||||
|
||||
if (bufferLength - offset < count)
|
||||
{
|
||||
throw new ArgumentException(
|
||||
string.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
EncoderResources.WebEncoders_InvalidCountOffsetOrLength,
|
||||
nameof(count),
|
||||
nameof(offset),
|
||||
inputName),
|
||||
nameof(count));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static class EncoderResources
|
||||
{
|
||||
/// <summary>
|
||||
/// Invalid {0}, {1} or {2} length.
|
||||
/// </summary>
|
||||
internal static readonly string WebEncoders_InvalidCountOffsetOrLength = "Invalid {0}, {1} or {2} length.";
|
||||
|
||||
/// <summary>
|
||||
/// Malformed input: {0} is an invalid input length.
|
||||
/// </summary>
|
||||
internal static readonly string WebEncoders_MalformedInput = "Malformed input: {0} is an invalid input length.";
|
||||
|
||||
/// <summary>
|
||||
/// Invalid {0}, {1} or {2} length.
|
||||
/// </summary>
|
||||
internal static string FormatWebEncoders_InvalidCountOffsetOrLength(object p0, object p1, object p2)
|
||||
{
|
||||
return string.Format(CultureInfo.CurrentCulture, WebEncoders_InvalidCountOffsetOrLength, p0, p1, p2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Malformed input: {0} is an invalid input length.
|
||||
/// </summary>
|
||||
internal static string FormatWebEncoders_MalformedInput(object p0)
|
||||
{
|
||||
return string.Format(CultureInfo.CurrentCulture, WebEncoders_MalformedInput, p0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.ModelBinding;
|
||||
|
||||
namespace Kreta.Core.ModelBinder
|
||||
{
|
||||
public class StringTrimModelBinder : IModelBinder
|
||||
{
|
||||
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)
|
||||
{
|
||||
var value = bindingContext.ValueProvider.GetValue(bindingContext.ModelName);
|
||||
var attemptedValue = value?.AttemptedValue;
|
||||
|
||||
bindingContext.Model = string.IsNullOrWhiteSpace(attemptedValue) ? null : attemptedValue.Trim();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Configuration;
|
||||
using Kreta.Core.SAP;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
public class SapConfiguration : ConfigurationSection, ISAPConfiguration
|
||||
{
|
||||
[ConfigurationProperty(nameof(User), IsRequired = true)]
|
||||
public string User { get => (string)this[nameof(User)]; }
|
||||
|
||||
[ConfigurationProperty(nameof(Password), IsRequired = true)]
|
||||
public string Password { get => (string)this[nameof(Password)]; }
|
||||
|
||||
[ConfigurationProperty(nameof(BaseUrl), IsRequired = true)]
|
||||
public string BaseUrl { get => (string)this[nameof(BaseUrl)]; }
|
||||
|
||||
[ConfigurationProperty(nameof(RogzitesUrl))]
|
||||
public string RogzitesUrl { get => string.Format("{0}/{1}", (string)this[nameof(BaseUrl)], (string)this[nameof(RogzitesUrl)]); }
|
||||
|
||||
[ConfigurationProperty(nameof(LekerdezesUrl))]
|
||||
public string LekerdezesUrl { get => string.Format("{0}/{1}", (string)this[nameof(BaseUrl)], (string)this[nameof(LekerdezesUrl)]); }
|
||||
|
||||
[ConfigurationProperty(nameof(LekerdezesKeretUrl))]
|
||||
public string LekerdezesKeretUrl { get => string.Format("{0}/{1}", (string)this[nameof(BaseUrl)], (string)this[nameof(LekerdezesKeretUrl)]); }
|
||||
|
||||
[ConfigurationProperty(nameof(NotificationEmails))]
|
||||
public string NotificationEmails { get => ((string)this[nameof(NotificationEmails)]); }
|
||||
|
||||
[ConfigurationProperty(nameof(NotificationEmailsBussinessLogic))]
|
||||
public string NotificationEmailsBussinessLogic { get => ((string)this[nameof(NotificationEmailsBussinessLogic)]); }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a strongly typed list of Tuples that can be accessed by index. Provides methods to search, sort, and manipulate lists.
|
||||
/// </summary>
|
||||
/// <typeparam name="T1">The type of the first component of the tuples.</typeparam>
|
||||
/// <typeparam name="T2">The type of the second component of the tuples.</typeparam>
|
||||
/// <typeparam name="T3">The type of the third component of the tuples.</typeparam>
|
||||
/// <typeparam name="T4">The type of the fourth component of the tuples.</typeparam>
|
||||
[Obsolete("@DevKornél: szuboptimális a megvalósítás, nem feltétlen kellene list belsejében használni sok elemű tuple-t")]
|
||||
public class QuadrupleList<T1, T2, T3, T4> : List<Tuple<T1, T2, T3, T4>>
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds a Tuple to the end of the Kreta.Core.QuadrupleList.
|
||||
/// </summary>
|
||||
/// <param name="first">The value of the first component of the tuple.</param>
|
||||
/// <param name="second">The value of the second component of the tuple.</param>
|
||||
/// <param name="third">The value of the third component of the tuple.</param>
|
||||
/// <param name="fourth">The value of the fourth component of the tuple.</param>
|
||||
public void Add(T1 first, T2 second, T3 third, T4 fourth)
|
||||
{
|
||||
Add(new Tuple<T1, T2, T3, T4>(first, second, third, fourth));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the elements of the specified collection to the end of the Kreta.Core.QuadrupleList.
|
||||
/// </summary>
|
||||
/// <param name="list">The collection whose elements should be added to the end of the Kreta.Core.QuadrupleList. The collection itself cannot be null, but it can contain elements that are null, if any of the types T1, T2, T3, or T4 are reference types.</param>
|
||||
public QuadrupleList(IEnumerable<Tuple<T1, T2, T3, T4>> list)
|
||||
{
|
||||
AddRange(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kreta.Core.QuadrupleList class that is empty and has the default initial capacity.
|
||||
/// </summary>
|
||||
public QuadrupleList() : base()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a strongly typed list of Tuples that can be accessed by index. Provides methods to search, sort, and manipulate lists.
|
||||
/// </summary>
|
||||
/// <typeparam name="T1">The type of the first component of the tuples.</typeparam>
|
||||
/// <typeparam name="T2">The type of the second component of the tuples.</typeparam>
|
||||
/// <typeparam name="T3">The type of the third component of the tuples.</typeparam>
|
||||
/// <typeparam name="T4">The type of the fourth component of the tuples.</typeparam>
|
||||
/// <typeparam name="T5">The type of the fifth component of the tuples.</typeparam>
|
||||
[Obsolete("@DevKornél: szuboptimális a megvalósítás, nem feltétlen kellene list belsejében használni sok elemű tuple-t")]
|
||||
public class QuintupleList<T1, T2, T3, T4, T5> : List<Tuple<T1, T2, T3, T4, T5>>
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds a Tuple to the end of the Kreta.Core.QuintupleList.
|
||||
/// </summary>
|
||||
/// <param name="first">The value of the first component of the tuple.</param>
|
||||
/// <param name="second">The value of the second component of the tuple.</param>
|
||||
/// <param name="third">The value of the third component of the tuple.</param>
|
||||
/// <param name="fourth">The value of the fourth component of the tuple.</param>
|
||||
/// <param name="fifth">The value of the fifth component of the tuple.</param>
|
||||
public void Add(T1 first, T2 second, T3 third, T4 fourth, T5 fifth)
|
||||
{
|
||||
Add(new Tuple<T1, T2, T3, T4, T5>(first, second, third, fourth, fifth));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the elements of the specified collection to the end of the Kreta.Core.QuintupleList.
|
||||
/// </summary>
|
||||
/// <param name="list">The collection whose elements should be added to the end of the Kreta.Core.QuintupleList. The collection itself cannot be null, but it can contain elements that are null, if any of the types T1, T2, T3, or T4 are reference types.</param>
|
||||
public QuintupleList(List<Tuple<T1, T2, T3, T4, T5>> list)
|
||||
{
|
||||
AddRange(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kreta.Core.QuintupleList class that is empty and has the default initial capacity.
|
||||
/// </summary>
|
||||
public QuintupleList() : base()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
public class UgyfelszolgalatConfig : ConfigurationSection, IUgyfelszolgalatConfig
|
||||
{
|
||||
[ConfigurationProperty(nameof(Url), IsRequired = true)]
|
||||
public string Url => (string)this[nameof(Url)];
|
||||
|
||||
[ConfigurationProperty(nameof(ProjectKey), IsRequired = true)]
|
||||
public string ProjectKey => (string)this[nameof(ProjectKey)];
|
||||
|
||||
[ConfigurationProperty(nameof(CommaSeparatedGroupIdFilters), IsRequired = true)]
|
||||
public string CommaSeparatedGroupIdFilters => (string)this[nameof(CommaSeparatedGroupIdFilters)];
|
||||
|
||||
[ConfigurationProperty(nameof(IsFileUploadEnabled), IsRequired = true)]
|
||||
public bool IsFileUploadEnabled => (bool)this[nameof(IsFileUploadEnabled)];
|
||||
|
||||
[ConfigurationProperty(nameof(JiraServiceApiUrl), IsRequired = true)]
|
||||
public string JiraServiceApiUrl => (string)this[nameof(JiraServiceApiUrl)];
|
||||
|
||||
[ConfigurationProperty(nameof(JiraServiceApiKey), IsRequired = true)]
|
||||
public string JiraServiceApiKey => (string)this[nameof(JiraServiceApiKey)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
|
||||
namespace Kreta.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// VersionInfo
|
||||
/// </summary>
|
||||
public class VersionInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the main version.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The main version.
|
||||
/// </value>
|
||||
public string MainVersion { get; set; } = Constants.Version.NotAvailable;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the short main version.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The short main version.
|
||||
/// </value>
|
||||
public string ShortMainVersion { get; set; } = Constants.Version.NotAvailable;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the assembly creation date time.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The assembly creation date time.
|
||||
/// </value>
|
||||
public DateTime AssemblyCreationDateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the branch.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The name of the branch.
|
||||
/// </value>
|
||||
public string BranchName { get; set; } = Constants.Version.NotAvailable;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the commit number.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The commit number.
|
||||
/// </value>
|
||||
public string CommitNumber { get; set; } = Constants.Version.NotAvailable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<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>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="HtmlAgilityPack" version="1.8.10" targetFramework="net48" />
|
||||
<package id="jose-jwt" version="2.5.0" targetFramework="net48" />
|
||||
<package id="Kreta.Core.KIR" version="1.0.62351" targetFramework="net48" />
|
||||
<package id="Kreta.Core.SAP" version="2.0.40" targetFramework="net48" />
|
||||
<package id="Meziantou.Analyzer" version="1.0.688" targetFramework="net48" developmentDependency="true" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.6" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.6" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user