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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bibtalk/bib-talk/Login.xaml.cs b/bibtalk/bib-talk/Login.xaml.cs
new file mode 100644
index 0000000..8f6feea
--- /dev/null
+++ b/bibtalk/bib-talk/Login.xaml.cs
@@ -0,0 +1,103 @@
+using Newtonsoft.Json;
+using System.Net.Http;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows;
+
+namespace bib_talk
+{
+ public partial class Login : Window
+ {
+ // Field to store logged in user
+ public static string loggedInUser;
+
+ public Login()
+ {
+ InitializeComponent();
+ }
+
+ private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (e.ButtonState == MouseButtonState.Pressed)
+ {
+ DragMove();
+ }
+ }
+
+ private void CloseButton_Click(object sender, RoutedEventArgs e)
+ {
+ this.Close();
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ RegisterWindow register = new RegisterWindow();
+ register.Show();
+ this.Close();
+ }
+
+ private void WeiterButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (usernbox.Text != "" && passwordbox.Password != "")
+ {
+ LoginServer();
+
+ }
+ }
+
+ private void passwordbox_PasswordChanged(object sender, RoutedEventArgs e)
+ {
+ if (usernbox.Text != "" && passwordbox.Password != "")
+ {
+ SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF6332A0"));
+ weiterbutton.Foreground = Brushes.White;
+ weiterbutton.Background = customBrush;
+ }
+ else
+ {
+ SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF323134"));
+ weiterbutton.Foreground = Brushes.Gray;
+ weiterbutton.Background = customBrush;
+ }
+ }
+
+ private void Register_Click(object sender, RoutedEventArgs e)
+ {
+ RegisterWindow register = new RegisterWindow();
+ register.Show();
+ this.Close();
+ }
+
+ public async Task LoginServer()
+ {
+ string username = usernbox.Text;
+ string password = passwordbox.Password;
+ var loginData = new { Username = username, Password = password, Email = "", Birthday = "", IsOnline = ""};
+ string json = JsonConvert.SerializeObject(loginData);
+
+ using (var client = new HttpClient())
+ {
+ var content = new StringContent(json, Encoding.UTF8, "application/json");
+ var response = await client.PostAsync("http://daddypig.dns.navy:5114/api/users/login", content);
+
+ if (response.IsSuccessStatusCode)
+ {
+ var responseContent = await response.Content.ReadAsStringAsync();
+ var responseData = JsonConvert.DeserializeObject(responseContent);
+ string loggedInUsername = responseData.username;
+ MainWindow mainWindow = new MainWindow(loggedInUsername);
+ mainWindow.Show();
+ this.Close();
+ }
+ else
+ {
+ var responseContent = await response.Content.ReadAsStringAsync();
+ MessageBox.Show($"Login failed: {responseContent}");
+ }
+ }
+ }
+
+ }
+}
diff --git a/bibtalk/bib-talk/MainWindow.xaml b/bibtalk/bib-talk/MainWindow.xaml
new file mode 100644
index 0000000..b5f00b3
--- /dev/null
+++ b/bibtalk/bib-talk/MainWindow.xaml
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bibtalk/bib-talk/MainWindow.xaml.cs b/bibtalk/bib-talk/MainWindow.xaml.cs
new file mode 100644
index 0000000..bde5290
--- /dev/null
+++ b/bibtalk/bib-talk/MainWindow.xaml.cs
@@ -0,0 +1,166 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Net.Http;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Threading;
+
+namespace bib_talk
+{
+ public partial class MainWindow : Window
+ {
+ private DispatcherTimer _timer;
+ public string loggedinUser;
+ private bool isFirstLoad = true;
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ InitializeTimer();
+ LoadData();
+ }
+
+ public MainWindow(string user)
+ {
+ loggedinUser = user;
+ InitializeComponent();
+ InitializeTimer();
+ LoadData();
+ LoadMessages();
+ }
+
+ private void InitializeTimer()
+ {
+ _timer = new DispatcherTimer
+ {
+ Interval = TimeSpan.FromSeconds(2)
+ };
+ _timer.Tick += (sender, e) => { LoadMessages(); LoadOnlineUsers(); };
+ _timer.Start();
+ }
+ public void LoadData()
+ {
+ loggedinuser.Text = "Logged in as: " + loggedinUser;
+ }
+
+ private void CloseButton_Click(object sender, RoutedEventArgs e)
+ {
+ LogoutUser();
+ this.Close();
+ }
+
+ private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (e.ButtonState == MouseButtonState.Pressed)
+ {
+ DragMove();
+ }
+ }
+
+ private async void LoadMessages()
+ {
+ using (var client = new HttpClient())
+ {
+ var response = await client.GetAsync("http://daddypig.dns.navy:5114/api/messages/get");
+ if (response.IsSuccessStatusCode)
+ {
+ var responseContent = await response.Content.ReadAsStringAsync();
+ var messages = JsonConvert.DeserializeObject>(responseContent);
+ chatlistbox.ItemsSource = messages;
+ if (chatlistbox.Items.Count > 0)
+ {
+ var lastItem = chatlistbox.Items[chatlistbox.Items.Count - 1];
+ chatlistbox.ScrollIntoView(lastItem);
+ }
+ }
+ }
+ }
+
+ private async void send_Click(object sender, RoutedEventArgs e)
+ {
+ if (!string.IsNullOrEmpty(messageBOX.Text))
+ {
+ var message = new MessageDto
+ {
+ Username = loggedinUser,
+ Message = messageBOX.Text,
+ Timestamp = DateTime.Now,
+ };
+
+ using (var client = new HttpClient())
+ {
+ var json = JsonConvert.SerializeObject(message);
+ var content = new StringContent(json, Encoding.UTF8, "application/json");
+ var response = await client.PostAsync("http://daddypig.dns.navy:5114/api/messages/send", content);
+
+ if (response.IsSuccessStatusCode)
+ {
+ messageBOX.Clear();
+ LoadMessages(); // Reload messages after sending
+ }
+ }
+ }
+ }
+ private async void LogoutUser()
+ {
+ using (var client = new HttpClient())
+ {
+ var logoutData = new { Username = loggedinUser, Password = "", Email = "", Birthday = "", IsOnline = "" };
+ var json = JsonConvert.SerializeObject(logoutData);
+ var content = new StringContent(json, Encoding.UTF8, "application/json");
+
+ var response = await client.PostAsync("http://daddypig.dns.navy:5114/api/users/logout", content);
+
+ var responseContent = await response.Content.ReadAsStringAsync();
+
+ this.Close();
+ }
+ }
+ private async void LoadOnlineUsers()
+ {
+ using (var client = new HttpClient())
+ {
+ var response = await client.GetAsync("http://daddypig.dns.navy:5114/api/users/online-users");
+ if (response.IsSuccessStatusCode)
+ {
+ var responseContent = await response.Content.ReadAsStringAsync();
+ var onlineUsers = JsonConvert.DeserializeObject>(responseContent);
+ onlineUsersListBox.ItemsSource = onlineUsers;
+ }
+ }
+ }
+ }
+
+ public class Message
+ {
+ public int Id { get; set; }
+ public string Username { get; set; }
+ public string Text { get; set; }
+ public DateTime Timestamp { get; set; }
+ }
+
+ public class MessageDto
+ {
+ public string Username { get; set; }
+ public string Message { get; set; }
+ public DateTime Timestamp { get; set; }
+ }
+ public class User
+ {
+ public int Id { get; set; }
+ public string Username { get; set; }
+ public string Password { get; set; }
+ public string Email { get; set; }
+ public string Birthday { get; set; }
+ public string IsOnline { get; set; }
+ }
+
+
+}
diff --git a/bibtalk/bib-talk/RegisterWindow.xaml b/bibtalk/bib-talk/RegisterWindow.xaml
new file mode 100644
index 0000000..edb468f
--- /dev/null
+++ b/bibtalk/bib-talk/RegisterWindow.xaml
@@ -0,0 +1,223 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bibtalk/bib-talk/RegisterWindow.xaml.cs b/bibtalk/bib-talk/RegisterWindow.xaml.cs
new file mode 100644
index 0000000..1abebca
--- /dev/null
+++ b/bibtalk/bib-talk/RegisterWindow.xaml.cs
@@ -0,0 +1,94 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Net.Http;
+using Newtonsoft.Json;
+
+namespace bib_talk
+{
+ public partial class RegisterWindow : Window
+ {
+ public RegisterWindow()
+ {
+ InitializeComponent();
+ }
+
+ private void CloseButton_Click(object sender, RoutedEventArgs e)
+ {
+ this.Close();
+ }
+
+ private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (e.ButtonState == MouseButtonState.Pressed)
+ {
+ DragMove();
+ }
+ }
+ private void Login_Click(object sender, RoutedEventArgs e)
+ {
+ Login login= new Login();
+ login.Show();
+ this.Close();
+ }
+
+ private void WeiterButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (checkboxAGB.IsChecked == true)
+ {
+ RegisterServer();
+ }
+ }
+ private void CheckBox_Checked(object sender, RoutedEventArgs e)
+ {
+ SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF6332A0"));
+ weiterbutton.Foreground = Brushes.White;
+ weiterbutton.Background = customBrush;
+ }
+
+ private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
+ {
+ SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF323134"));
+ weiterbutton.Foreground = Brushes.Gray;
+ weiterbutton.Background= customBrush;
+ }
+
+ public async Task RegisterServer()
+ {
+ string username = usernbox.Text;
+ string password = passwordbox.Password;
+ string email = emailbox.Text;
+ string birthday = bday1.Text+"."+bday2.Text+"."+bday3.Text;
+ var newUser = new { Username = username, Password = password, Email = email, Birthday = birthday, IsOnline = ""};
+ string json = JsonConvert.SerializeObject(newUser);
+
+ using (var client = new HttpClient())
+ {
+ var content = new StringContent(json, Encoding.UTF8, "application/json");
+ var response = await client.PostAsync("http://daddypig.dns.navy:5114/api/users/register", content);
+
+ if (response.IsSuccessStatusCode)
+ {
+ MessageBox.Show("Registration Succesful");
+ }
+ else
+ {
+ MessageBox.Show("Registration failed."+ response);
+ }
+ }
+ }
+ }
+}
diff --git a/bibtalk/bib-talk/bib-talk.csproj b/bibtalk/bib-talk/bib-talk.csproj
new file mode 100644
index 0000000..b24974b
--- /dev/null
+++ b/bibtalk/bib-talk/bib-talk.csproj
@@ -0,0 +1,19 @@
+
+
+
+ WinExe
+ net6.0-windows
+ bib_talk
+ enable
+ true
+
+
+
+
+
+
+
+
+
+
+