private void Refresh_click(object sender, RoutedEventArgs e) { Mouse.OverrideCursor = Cursors.Wait; var settings = settingsService.GetSettings(); settingsService.CleatAuthInformation(); var authCookie = barboraService.Login(settings.Username, settings.Password); settingsService.UpdateAuthInformation(settings.Username, settings.Password, authCookie); Mouse.OverrideCursor = Cursors.Arrow; }
private void LoginButtonClick(object sender, RoutedEventArgs e) { Mouse.OverrideCursor = Cursors.Wait; var barboraService = new BarboraService(); var settingsService = new SettingsService(); try { var email = textBoxEmail.Text; var authCookie = barboraService.Login(textBoxEmail.Text, passwordBox.Password); settingsService.UpdateAuthInformation(textBoxEmail.Text, passwordBox.Password, authCookie); var mainWindow = new MainWindow(); mainWindow.Show(); this.Close(); } catch (Exception ex) { errormessage.Text = ex.Message; } Mouse.OverrideCursor = Cursors.Arrow; }