Example #1
0
        async Task LoginUser()
        {
            try
            {
                var login = this.txtLogin.Text.Trim();
                var pass  = this.txtPassword.Text.Trim();

                var named       = chkIsLdap.Checked ? "auth-ldap" : "auth-table";
                var authService = ServiceLocator.Create <IAuthService>(named);
                var isUserExist = await authService.IsValidUser(login, pass);//await userService.CheckLoginUser(login, pass);

                if (isUserExist)
                {
                    MainFormService.ShowAppView(
                        await userService.GetUserByLogin(login)
                        );
                }
                else
                {
                    MainFormService.ShowInfo("Не верный логин или пароль!");
                }
            }
            catch (Exception ex)
            {
                MainFormService.ShowError(ex.Message);
            }
        }