using OOO_WriteAndClear.DBModels; using OOO_WriteAndClear.MVP.Models; using OOO_WriteAndClear.MVP.MVPInterfaces; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OOO_WriteAndClear.MVP.Presenters { class AuthorizationUserControlPresenter : IAuthorizationContract.IPresenter { public AuthorizationUserControlPresenter(IAuthorizationContract.IView view) { _view = view; _model = new AuthorizationUserControlModel(); } public void CheckTheUser(string login, string password) { User? userID; userID = _model.AuthorizationUserInSystem(login, password); if(userID is null) { _view.ShowFailureAuthorizeMessage(); return; } _view.LetInAuthorizedUser(userID); } private readonly IAuthorizationContract.IView _view; private readonly IAuthorizationContract.IModel _model; } }