using System; using System.Configuration; using System.Web; using Kreta.Framework; namespace Kreta.BusinessLogic.Classes { public class ApplicationData { #region Web.Config Pareméterek public static string ReCaptchaPrivateKey { get { return ConfigurationManager.AppSettings["ReCaptchaPrivateKey"] ?? ""; } } public static string ReCaptchaPublicKey { get { return ConfigurationManager.AppSettings["ReCaptchaPublicKey"] ?? ""; } } public static string ReCaptchaValidateUrl { get { return ConfigurationManager.AppSettings["ReCaptchaValidateUrl"] ?? ""; } } public static int? ReCaptchaIsEnabledCounter { get { var ReCaptchaIsEnabledCounterValue = ConfigurationManager.AppSettings["ReCaptchaIsEnabledCounter"]; int.TryParse(ReCaptchaIsEnabledCounterValue, out int result); return result == 0 ? (int?)null : result; } } public static string AdminDefaultPage { get { return ConfigurationManager.AppSettings["Adminisztrator_DefaultPage"] ?? ""; } } public static string IgazgatoDefaultPage { get { return ConfigurationManager.AppSettings["Igazgato_DefaultPage"] ?? ""; } } public static string OsztalyfonokDefaultPage { get { return ConfigurationManager.AppSettings["Osztalyfonok_DefaultPage"] ?? ""; } } public static string TanarDefaultPage { get { return ConfigurationManager.AppSettings["Tanar_DefaultPage"] ?? ""; } } public static string NaploDefaultPage { get { return ConfigurationManager.AppSettings["Naplo_DefaultPage"] ?? ""; } } public static string SzuloDefaultPage { get { return ConfigurationManager.AppSettings["Szulo_DefaultPage"] ?? ""; } } public static string CsokkentettSzuloDefaultPage { get { return ConfigurationManager.AppSettings["CsokkentettSzulo_DefaultPage"] ?? ""; } } public static string TanuloDefaultPage { get { return ConfigurationManager.AppSettings["Tanulo_DefaultPage"] ?? ""; } } public static string TavolletDefaultPage { get { return ConfigurationManager.AppSettings["Tavollet_DefaultPage"] ?? ""; } } public static string ArchivDefaultPage { get { return ConfigurationManager.AppSettings["Archiv_DefaultPage"] ?? ""; } } public static string DualisAdminDefaultPage { get { return ConfigurationManager.AppSettings["DualisAdmin_DefaultPage"] ?? ""; } } public static bool KretaDebug { get { var currContext = HttpContext.Current; //GUID = 465B55A0B15D4B08AC446620577A615C if (currContext != null && currContext.Handler != null && HttpContext.Current.Request.Params["KretaDebug"] == "465B55A0B15D4B08AC446620577A615C") { return true; } return SDAConvert.ToBoolean(ConfigurationManager.AppSettings["KretaDebug"], false); } set { ConfigurationManager.AppSettings["KretaDebug"] = value.ToString(); } } public static bool IsUsageTraced { get { return ConfigurationManager.AppSettings["UsageTracking"] != null && SDAConvert.ToBoolean(ConfigurationManager.AppSettings["UsageTracking"], false); } set { ConfigurationManager.AppSettings["UsageTracking"] = value.ToString(); } } public static string NyomtatasiSablonokKonyvtar { get { if (HttpContext.Current.Application["NyomtatasiSablonokKonyvtar"] == null) { NyomtatasiSablonokKonyvtar = ConfigurationManager.AppSettings["NyomtatasiSablonokKonyvtar"]; } return HttpContext.Current.Application["NyomtatasiSablonokKonyvtar"] as string; } set { HttpContext.Current.Application["NyomtatasiSablonokKonyvtar"] = value; } } public static string KirLoginUrl { get { if (HttpContext.Current.Application["KirLoginUrl"] == null) { HttpContext.Current.Application["KirLoginUrl"] = ConfigurationManager.AppSettings["KirLoginUrl"]; } return HttpContext.Current.Application["KirLoginUrl"].ToString(); } } public static string MdszUrl { get { if (HttpContext.Current.Application["MdszUrl"] == null) { HttpContext.Current.Application["MdszUrl"] = ConfigurationManager.AppSettings["MdszUrl"]; } return HttpContext.Current.Application["MdszUrl"].ToString(); } } public static string MdszUserName { get { if (HttpContext.Current.Application["MdszUserName"] == null) { HttpContext.Current.Application["MdszUserName"] = ConfigurationManager.AppSettings["MdszUserName"]; } return HttpContext.Current.Application["MdszUserName"].ToString(); } } public static string MdszPassword { get { if (HttpContext.Current.Application["MdszPassword"] == null) { HttpContext.Current.Application["MdszPassword"] = ConfigurationManager.AppSettings["MdszPassword"]; } return HttpContext.Current.Application["MdszPassword"].ToString(); } } public static bool OnTTFPrompt { get { if (HttpContext.Current.Application["OnTTFPrompt"] == null) { HttpContext.Current.Application["OnTTFPrompt"] = ConfigurationManager.AppSettings["OnTTFPrompt"]; } return string.Equals(HttpContext.Current.Application["OnTTFPrompt"].ToString(), bool.TrueString, StringComparison.OrdinalIgnoreCase); } } public static string PoszeidonUrl { get { if (HttpContext.Current.Application["PoszeidonUrl"] == null) { HttpContext.Current.Application["PoszeidonUrl"] = ConfigurationManager.AppSettings["PoszeidonUrl"]; } return HttpContext.Current.Application["PoszeidonUrl"].ToString(); } } public static string TempDataKonyvtar { get { if (HttpContext.Current.Application["TempDataKonyvtar"] == null) { HttpContext.Current.Application["TempDataKonyvtar"] = ConfigurationManager.AppSettings["TempDataKonyvtar"]; } return HttpContext.Current.Application["TempDataKonyvtar"].ToString(); } } public static int TemporaryFileDeletionThresholdInSeconds { get { if (HttpContext.Current.Application[nameof(TemporaryFileDeletionThresholdInSeconds)] == null) { HttpContext.Current.Application[nameof(TemporaryFileDeletionThresholdInSeconds)] = int.Parse(ConfigurationManager.AppSettings[nameof(TemporaryFileDeletionThresholdInSeconds)]); } return int.Parse(HttpContext.Current.Application[nameof(TemporaryFileDeletionThresholdInSeconds)].ToString()); } } #endregion public static SystemType SystemType { get { if (HttpContext.Current.Application["SystemType"] != null) { return (SystemType)HttpContext.Current.Application["SystemType"]; } return SystemType.Ismeretlen; } set { HttpContext.Current.Application["SystemType"] = value; } } } }