private async void btnLogin_Click(object sender, RoutedEventArgs e) { try { var custom = new CustomHttpCliente("http://10.0.75.1:15999", new UserLogin { Login = $"{txtUser.Text}@{txtCompany.Text}#user", Password = txtPass.Password, }); _userService = new UserService(new UserEndPoint(custom)); UserLogin.Token = _userService.Authentication(); var userCallback = await _userService.GetInfo(); if (userCallback.IsSuccess) { Home home = new Home(custom, userCallback.Success); this.Visibility = Visibility.Hidden; home.ShowDialog(); this.Visibility = Visibility.Visible; } else { MessageBox.Show($"Falha: {userCallback.Failure.Message}", "Atênção", MessageBoxButton.OK, MessageBoxImage.Warning); } } catch (Exception ex) { // } }
private void InstanceUserService(bool ignoreAuth = false) { _customHttp = new CustomHttpCliente("http://192.168.0.102:15999", new UserLogin { Login = $"{txtUser.Text}@{txtCompany.Text}#user", Password = txtPass.Password, }, ignoreAuth); _userService = new UserService(new UserEndPoint(_customHttp), new CompanyEndPoint(_customHttp)); }
public Home(CustomHttpCliente customHttpCliente, UserBasicInformationViewModel userBasicInformation) { InitializeComponent(); _customHttpCliente = customHttpCliente; InstanceServices(); VerifyPermissionsUser(userBasicInformation); IncludeUserControl(new UserDetailUC(_userService, _userBasicInformation), new EventArgs()); }
public Home(CustomHttpCliente customHttpCliente, UserBasicInformationViewModel userBasicInformation) { InitializeComponent(); _customHttpCliente = customHttpCliente; VerifyPermissionsUser(userBasicInformation); }
public AgentEndPoint(CustomHttpCliente customHttpCliente) : base(customHttpCliente) { }
public CompanyEndPoint(CustomHttpCliente customHttpCliente) : base(customHttpCliente) { }
public ItemsEndPoint(CustomHttpCliente customHttpCliente) : base(customHttpCliente) { }
public SystemServiceEndPoint(CustomHttpCliente customHttpCliente) : base(customHttpCliente) { }
public UserEndPoint(CustomHttpCliente customHttpCliente) : base(customHttpCliente) { }
public AgentInformation(CustomHttpCliente customHttpCliente) : base(customHttpCliente) { }