diff --git a/LuminousSales/Business/Business/UserManagment/CredentialChecker.cs b/LuminousSales/Business/Business/UserManagment/CredentialChecker.cs new file mode 100644 index 0000000..969f785 --- /dev/null +++ b/LuminousSales/Business/Business/UserManagment/CredentialChecker.cs @@ -0,0 +1,36 @@ +using Models; +using Models.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Business.Business.UserManagment +{ + public class CredentialChecker + { + private LuminousContext context; + public bool CheckIfUserIsCreated() + { + using (context = new LuminousContext()) + { + if (context.User.ToList().Any()) + { + return true; + } + return false; + } + } + public bool CheckPassword(string Password) + { + using (context = new LuminousContext()) + { + if (context.User.ToList().Exists(user => user.Password == Password)) + { + return true; + } + return false; + } + } + } +}