From 12474f99be25460f4f909b5e2ff585039d1f7699 Mon Sep 17 00:00:00 2001 From: Marcus Date: Mon, 28 Jul 2025 08:20:11 +0200 Subject: [PATCH] Neues Gitea --- ZKuP/AddCardUser.xaml | 30 +- ZKuP/AddCardUser.xaml.cs | 96 +- ZKuP/AddFirmenList.xaml | 24 + ZKuP/AddFirmenList.xaml.cs | 287 ++++ ZKuP/AddVisitorsList.xaml | 12 +- ZKuP/AddVisitorsList.xaml.cs | 235 ++- ZKuP/App.xaml | 9 + ZKuP/App.xaml.cs | 73 +- ZKuP/ApproveFzg.xaml | 124 ++ ZKuP/ApproveFzg.xaml.cs | 156 ++ ZKuP/Arrivals.xaml | 377 ++-- ZKuP/Arrivals.xaml.cs | 776 +++++++-- ZKuP/ArrivalsOverview.xaml | 11 +- ZKuP/ArrivalsOverview.xaml.cs | 18 +- ZKuP/AspInfo.xaml | 18 +- ZKuP/AspInfo.xaml.cs | 22 +- ZKuP/Assets/BE01 - ICE-West_Containerburg.png | Bin 0 -> 835918 bytes .../BE02 - ICE-West_MaWi_Gleisabstellung.png | Bin 0 -> 810147 bytes .../BE04 - Aufgang Friedenheimer-Brücke.png | Bin 0 -> 891423 bytes .../BE06 - Lokhalle Gleisbereich Süd-Ost.png | Bin 0 -> 549370 bytes ZKuP/Assets/BE08 - Schichtparkplatz.png | Bin 0 -> 825012 bytes ZKuP/Assets/BE09 - Lager H.png | Bin 0 -> 420081 bytes ZKuP/Assets/BE1.png | Bin 943267 -> 0 bytes ZKuP/Assets/BE10 - Gebäude G.png | Bin 0 -> 335416 bytes ZKuP/Assets/BE10.png | Bin 953260 -> 0 bytes ZKuP/Assets/BE11 - Gaslager.png | Bin 0 -> 619264 bytes ZKuP/Assets/BE11.png | Bin 681229 -> 0 bytes ZKuP/Assets/BE12 - Feuerwehrzufahrt Süd N.png | Bin 0 -> 796979 bytes ZKuP/Assets/BE12.png | Bin 913234 -> 0 bytes ZKuP/Assets/BE13 - Feuerwehrzufahrt Süd S.png | Bin 0 -> 811979 bytes ZKuP/Assets/BE13.png | Bin 930397 -> 0 bytes ZKuP/Assets/BE2.png | Bin 913533 -> 0 bytes ZKuP/Assets/BE4.png | Bin 1010987 -> 0 bytes ZKuP/Assets/BE6.png | Bin 586481 -> 0 bytes ZKuP/Assets/BE8.png | Bin 889357 -> 0 bytes ZKuP/Assets/BE9.png | Bin 823277 -> 0 bytes ZKuP/Assets/Parkplatz/06.png | Bin 410866 -> 383679 bytes ZKuP/Assets/Parkplatz/07.png | Bin 465522 -> 422161 bytes ZKuP/Assets/Parkplatz/34.png | Bin 458457 -> 412685 bytes ZKuP/AusgegebeneParkausweise.xaml | 36 + ZKuP/AusgegebeneParkausweise.xaml.cs | 89 + ZKuP/BEImage.xaml | 25 +- ZKuP/BEImage.xaml.cs | 86 +- ZKuP/Belegung.xaml | 472 ++--- ZKuP/Belegung.xaml.cs | 1059 ++++++++---- ZKuP/Belegung2.xaml | 331 ---- ZKuP/Belegung2.xaml.cs | 357 ---- ZKuP/COMSelector.xaml | 17 + ZKuP/COMSelector.xaml.cs | 60 + ZKuP/Cards.xaml | 37 +- ZKuP/Cards.xaml.cs | 204 ++- ZKuP/CheckKennzeichen.xaml | 7 +- ZKuP/CheckKennzeichen.xaml.cs | 17 +- ZKuP/CheckParkausweis.xaml | 7 +- ZKuP/CheckParkausweis.xaml.cs | 21 +- ZKuP/CreateFirma.xaml | 153 +- ZKuP/CreateFirma.xaml.cs | 1165 +++++++++++-- ZKuP/CreateMcFitUser.xaml | 7 +- ZKuP/CreateMcFitUser.xaml.cs | 31 +- ZKuP/CreateParkEmailUser.xaml | 7 +- ZKuP/CreateParkEmailUser.xaml.cs | 17 +- ZKuP/CreateParkausweis.xaml | 9 +- ZKuP/CreateParkausweis.xaml.cs | 81 +- ZKuP/CreateVisitor.xaml | 7 +- ZKuP/CreateVisitor.xaml.cs | 17 +- ZKuP/CreateVisitor_List.xaml | 7 +- ZKuP/CreateVisitor_List.xaml.cs | 58 +- ZKuP/Delivery.xaml | 78 +- ZKuP/Delivery.xaml.cs | 471 ++++- ZKuP/Family.xaml | 8 +- ZKuP/Family.xaml.cs | 17 +- ZKuP/FamilyBooking.xaml | 5 +- ZKuP/FamilyBooking.xaml.cs | 37 +- ZKuP/FileHandler.cs | 55 + ZKuP/GrantParkausweis.xaml | 7 +- ZKuP/GrantParkausweis.xaml.cs | 25 +- ZKuP/Helper.cs | 732 +++++++- ZKuP/ImageView.xaml | 13 +- ZKuP/ImageView.xaml.cs | 80 +- ZKuP/KartenTausch.xaml | 7 +- ZKuP/KartenTausch.xaml.cs | 53 +- ZKuP/Log.cs | 75 +- ZKuP/MainWindow.xaml | 860 ++++++---- ZKuP/MainWindow.xaml.cs | 1517 ++++++++++++----- ZKuP/ManageAsp.xaml | 18 +- ZKuP/ManageAsp.xaml.cs | 140 +- ZKuP/ManageDeliveries.xaml | 7 +- ZKuP/ManageDeliveries.xaml.cs | 87 +- ZKuP/ManageEntstoerdienste.xaml | 35 + ZKuP/ManageEntstoerdienste.xaml.cs | 252 +++ ZKuP/ManageParkausweis.xaml | 12 +- ZKuP/ManageParkausweis.xaml.cs | 52 +- ZKuP/ManageUsers.xaml | 30 +- ZKuP/ManageUsers.xaml.cs | 111 +- ZKuP/ManageVisitor.xaml | 28 +- ZKuP/ManageVisitor.xaml.cs | 155 +- ZKuP/MySqlConnectionChecker.cs | 102 ++ ZKuP/Notifications.xaml | 6 +- ZKuP/Notifications.xaml.cs | 23 +- ZKuP/ParkausweisDisclaimer.xaml | 7 +- ZKuP/ParkausweisDisclaimer.xaml.cs | 5 +- ZKuP/PrintParkausweis.xaml | 7 +- ZKuP/PrintParkausweis.xaml.cs | 24 +- ZKuP/Properties/AssemblyInfo.cs | 6 +- ZKuP/Properties/app.manifest | 6 +- ZKuP/Resources/Loading.gif | Bin 0 -> 426661 bytes ZKuP/Resources/Moon.png | Bin 2075 -> 4862 bytes ZKuP/Resources/Sun.png | Bin 2436 -> 5028 bytes ZKuP/Resources/mcfit.png | Bin 20476 -> 19209 bytes ZKuP/SQL.cs | 406 ++++- ZKuP/SetHinweis.xaml | 9 +- ZKuP/SetHinweis.xaml.cs | 5 +- ZKuP/Settings.cs | 177 ++ ZKuP/Signature.xaml | 7 +- ZKuP/Signature.xaml.cs | 23 +- ZKuP/XMessageBox.xaml | 5 +- ZKuP/XMessageBox.xaml.cs | 14 +- ZKuP/XMessageBoxFahrzeugAnzahl.xaml | 43 + ZKuP/XMessageBoxFahrzeugAnzahl.xaml.cs | 143 ++ ZKuP/ZKuP.csproj | 129 +- ZKuP/signoPad.cs | 16 +- ZKuPProject.sln | 4 +- 122 files changed, 9523 insertions(+), 3263 deletions(-) create mode 100644 ZKuP/AddFirmenList.xaml create mode 100644 ZKuP/AddFirmenList.xaml.cs create mode 100644 ZKuP/ApproveFzg.xaml create mode 100644 ZKuP/ApproveFzg.xaml.cs create mode 100644 ZKuP/Assets/BE01 - ICE-West_Containerburg.png create mode 100644 ZKuP/Assets/BE02 - ICE-West_MaWi_Gleisabstellung.png create mode 100644 ZKuP/Assets/BE04 - Aufgang Friedenheimer-Brücke.png create mode 100644 ZKuP/Assets/BE06 - Lokhalle Gleisbereich Süd-Ost.png create mode 100644 ZKuP/Assets/BE08 - Schichtparkplatz.png create mode 100644 ZKuP/Assets/BE09 - Lager H.png delete mode 100644 ZKuP/Assets/BE1.png create mode 100644 ZKuP/Assets/BE10 - Gebäude G.png delete mode 100644 ZKuP/Assets/BE10.png create mode 100644 ZKuP/Assets/BE11 - Gaslager.png delete mode 100644 ZKuP/Assets/BE11.png create mode 100644 ZKuP/Assets/BE12 - Feuerwehrzufahrt Süd N.png delete mode 100644 ZKuP/Assets/BE12.png create mode 100644 ZKuP/Assets/BE13 - Feuerwehrzufahrt Süd S.png delete mode 100644 ZKuP/Assets/BE13.png delete mode 100644 ZKuP/Assets/BE2.png delete mode 100644 ZKuP/Assets/BE4.png delete mode 100644 ZKuP/Assets/BE6.png delete mode 100644 ZKuP/Assets/BE8.png delete mode 100644 ZKuP/Assets/BE9.png create mode 100644 ZKuP/AusgegebeneParkausweise.xaml create mode 100644 ZKuP/AusgegebeneParkausweise.xaml.cs delete mode 100644 ZKuP/Belegung2.xaml delete mode 100644 ZKuP/Belegung2.xaml.cs create mode 100644 ZKuP/COMSelector.xaml create mode 100644 ZKuP/COMSelector.xaml.cs create mode 100644 ZKuP/FileHandler.cs create mode 100644 ZKuP/ManageEntstoerdienste.xaml create mode 100644 ZKuP/ManageEntstoerdienste.xaml.cs create mode 100644 ZKuP/MySqlConnectionChecker.cs create mode 100644 ZKuP/Resources/Loading.gif create mode 100644 ZKuP/Settings.cs create mode 100644 ZKuP/XMessageBoxFahrzeugAnzahl.xaml create mode 100644 ZKuP/XMessageBoxFahrzeugAnzahl.xaml.cs diff --git a/ZKuP/AddCardUser.xaml b/ZKuP/AddCardUser.xaml index 1c65db6..5f9490c 100644 --- a/ZKuP/AddCardUser.xaml +++ b/ZKuP/AddCardUser.xaml @@ -1,27 +1,35 @@ - + Title="Kartenbenutzer" MinHeight="450" Height="450" Width="594" Loaded="Window_Loaded" LocationChanged="Window_LocationChanged"> - + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - + + + + + @@ -84,7 +93,7 @@ - + + + + + @@ -375,9 +412,17 @@ - - - - - + + + + + - - - - + - - - + @@ -405,7 +399,7 @@ - + @@ -415,216 +409,229 @@ - - - - - - - + + + diff --git a/ZKuP/MainWindow.xaml.cs b/ZKuP/MainWindow.xaml.cs index 57233e3..9b9dd7b 100644 --- a/ZKuP/MainWindow.xaml.cs +++ b/ZKuP/MainWindow.xaml.cs @@ -1,39 +1,33 @@ -using Renci.SshNet.Messages; +using ColorHelper; +using ControlzEx.Standard; +using FuzzySharp; +using MahApps.Metro.Controls; +using Microsoft.Toolkit.Uwp.Notifications; +using MySql.Data.MySqlClient; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; +using System.Diagnostics; using System.DirectoryServices.AccountManagement; using System.IO; using System.Linq; using System.Runtime.CompilerServices; -using System.Security.Permissions; using System.Security.Principal; using System.Text; +using System.Text.RegularExpressions; using System.Threading; 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.Interop; using System.Windows.Media; using System.Windows.Media.Imaging; -using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Threading; -using MahApps.Metro.Controls; -using Microsoft.Toolkit.Uwp.Notifications; -using System.Diagnostics; -using MySql.Data.MySqlClient; -using System.Xml.Linq; -using FuzzySharp; +using Windows.UI.Composition; using Process = System.Diagnostics.Process; -using System.Collections; -using System.Diagnostics.Eventing.Reader; -using ColorHelper; -using System.Text.RegularExpressions; -using Windows.Devices.PointOfService; namespace ZKuP { @@ -49,12 +43,15 @@ namespace ZKuP PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } - + public const string Version = "5.0.5.8"; public static Roles LoggedInRole { get; private set; } = Roles.None; -#if !DEBUG + + +//#warning No Release, Tabellen vertauscht +#if DEBUG + public static string table { get; } = "zkupTestEnv";// +#elif !DEBUG public static string table { get; } = "zkup"; -#elif DEBUG - public static string table { get; } = "zkupTestEnv"; #endif public string NoToolTip { get; } = "Doppelklick um Ankunft zu Bestätigen"; @@ -72,6 +69,14 @@ namespace ZKuP set { parkEmailUsers = value; OnPropertyChanged(); } } + private DataTable fzgAnmeldungEmailUsers = new DataTable("FzgAnmeldungEmailUsers"); + public DataTable FzgAnmeldungEmailUsers + { + get { return fzgAnmeldungEmailUsers; } + set { fzgAnmeldungEmailUsers = value; OnPropertyChanged(); } + } + + DataTable overv = new DataTable("Overview"); DataTable todayFirm = new DataTable("TodayFirm"); @@ -83,25 +88,35 @@ namespace ZKuP DispatcherTimer reloadTimerHinweis = new DispatcherTimer(); DispatcherTimer checkUpdateTimer = new DispatcherTimer(); DispatcherTimer connTimer = new DispatcherTimer(); + DispatcherTimer ausfahrtTimer = new DispatcherTimer(); RoutedCommand resetWindow; RoutedCommand skullWindow; int maxBikes = 24; - + bool ReadyToSavePosition = false; public MainWindow() { InitializeComponent(); + Startup(); + } + + private async void Startup() + { AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal); - //this.WindowState = WindowState.Normal; + await CheckConnection(true); - cbShowParkcardToAccept.IsChecked = Properties.Settings.Default.ShowParkcardAccept; + cbShowParkcardToAccept.IsChecked = Settings.GetSettingBool("ShowParkcardAccept"); - if ((Properties.Settings.Default.Width + Properties.Settings.Default.Left) >= System.Windows.SystemParameters.PrimaryScreenWidth) CenterWindowOnScreen(this); - if ((Properties.Settings.Default.Height + Properties.Settings.Default.Top) >= System.Windows.SystemParameters.PrimaryScreenHeight) CenterWindowOnScreen(this); + lblVersion.Text = "Version " + Version; + + + + //if ((Settings.GetSettingDouble("Width") + Settings.GetSettingDouble("Left")) >= System.Windows.SystemParameters.PrimaryScreenWidth) CenterWindowOnScreen(this); + //if ((Settings.GetSettingDouble("Height") + Settings.GetSettingDouble("Top")) >= System.Windows.SystemParameters.PrimaryScreenHeight) CenterWindowOnScreen(this); if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\ZKuPUpdater.exe") || File.GetLastWriteTime(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\ZKuPUpdater.exe") != File.GetLastWriteTime(@"\\mhb00swfs003v.fv-werke.db.de\GLW99\ZKuP\ZKuPUpdater.exe")) { @@ -115,7 +130,9 @@ namespace ZKuP CheckWorkingDir(); CheckVersion(); - CheckConnection(); + CheckMaintenance(); + CheckNotification(); + resetWindow = new RoutedCommand(); resetWindow.InputGestures.Add(new KeyGesture(Key.R, ModifierKeys.Control)); @@ -144,7 +161,7 @@ namespace ZKuP try { var newVersion = new Version(File.ReadAllText(@"\\mhb00swfs003v.fv-werke.db.de\GLW99\ZKuP\Version.txt")); - var oldVersion = new Version(lblVersion.Text.Split(' ')[1]); + var oldVersion = new Version(Version); var result = newVersion.CompareTo(oldVersion); if (result >= 1) @@ -192,7 +209,7 @@ namespace ZKuP private void CheckForNewVersion() { var newVersion = new Version(File.ReadAllText(@"\\mhb00swfs003v.fv-werke.db.de\GLW99\ZKuP\Version.txt")); - var oldVersion = new Version(lblVersion.Text.Split(' ')[1]); + var oldVersion = new Version(Version); var result = newVersion.CompareTo(oldVersion); if (result >= 1) @@ -220,26 +237,117 @@ namespace ZKuP return; } } - else updateAlreadyAsked = true; + else updateAlreadyAsked = true; + } } - } + + + private void CheckNotification() + { + if (LoggedInRole != Roles.None) + { + var path = @"\\mhb00swfs003v.fv-werke.db.de\GLW99\ZKuP\Notification.txt"; + + var text = File.ReadAllText(path).Split('|')[0]; + + bool repeat = false; + if (text.EndsWith("|true")) repeat = true; + + if (text.Length > 0) + { + if (!Settings.GetSettingBool("HinweisShown")) MessageBox.Show(text, "Hinweis", MessageBoxButton.OK, MessageBoxImage.Stop); + if (!repeat) Settings.WriteSetting("HinweisShown", true); + } + else Settings.WriteSetting("HinweisShown", false); + } + } + + private void CheckMaintenance() + { + var path = @"\\mhb00swfs003v.fv-werke.db.de\GLW99\ZKuP\Maintenance.txt"; + + var text = File.ReadAllText(path); + if (text.Length > 0) + { + MessageBox.Show(text + "\n\nDie Anwendung wird jetzt wieder geschlossen!", "Wartungsarbeiten", MessageBoxButton.OK, MessageBoxImage.Stop); + Application.Current.Shutdown(); + } + } + private async void Window_Loaded(object sender, RoutedEventArgs e) { await Task.Run(() => AuthenticateUser()); +//#if !DEBUG + Helper.CheckIfMultipleInstances(); +//#endif + double maxheight = this.ActualHeight - 120 - 191; double actualheight = this.ActualHeight - 120 - gridBackground.RowDefinitions[1].Height.Value; if (actualheight <= 191) gridBackground.RowDefinitions[1].Height = new GridLength(maxheight); //gridSpinner.Visibility = Visibility.Collapsed; + Helper.width = this.MinWidth; + Helper.height = this.MinHeight; + connTimer.Interval = TimeSpan.FromSeconds(2); connTimer.Tick += ConnTimer_Tick; connTimer.Start(); + + Helper.CheckScale(this); + Helper.CheckWindowIsInScreenSpace(this); + } + #region Check if Window was moved and released + private const int WM_ENTERSIZEMOVE = 0x0231; + private const int WM_EXITSIZEMOVE = 0x0232; + + private Point _startPosition; + private Size _startSize; + + + protected override void OnSourceInitialized(EventArgs e) + { + base.OnSourceInitialized(e); + HwndSource source = (HwndSource)PresentationSource.FromVisual(this); + source.AddHook(WndProc); + } + + private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) + { + switch (msg) + { + case WM_ENTERSIZEMOVE: + _startPosition = new Point(Left, Top); + _startSize = new Size(Width, Height); + break; + + case WM_EXITSIZEMOVE: + bool sizeChanged = Width != _startSize.Width || Height != _startSize.Height; + bool positionChanged = Left != _startPosition.X || Top != _startPosition.Y; + + if (positionChanged && !sizeChanged) + { + OnWindowMoveFinished(); + } + break; + } + + return IntPtr.Zero; + } + + private void OnWindowMoveFinished() + { + Helper.CheckScale(this); + } + #endregion + + + private async void AuthenticateUser() { if (!SQL.CheckDeviceConnection()) @@ -270,7 +378,7 @@ namespace ZKuP await Dispatcher.BeginInvoke(new Action(() => pgLoad.Value = 15)); auth = await SQL.ReadSingleValueAsync($"SELECT EXISTS(SELECT * FROM {MainWindow.table}.users WHERE `Username` = '{Environment.UserName}')"); - await Dispatcher.BeginInvoke(new Action(() => SQL.WriteSQL($"REPLACE INTO {MainWindow.table}.apptracker (Username, Version, LastLogin) VALUES ('{Environment.UserName}', '{lblVersion.Text.Split(' ')[1]}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}')"))); + await Dispatcher.BeginInvoke(new Action(() => SQL.WriteSQL($"REPLACE INTO {MainWindow.table}.apptracker (Username, Version, LastLogin) VALUES ('{Environment.UserName}', '{Version}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}')"))); await Dispatcher.BeginInvoke(new Action(() => pgLoad.Value = 20)); @@ -284,7 +392,7 @@ namespace ZKuP //CheckVersion(); await Dispatcher.BeginInvoke(new Action(() => { - var res = MessageBox.Show($"Ihr User {Environment.UserName} ist nicht zum Zugriff berechtigt\n\nMöchten Sie einen Besucher erstellen, eine Parkkarte beantragen oder eine Werksführung buchen?", "Zugriff verweigert", MessageBoxButton.YesNo, MessageBoxImage.Warning); + var res = MessageBox.Show($"Ihr User {Helper.InsertSpaceBeforeUpperCase(Environment.UserName)} ist nicht zum Zugriff berechtigt\n\nMöchten Sie einen Parkausweis beantragen, einen McFit User erstellen oder eine Werksführung buchen?", "Zugriff verweigert", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (res == MessageBoxResult.Yes) { @@ -325,34 +433,22 @@ namespace ZKuP case "5": OrganisatorStart(); break; + case "6": + M2_AMStart(); + break; default: BesucherCreateStart(); break; } + + this.Title = "ZKuP - " + Version + "\tRolle: " + LoggedInRole.ToString().Replace("_", " "); + })); - var beInfos = await SQL.ReadListStringTwoColumns($"SELECT flaeche, bereich FROM {MainWindow.table}.`be-belegung`"); - await Dispatcher.BeginInvoke(new Action(() => + //var beInfos = await SQL.ReadListStringTwoColumns($"SELECT flaeche, bereich FROM {MainWindow.table}.`be-belegung`"); + await Dispatcher.BeginInvoke(new Action(async () => { - //foreach (TextBlock tb in Helper.FindVisualChildren(BE).Where(p => p.Tag != null)) - //{ - // if (tb.Tag.ToString() != "0") - // { - // StackPanel sp = new StackPanel(); - - // string ort = beInfos.Where(p => p.StartsWith(tb.Tag.ToString())).First().Split(';')[1]; - - // var img = new BitmapImage(new Uri(@"pack://application:,,,/" - // + System.Reflection.Assembly.GetExecutingAssembly().GetName().Name - // + ";component/" - // + $"Assets/BE{tb.Tag.ToString()}.png", UriKind.Absolute)); - - // sp.Children.Add(new TextBlock() { Text = $"BE-Fläche {tb.Tag.ToString()} - {ort}", FontWeight = FontWeights.Bold }); - // sp.Children.Add(new Image() { Source = img, Width = img.Width / 1.5, Height = img.Height / 1.5 }); - - // tb.ToolTip = sp; - // } - //} + var ausgegebenAn = await SQL.ReadDictionary2($"SELECT p.parkplatznr, f.Name FROM {MainWindow.table}.parkplaetze p LEFT JOIN {MainWindow.table}.firmen f ON f.idFirmen = p.firma", 0, 1); foreach (TextBlock tb in Helper.FindVisualChildren(BE))//.Where(p => p.Tag == null)) { @@ -369,7 +465,14 @@ namespace ZKuP sp.Children.Add(new TextBlock() { Text = $"Parkplatz {tb.Text.PadLeft(2,'0')}", FontWeight = FontWeights.Bold }); sp.Children.Add(new Image() { Source = img, Width = img.Width, Height = img.Height }); + + var x = ausgegebenAn.TryGetValue(parkplatz, out string y); + if (ausgegebenAn.ContainsKey(parkplatz) && x && !string.IsNullOrWhiteSpace(y)) + sp.Children.Add(new TextBlock() { Text = $"Ausgegeben an {y}" }); + tb.ToolTip = sp; + ToolTipService.SetInitialShowDelay(tb, 100); + ToolTipService.SetBetweenShowDelay(tb, 100); } } })); @@ -410,7 +513,35 @@ namespace ZKuP dgOverview.Items.SortDescriptions.Add(new SortDescription("Zutritt", ListSortDirection.Descending)); dgOverview.Items.Refresh(); - gridSpinner.Visibility = Visibility.Collapsed; + //var gif = XamlAnimatedGif.AnimationBehavior.GetAnimator(imgLoading); + //if (gif != null) + //{ + // gif.Pause(); + //} + //imgLoading.Visibility = Visibility.Collapsed; + + this.Height = Settings.GetSettingDouble("Height"); + this.Width = Settings.GetSettingDouble("Width"); + this.Left = Settings.GetSettingDouble("Left"); + this.Top = Settings.GetSettingDouble("Top"); + + var ws = Settings.GetSetting("WindowState"); + this.WindowState = ws == "" ? WindowState.Normal : (WindowState)ws; + + //double ratio = Settings.GetSettingDouble("ColumnRatio"); + + // Gespeicherte Werte laden + double col1Width = Settings.GetSettingDouble("LeftColumn"); + double col2Width = Settings.GetSettingDouble("RightColumn"); + + // Column-Breiten setzen + gridToday.ColumnDefinitions[0].Width = new GridLength(col1Width, GridUnitType.Star); + gridToday.ColumnDefinitions[2].Width = new GridLength(col2Width, GridUnitType.Star); + // Index 1 ist der GridSplitter mit Auto-Breite + + + ReadyToSavePosition = true; + gridSpinner.Visibility = Visibility.Hidden; @@ -418,9 +549,9 @@ namespace ZKuP reloadTimer.Tick += ReloadTimer_Tick; reloadTimer.Start(); - reloadTimerHinweis.Interval = TimeSpan.FromSeconds(10); - reloadTimerHinweis.Tick += ReloadTimerHinweis_Tick; - reloadTimerHinweis.Start(); + //reloadTimerHinweis.Interval = TimeSpan.FromSeconds(10); + //reloadTimerHinweis.Tick += ReloadTimerHinweis_Tick; + //reloadTimerHinweis.Start(); checkUpdateTimer.Interval = TimeSpan.FromMinutes(5); checkUpdateTimer.Tick += CheckUpdateTimer_Tick; @@ -429,7 +560,7 @@ namespace ZKuP - if (LoggedInRole == Roles.Admin && Properties.Settings.Default.ShowParkcardAccept) + if ((LoggedInRole == Roles.Admin || LoggedInRole == Roles.M2_AM) && Settings.GetSettingBool("ShowParkcardAccept")) { if (SQL.RowExists("parkausweise", "Genehmigt", "0").Result == true) { @@ -441,7 +572,7 @@ namespace ZKuP } } } - else if (LoggedInRole == Roles.Admin && Properties.Settings.Default.ShowParkcardPrint) + else if ((LoggedInRole == Roles.Admin || LoggedInRole == Roles.M2_AM) && Settings.GetSettingBool("ShowParkcardPrint")) { if (SQL.RowExists("parkausweise", "Genehmigt = '1' AND Gedruckt", "0").Result == true) { @@ -456,6 +587,12 @@ namespace ZKuP })); } + + Dispatcher.Invoke(() => Helper.FindVisualChildren @@ -348,6 +348,18 @@ + +