Example #1
0
        private async void btnSubmit_Click(object sender, EventArgs e)
        {
            string email = this.txtEmail.Text;
            string password = this.txtPassword.Text;

            User user = null;

            WaitWindow wait = new WaitWindow();
            wait.Owner = this;
            wait.StartPosition = FormStartPosition.CenterParent;
            wait.Show();

            user = await Task.Factory.StartNew<User>(
                new Func<User>(()=>UsersDAL.GetUserByCredentials(email, password))
            );
            
            //user = UsersDAL.GetUserByCredentials(email, password);
            
            wait.Close();
            AuthenticateUser(user);
        }
Example #2
0
        private async void btnSubmit_Click(object sender, EventArgs e)
        {
            string email    = this.txtEmail.Text;
            string password = this.txtPassword.Text;

            User user = null;

            WaitWindow wait = new WaitWindow();

            wait.Owner         = this;
            wait.StartPosition = FormStartPosition.CenterParent;
            wait.Show();

            user = await Task.Factory.StartNew <User>(
                new Func <User>(() => UsersDAL.GetUserByCredentials(email, password))
                );

            //user = UsersDAL.GetUserByCredentials(email, password);

            wait.Close();
            AuthenticateUser(user);
        }