namespace TravelAgencyWinForms.Models;

public static class CurrentUser
{
    public static int UserId { get; set; }
    public static string Login { get; set; } = string.Empty;
    public static string Role { get; set; } = string.Empty;
    public static int? ClientId { get; set; }
    public static string ClientName { get; set; } = string.Empty;

    public static bool IsAdmin => string.Equals(Role, "admin", StringComparison.OrdinalIgnoreCase);
    public static bool IsUser => string.Equals(Role, "user", StringComparison.OrdinalIgnoreCase);

    public static void Clear()
    {
        UserId = 0;
        Login = string.Empty;
        Role = string.Empty;
        ClientId = null;
        ClientName = string.Empty;
    }
}
