private async void LoginButton_Click(object sender, EventArgs e) { try { if (UsernameTextBox.TextLength > 0 && PasswordTextBox.TextLength > 0) { var APIService = new APIService(); await APIService.Login(UsernameTextBox.Text, PasswordTextBox.Text); Hide(); Main.Movieseek MovieseekForm = new Main.Movieseek(); MovieseekForm.Show(); } } catch (Exception error) { ErrorLabel.Text = error.Message; } }
private async void CreateButton_Click(object sender, EventArgs e) { try { // validate if all fields are written if (FirstNameTextBox.TextLength > 0 && LastNameTextBox.TextLength > 0 && UsernameTextBox.TextLength > 0 && PasswordTextBox.TextLength > 0) { var APIService = new APIService(); await APIService.Register(FirstNameTextBox.Text, LastNameTextBox.Text, UsernameTextBox.Text, PasswordTextBox.Text); Hide(); Main.Movieseek MovieseekForm = new Main.Movieseek(); MovieseekForm.Show(); } } catch (Exception error) { ErrorLabel.Text = error.Message; } }