tbf/Common/GlobalData.cs

43 lines
1.5 KiB
C#
Raw Normal View History

///
/// Copyright (c) 2021 Sensus Slovensko a.s.
///
using System;
namespace Common
{
public class GlobalData
{
public static double SampleDensity = 0; /// sample water density measured in an accredited labo [kg/m3]
public static double SampleTemp = 0; /// sample temperature when density measured in an accredited labo [°C]
public static double Buoyancy = 0;
public const string AdminUsername = "admin";
public const string AdminPassword = "staratura";
public static DBSettings RemoteUsersDB = null;
public static DBSettings LocalUsersDB = null;
public static IUser CurrentUser;
public static IUser CurrentUser2;
public static IUser CurrentUser3;
public static Common.AuthorizedAs AuthorizedAs;
public static DateTime LastAuthorization = DateTime.Now;
public static int MinPasswdLength = 0;
public static int PasswdExpirationPeriodDays = 0;
public static string GetCurrentUserName()
{
if (CurrentUser == null || CurrentUser.UserName == null)
return string.Empty;
else if (CurrentUser2 == null || CurrentUser2.UserName == null)
return CurrentUser.UserName;
else if (CurrentUser3 == null || CurrentUser3.UserName == null)
return string.Format("{0},{1}", CurrentUser.UserName, CurrentUser2.UserName);
else
return string.Format("{0},{1},{2}", CurrentUser.UserName, CurrentUser2.UserName, CurrentUser3.UserName);
}
}
}