Push Changes from Techcrafters Repo
This commit is contained in:
57
uniper_hmi/UniperHMI/Common/User.cs
Normal file
57
uniper_hmi/UniperHMI/Common/User.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user