private void singUpB_Click(object sender, EventArgs e) { IClientRequests clientRequests = (IClientRequests)ServiceProvider.GetService(typeof(IClientRequests)); clientRequests.DatabaseName = SelectDatabaseName; Guid workerId = SingUp(NameW, Login, Password); if (Guid.Empty != workerId) { ((ApplicationState)ServiceProvider.GetService(typeof(ApplicationState))).Worker.Id = workerId; } }
private void singIn_Click(object sender, EventArgs e) { IClientRequests clientRequests = (IClientRequests)ServiceProvider.GetService(typeof(IClientRequests)); clientRequests.DatabaseName = databaseNamesCB.SelectedItem.ToString(); Guid workerId = ((ApplicationState)(ServiceProvider.GetService(typeof(ApplicationState)))).Worker.Id = SingIn(loginTB.Text, passwordTB.Text); if (!workerId.Equals(Guid.Empty)) { Hide(); } }
private void SingUp() { IClientRequests clientRequests = (IClientRequests)ServiceProvider.GetService(typeof(IClientRequests)); clientRequests.DatabaseName = SelectDatabaseName; Guid workerId = Guid.Empty; if (!(string.IsNullOrEmpty(NameW) || string.IsNullOrEmpty(Login) || string.IsNullOrEmpty(Password))) { try { ClientRequests.WorkerIsExist(Login); MessageService.ErrorMessage(Message.MessageResource.ExistWorker); } catch (Exception ex) { workerId = CreateWorker(NameW, Login, Password); MessageService.InfoMessage(Message.MessageResource.SuccessfullRegistration); ((ApplicationState)ServiceProvider.GetService(typeof(ApplicationState))).Worker.Id = workerId; DialogResult = DialogResult.OK; } } else { if (string.IsNullOrEmpty(NameW)) { MessageService.ErrorMessage(Message.MessageResource.EmptyName); } else if (string.IsNullOrEmpty(Login)) { MessageService.ErrorMessage(Message.MessageResource.EmptyLogin); } else if (string.IsNullOrEmpty(Password)) { MessageService.ErrorMessage(Message.MessageResource.EmptyPassword); } } }
public IFolderPropertiesUIPlugin GetFolderPropetiesPlugin(FolderType selectedFolderType) { if (selectedFolderType == null) { throw new ArgumentNullException(nameof(selectedFolderType)); } IFolderPropertiesUIPlugin clientUIPlugin; if (!_existClientPlugin.TryGetValue(selectedFolderType.Id, out clientUIPlugin)) { IClientRequests clientRequests = (IClientRequests)(ServiceProvider.GetService(typeof(IClientRequests))); string typeClientFolderPropertiesUI = clientRequests.GetFolderType(selectedFolderType.Id).TypeClientUI; clientUIPlugin = CreatePlugin <IFolderPropertiesUIPlugin>(typeClientFolderPropertiesUI); _existClientPlugin.Add(selectedFolderType.Id, clientUIPlugin); } return(clientUIPlugin); }
public ILetterPropertiesUIPlugin GetLetterPropetiesPlugin(LetterType selectedLetterType) { if (selectedLetterType == null) { throw new ArgumentNullException(nameof(selectedLetterType)); } ILetterPropertiesUIPlugin clientLetterPropertiesPlugin; if (_currentClientLetterPropertiesPlugin.Key != selectedLetterType.Id) { IClientRequests clientRequests = (IClientRequests)(ServiceProvider.GetService(typeof(IClientRequests))); string typeClientLetterPropertiesUI = clientRequests.GetLetterType(selectedLetterType.Id).TypeClientUI; _currentClientLetterPropertiesPlugin = new KeyValuePair <int, ILetterPropertiesUIPlugin>(selectedLetterType.Id, CreatePlugin <ILetterPropertiesUIPlugin>(typeClientLetterPropertiesUI)); clientLetterPropertiesPlugin = _currentClientLetterPropertiesPlugin.Value; } else { clientLetterPropertiesPlugin = _currentClientLetterPropertiesPlugin.Value; _currentClientLetterPropertiesPlugin = new KeyValuePair <int, ILetterPropertiesUIPlugin>(0, null); } return(clientLetterPropertiesPlugin); }
private void InitializeClientService() { _clientRequests = (IClientRequests)ServiceProvider.GetService(typeof(IClientRequests)); }
private string GetLetterPluginTypeName(int letterTypeId) { IClientRequests clientRequests = (IClientRequests)(ServiceProvider.GetService(typeof(IClientRequests))); return(clientRequests.GetLetterType(letterTypeId).TypeClientUI); }
public MemeCreatorViewModel(IClientApp client, IClientRequests clientRequests) { this.client = client; this.clientRequests = clientRequests; }
public MemeLibraryViewModel(IClientApp client, IClientRequests clientRequests) { this.client = client; this.clientRequests = clientRequests; }
public LoginViewModel(IClientApp client, IClientRequests clientRequests) { this.client = client; this.clientRequests = clientRequests; }
public ClientController(IClientRequests repo) { this.repo = repo; }
public RegisterViewModel(IClientApp client, IClientRequests clientRequests) { this.client = client; this.clientRequests = clientRequests; }