You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Model.Managers
|
|
{
|
|
public class MasterManager
|
|
{
|
|
public static User? CurrentConnectedUser;
|
|
public static RecipeCollection? Recipes;
|
|
public static List<User>? Users;
|
|
|
|
public DataManager DataMgr { get; private set; }
|
|
|
|
public MasterManager(IDataManager dataManager)
|
|
{
|
|
DataMgr = new DataManager(dataManager);
|
|
Recipes = DataMgr.GetRecipes("all recipes");
|
|
Users = DataMgr.GetUsers();
|
|
CurrentConnectedUser = null;
|
|
}
|
|
|
|
public bool LogIn(string mail, string password)
|
|
{
|
|
if (Users is null)
|
|
throw new ArgumentNullException();
|
|
|
|
User user = (User)(from u in Users
|
|
where u.Mail == mail
|
|
select u);
|
|
}
|
|
}
|
|
}
|