Files
infineon_cs_hmi/uniper_hmi/UniperHMI/Common/User.cs

57 lines
964 B
C#

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace InfineonHMI.Common;
public static class Users
{
private static User CurrentUser { get; set; }
public static ObservableCollection<User> UsersCollection { get; set; }
public static void setCurrentUser(User u)
{
CurrentUser = new User(u);
}
public static User getCurrentUser()
{
if (CurrentUser == null)
CurrentUser = new User("undefined", "undef", 0);
return CurrentUser;
}
}
public class User
{
public string? UserName { get; set; }
public string PasswordHash { get; set; }
public int UserLevel { get; set; }
public User()
{
}
public User(User u)
{
UserName = u.UserName;
PasswordHash = u.PasswordHash;
UserLevel = u.UserLevel;
}
public User(string name, string hash, int level)
{
UserName = name;
PasswordHash = hash;
UserLevel = level;
}
}