diff --git a/src/BreCalClient/App.xaml b/src/BreCalClient/App.xaml
index a6b8309..e6f282b 100644
--- a/src/BreCalClient/App.xaml
+++ b/src/BreCalClient/App.xaml
@@ -4,6 +4,13 @@
xmlns:local="clr-namespace:BreCalClient"
StartupUri="MainWindow.xaml">
-
+
+
+
+
+
+
+
+
diff --git a/src/BreCalClient/BreCalClient.csproj b/src/BreCalClient/BreCalClient.csproj
index 4106cb0..d1b19be 100644
--- a/src/BreCalClient/BreCalClient.csproj
+++ b/src/BreCalClient/BreCalClient.csproj
@@ -7,4 +7,37 @@
true
+
+
+
+
+
+
+
+ True
+ True
+ BreCalApi.yaml
+
+
+
+
+
+ OpenApiCodeGenerator
+ BreCalApi.cs
+
+
+ MSBuild:Compile
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BreCalClient/MainWindow.xaml b/src/BreCalClient/MainWindow.xaml
index 8e6416d..5a8c2f0 100644
--- a/src/BreCalClient/MainWindow.xaml
+++ b/src/BreCalClient/MainWindow.xaml
@@ -3,10 +3,42 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:BreCalClient"
+ xmlns:local="clr-namespace:BreCalClient"
+ xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="800">
-
+ Title="{DynamicResource textApplicationTitle}" Height="450" Width="800" Loaded="Window_Loaded">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs
index 4f86337..c496015 100644
--- a/src/BreCalClient/MainWindow.xaml.cs
+++ b/src/BreCalClient/MainWindow.xaml.cs
@@ -13,16 +13,64 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using BreCalClient.misc.Api;
+using BreCalClient.misc.Client;
+using BreCalClient.misc.Model;
+
namespace BreCalClient
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
- {
+ {
+ DefaultApi _api;
public MainWindow()
{
InitializeComponent();
+ _api = new DefaultApi();
+ }
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+
+ }
+
+ private async void buttonLogin_Click(object sender, RoutedEventArgs e)
+ {
+ if (string.IsNullOrEmpty(this.textPassword.Password) || string.IsNullOrEmpty(this.textUsername.Text))
+ {
+ this.labelLoginResult.Content = Application.Current.FindResource("textUserNamePasswordEmpty").ToString();
+ return;
+ }
+
+ Credentials credentials = new(username: textUsername.Text.Trim(),
+ password: textPassword.Password.Trim());
+
+ try
+ {
+ LoginResult loginResult = await _api.LoginPostAsync(credentials);
+ if(loginResult != null)
+ {
+ if(loginResult.Id > 0)
+ {
+ this.busyIndicator.IsBusy = false;
+ }
+ }
+ }
+ catch (ApiException ex)
+ {
+ this.labelLoginResult.Content = ex.Message;
+ }
+ catch(Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ }
+
+ private void buttonExit_Click(object sender, RoutedEventArgs e)
+ {
+ this.Close();
}
}
}
diff --git a/src/BreCalClient/Resources/StringResources.de.xaml b/src/BreCalClient/Resources/StringResources.de.xaml
new file mode 100644
index 0000000..03ed42a
--- /dev/null
+++ b/src/BreCalClient/Resources/StringResources.de.xaml
@@ -0,0 +1,10 @@
+
+ Benutzer Anmeldung
+ Benutzername
+ Passwort
+ Anmelden
+ Abbrechen
+ Benutzername / Password leer!
+
\ No newline at end of file
diff --git a/src/BreCalClient/Resources/StringResources.xaml b/src/BreCalClient/Resources/StringResources.xaml
new file mode 100644
index 0000000..91d9b0c
--- /dev/null
+++ b/src/BreCalClient/Resources/StringResources.xaml
@@ -0,0 +1,11 @@
+
+ User login
+ Username
+ Password
+ Login
+ Exit
+ Bremen calling
+ Username and/or password empty!
+
\ No newline at end of file