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)
            {
                //
            }
        }
Пример #2
0
        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));
        }
Пример #3
0
        public Home(CustomHttpCliente customHttpCliente,
                    UserBasicInformationViewModel userBasicInformation)
        {
            InitializeComponent();

            _customHttpCliente = customHttpCliente;

            InstanceServices();

            VerifyPermissionsUser(userBasicInformation);

            IncludeUserControl(new UserDetailUC(_userService, _userBasicInformation), new EventArgs());
        }
Пример #4
0
 public Home(CustomHttpCliente customHttpCliente, UserBasicInformationViewModel userBasicInformation)
 {
     InitializeComponent();
     _customHttpCliente = customHttpCliente;
     VerifyPermissionsUser(userBasicInformation);
 }
Пример #5
0
 public AgentEndPoint(CustomHttpCliente customHttpCliente) : base(customHttpCliente)
 {
 }
Пример #6
0
 public CompanyEndPoint(CustomHttpCliente customHttpCliente) : base(customHttpCliente)
 {
 }
Пример #7
0
 public ItemsEndPoint(CustomHttpCliente customHttpCliente) : base(customHttpCliente)
 {
 }
Пример #8
0
 public SystemServiceEndPoint(CustomHttpCliente customHttpCliente) : base(customHttpCliente)
 {
 }
Пример #9
0
 public UserEndPoint(CustomHttpCliente customHttpCliente) : base(customHttpCliente)
 {
 }
 public AgentInformation(CustomHttpCliente customHttpCliente) : base(customHttpCliente)
 {
 }