Parkplätze angepasst (20,21,22 nicht mehr verfügbar)
AspInfo erweitert: + Beauftragte Leistung + Firmen/Besucher-Eintragsansicht - Besucher-Info funktioniert wieder Scaling reworked
This commit is contained in:
parent
62b2dca396
commit
173afd4145
@ -281,6 +281,8 @@ namespace ZKuP
|
|||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
private void Window_LocationChanged(object sender, EventArgs e)
|
||||||
|
|||||||
@ -23,14 +23,14 @@ namespace ZKuP
|
|||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
//AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
//AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
||||||
//#if !DEBUG
|
#if !DEBUG
|
||||||
AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException; // Example 1
|
AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException; // Example 1
|
||||||
DispatcherUnhandledException += App_DispatcherUnhandledException;
|
DispatcherUnhandledException += App_DispatcherUnhandledException;
|
||||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; // Example 3
|
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; // Example 3
|
||||||
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
||||||
|
|
||||||
|
|
||||||
//#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -13,8 +13,8 @@
|
|||||||
<Storyboard x:Key="popDeleted" RepeatBehavior="1x" Completed="Storyboard_Completed">
|
<Storyboard x:Key="popDeleted" RepeatBehavior="1x" Completed="Storyboard_Completed">
|
||||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="popDeleted" Storyboard.TargetProperty="(UIElement.Opacity)">
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="popDeleted" Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
|
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
|
||||||
<EasingDoubleKeyFrame KeyTime="00:00:03" Value="0"/>
|
<EasingDoubleKeyFrame KeyTime="00:00:00.1" Value="0"/>
|
||||||
<EasingDoubleKeyFrame KeyTime="00:00:04" Value="1"/>
|
<EasingDoubleKeyFrame KeyTime="00:00:02" Value="1"/>
|
||||||
<EasingDoubleKeyFrame KeyTime="00:00:06" Value="1"/>
|
<EasingDoubleKeyFrame KeyTime="00:00:06" Value="1"/>
|
||||||
<EasingDoubleKeyFrame KeyTime="00:00:07" Value="0"/>
|
<EasingDoubleKeyFrame KeyTime="00:00:07" Value="0"/>
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
|||||||
@ -31,13 +31,16 @@ namespace ZKuP
|
|||||||
this.DataContext = this;
|
this.DataContext = this;
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
RefreshData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RefreshData()
|
||||||
|
{
|
||||||
Fzg = SQL.ReadSQL($"SELECT * FROM {MainWindow.table}.fzgAnmeldung").Result;
|
Fzg = SQL.ReadSQL($"SELECT * FROM {MainWindow.table}.fzgAnmeldung").Result;
|
||||||
|
|
||||||
dgFzg.DataContext = Fzg;
|
dgFzg.DataContext = Fzg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private async void InfoButton_Click(object sender, RoutedEventArgs e)
|
private async void InfoButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var buttons = Helper.FindVisualChildren<Button>(dgFzg).Where(p => p.Content != null && p.Content.ToString() == "✕");
|
var buttons = Helper.FindVisualChildren<Button>(dgFzg).Where(p => p.Content != null && p.Content.ToString() == "✕");
|
||||||
@ -123,17 +126,19 @@ namespace ZKuP
|
|||||||
|
|
||||||
private void MetroWindow_Loaded(object sender, RoutedEventArgs e)
|
private void MetroWindow_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var count = SQL.ReadSingleValue($"SELECT count(idfzgAnmeldung) FROM {MainWindow.table}.fzgAnmeldung WHERE Timestamp < now() - INTERVAL 30 DAY");
|
var count = SQL.ReadSingleValue($"SELECT count(idfzgAnmeldung) FROM {MainWindow.table}.fzgAnmeldung WHERE `Timestamp` < now() - INTERVAL 30 DAY AND Genehmigung <> 0");
|
||||||
|
|
||||||
if (Convert.ToInt16(count) > 0)
|
if (Convert.ToInt16(count) > 0)
|
||||||
{
|
{
|
||||||
SQL.WriteSQL($"DELETE FROM {MainWindow.table}.fzgAnmeldung WHERE Timestamp < now() - INTERVAL 30 DAY AND Genehmigung <> 0");
|
SQL.WriteSQL($"DELETE FROM {MainWindow.table}.fzgAnmeldung WHERE `Timestamp` < now() - INTERVAL 30 DAY AND Genehmigung <> 0");
|
||||||
|
|
||||||
popDeleted.Opacity = 0;
|
popDeleted.Opacity = 0;
|
||||||
popDeleted.Visibility = Visibility.Visible;
|
popDeleted.Visibility = Visibility.Visible;
|
||||||
tbDeleted.Text = $"{count} Einträge (älter als 30 Tage) wurden gelöscht";
|
tbDeleted.Text = $"{count} Einträge (älter als 30 Tage) wurden gelöscht";
|
||||||
|
|
||||||
(this.Resources["popDeleted"] as System.Windows.Media.Animation.Storyboard).Begin();
|
(this.Resources["popDeleted"] as System.Windows.Media.Animation.Storyboard).Begin();
|
||||||
|
|
||||||
|
RefreshData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -284,7 +284,7 @@
|
|||||||
<StackPanel Margin="5">
|
<StackPanel Margin="5">
|
||||||
<TextBlock Text="Gebuchte BE-Fläche der Firma:" FontSize="16" Foreground="Black" Background="White" Width="230" Padding="5,0" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
<TextBlock Text="Gebuchte BE-Fläche der Firma:" FontSize="16" Foreground="Black" Background="White" Width="230" Padding="5,0" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||||
<TextBlock x:Name="lblParkNumbers" Text="Nur diese Parkplätze vergeben!" FontSize="16" Foreground="Red" Background="White" Padding="5,0" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
<TextBlock x:Name="lblParkNumbers" Text="Nur diese Parkplätze vergeben!" FontSize="16" Foreground="Red" Background="White" Padding="5,0" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||||
<TextBlock Text="Diese Parkplätze sind bereits für die Firma blockiert (rot)" FontSize="16" Foreground="Black" Background="White" Width="405" Padding="5,0" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
<TextBlock Text="Diese Parkplätze sind bereits für die Firma blockiert (gelb)" FontSize="16" Foreground="Black" Background="White" Width="405" Padding="5,0" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Button x:Name="btnCloseBE" Background="Salmon" Content="✕" BorderThickness="2" BorderBrush="Black" Padding="0,-2,0,0" Width="30" Height="30" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,20,20,0" Click="btnCloseBE_Click"/>
|
<Button x:Name="btnCloseBE" Background="Salmon" Content="✕" BorderThickness="2" BorderBrush="Black" Padding="0,-2,0,0" Width="30" Height="30" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,20,20,0" Click="btnCloseBE_Click"/>
|
||||||
|
|||||||
@ -657,6 +657,32 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var kennzeichenTextboxes = spKennzeichen.Children.OfType<TextBox>().ToList();
|
||||||
|
string kennzeichen = "";
|
||||||
|
|
||||||
|
fzgCount = string.IsNullOrWhiteSpace(tbAnzahlFzg.Text) ? 0 : Convert.ToInt32(tbAnzahlFzg.Text);
|
||||||
|
for (var i = 0; i < fzgCount; i++)
|
||||||
|
{
|
||||||
|
if (kennzeichenTextboxes.Count >= i)
|
||||||
|
if (kennzeichen == "")
|
||||||
|
kennzeichen = $"{((kennzeichenTextboxes[i]) as TextBox).Text}";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(((kennzeichenTextboxes[i]) as TextBox).Text))
|
||||||
|
kennzeichen = $"{kennzeichen} / {((kennzeichenTextboxes[i]) as TextBox).Text}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(tbAnzahlFzg.Text) && Convert.ToInt16(tbAnzahlFzg.Text) > 0 && kennzeichenTextboxes.All(p => string.IsNullOrWhiteSpace(p.Text)))
|
||||||
|
{
|
||||||
|
MessageBox.Show(this, "Kennzeichen für die einfahrenden Fahrzeuge muss angegeben werden!", "Achtung!", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lblAnmeldung.Content = zutritt;
|
lblAnmeldung.Content = zutritt;
|
||||||
if (zutritt == "OK") lblAnmeldung.Background = new SolidColorBrush(Colors.LightGreen);
|
if (zutritt == "OK") lblAnmeldung.Background = new SolidColorBrush(Colors.LightGreen);
|
||||||
else if (zutritt == "Prüfen!") lblAnmeldung.Background = new SolidColorBrush(Colors.LightYellow);
|
else if (zutritt == "Prüfen!") lblAnmeldung.Background = new SolidColorBrush(Colors.LightYellow);
|
||||||
@ -700,21 +726,8 @@ namespace ZKuP
|
|||||||
arrivalClicked = true;
|
arrivalClicked = true;
|
||||||
btnClose_Copy.Visibility = Visibility.Collapsed;
|
btnClose_Copy.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
var kennzeichenTextboxes = spKennzeichen.Children.OfType<TextBox>().ToList();
|
|
||||||
string kennzeichen = "";
|
|
||||||
|
|
||||||
fzgCount = string.IsNullOrWhiteSpace(tbAnzahlFzg.Text) ? 0 : Convert.ToInt32(tbAnzahlFzg.Text);
|
|
||||||
for (var i = 0; i < fzgCount; i++)
|
|
||||||
{
|
|
||||||
if (kennzeichenTextboxes.Count >= i)
|
|
||||||
if (kennzeichen == "")
|
|
||||||
kennzeichen = $"{((kennzeichenTextboxes[i]) as TextBox).Text}";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrWhiteSpace(((kennzeichenTextboxes[i]) as TextBox).Text))
|
|
||||||
kennzeichen = $"{kennzeichen} / {((kennzeichenTextboxes[i]) as TextBox).Text}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (int.TryParse(selectedID, out int result))
|
if (int.TryParse(selectedID, out int result))
|
||||||
{
|
{
|
||||||
@ -1262,6 +1275,8 @@ namespace ZKuP
|
|||||||
|
|
||||||
|
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tbAnzahlPersonen_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
private void tbAnzahlPersonen_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||||
|
|||||||
@ -121,6 +121,8 @@ namespace ZKuP
|
|||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
private void Window_LocationChanged(object sender, EventArgs e)
|
||||||
|
|||||||
@ -6,46 +6,127 @@
|
|||||||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||||||
xmlns:local="clr-namespace:ZKuP"
|
xmlns:local="clr-namespace:ZKuP"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Info zu Ansprechpartnern" Height="591" Width="354" ResizeMode="NoResize"
|
Title="Info zu Ansprechpartnern" Height="700" Width="354" ResizeMode="NoResize"
|
||||||
WindowStartupLocation="CenterOwner" Visibility="Collapsed" Loaded="Window_Loaded" LocationChanged="Window_LocationChanged">
|
WindowStartupLocation="CenterOwner" Visibility="Visible" Loaded="Window_Loaded" LocationChanged="Window_LocationChanged">
|
||||||
<Grid x:Name="gridInfo">
|
<Grid x:Name="gridInfo">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition/>
|
<RowDefinition Height="60"/>
|
||||||
<RowDefinition/>
|
<RowDefinition Height="60"/>
|
||||||
<RowDefinition/>
|
<RowDefinition Height="60"/>
|
||||||
<RowDefinition/>
|
<RowDefinition Height="60"/>
|
||||||
<RowDefinition/>
|
<RowDefinition Height="60"/>
|
||||||
<RowDefinition/>
|
<RowDefinition Height="60"/>
|
||||||
<RowDefinition Height="2*"/>
|
<RowDefinition Height="*"/>
|
||||||
<RowDefinition/>
|
<RowDefinition x:Name="rowBemerkung" Height="*"/>
|
||||||
<RowDefinition/>
|
<RowDefinition Height="60"/>
|
||||||
<RowDefinition/>
|
<RowDefinition Height="40"/>
|
||||||
|
<RowDefinition Height="40"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock x:Name="lblAsp" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Ansprechpartner:" VerticalAlignment="Top"/>
|
|
||||||
<TextBox x:Name="tbAsp" Margin="10,0,10,0" TextWrapping="Wrap" VerticalAlignment="Bottom" IsReadOnly="True"/>
|
|
||||||
<TextBlock x:Name="lblTelVertreter_Besucher" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Telefonnummer Vertreter:" VerticalAlignment="Top" Grid.Row="3" PreviewMouseLeftButtonDown="TelNrs_PreviewMouseLeftButtonDown"/>
|
|
||||||
<TextBox x:Name="tbTelVertreter" Margin="10,0,10,0" ToolTip="Klicken zum Anrufen" TextWrapping="Wrap" Cursor="Hand" VerticalAlignment="Bottom" Grid.Row="3" IsReadOnly="True" PreviewMouseLeftButtonDown="TelNrs_PreviewMouseLeftButtonDown" Foreground="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" TextDecorations="Underline"/>
|
|
||||||
<TextBlock x:Name="lblVertreter_Besucher" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Vertreter:" VerticalAlignment="Top" Grid.Row="2"/>
|
|
||||||
<TextBox x:Name="tbVertreter" Margin="10,0,10,0" TextWrapping="Wrap" VerticalAlignment="Bottom" Grid.Row="2" IsReadOnly="True"/>
|
|
||||||
<TextBlock x:Name="lblTelAsp" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Telefonnummer Ansprechpartner:" VerticalAlignment="Top" Grid.Row="1"/>
|
|
||||||
<TextBox x:Name="tbTelAsp" Margin="10,0,10,0" TextWrapping="Wrap" ToolTip="Klicken zum Anrufen" Cursor="Hand" VerticalAlignment="Bottom" Grid.Row="1" IsReadOnly="True" PreviewMouseLeftButtonDown="TelNrs_PreviewMouseLeftButtonDown" Foreground="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" TextDecorations="Underline"/>
|
|
||||||
<TextBlock x:Name="lblVorgesetzter" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Vorgesetzter:" VerticalAlignment="Top" Grid.Row="4"/>
|
|
||||||
<TextBox x:Name="tbVorgesetzter" Margin="10,0,10,0" TextWrapping="Wrap" VerticalAlignment="Bottom" Grid.Row="4" IsReadOnly="True"/>
|
|
||||||
<TextBlock x:Name="lblTelVorgesetzter" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Telefonnummer Vorgesetzter:" VerticalAlignment="Top" Grid.Row="5"/>
|
|
||||||
<TextBox x:Name="tbTelVorgesetzter" Margin="10,0,10,0" TextWrapping="Wrap" ToolTip="Klicken zum Anrufen" Cursor="Hand" VerticalAlignment="Bottom" Grid.Row="5" IsReadOnly="True" PreviewMouseLeftButtonDown="TelNrs_PreviewMouseLeftButtonDown" Foreground="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" TextDecorations="Underline"/>
|
|
||||||
<TextBlock x:Name="lblBemerkung" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Margin="10,10,10,0" TextWrapping="Wrap" Text="Bemerkung" VerticalAlignment="Top" Grid.Row="6" Height="20"/>
|
|
||||||
<TextBox x:Name="tbBemerkung" Margin="10,35,10,0" TextWrapping="Wrap" VerticalAlignment="Stretch" Grid.Row="6" IsReadOnly="True" VerticalScrollBarVisibility="Auto"/>
|
|
||||||
|
|
||||||
<StackPanel Grid.Row="7" Margin="10,0,10,0">
|
<TextBlock x:Name="lblAsp" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Ansprechpartner:" VerticalAlignment="Top"/>
|
||||||
|
<TextBox x:Name="tbAsp" Margin="20,0,20,0" TextWrapping="Wrap" VerticalAlignment="Bottom" IsReadOnly="True"/>
|
||||||
|
|
||||||
|
<TextBlock x:Name="lblTelVertreter_Besucher" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Telefonnummer Vertreter:" VerticalAlignment="Top" Grid.Row="3" PreviewMouseLeftButtonDown="TelNrs_PreviewMouseLeftButtonDown"/>
|
||||||
|
<TextBox x:Name="tbTelVertreter" Margin="20,0,20,0" ToolTip="Klicken zum Anrufen" TextWrapping="Wrap" Cursor="Hand" VerticalAlignment="Bottom" Grid.Row="3" IsReadOnly="True" PreviewMouseLeftButtonDown="TelNrs_PreviewMouseLeftButtonDown" Foreground="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" TextDecorations="Underline"/>
|
||||||
|
|
||||||
|
<TextBlock x:Name="lblVertreter_Besucher" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Vertreter:" VerticalAlignment="Top" Grid.Row="2"/>
|
||||||
|
<TextBox x:Name="tbVertreter" Margin="20,0,20,0" TextWrapping="Wrap" VerticalAlignment="Bottom" Grid.Row="2" IsReadOnly="True"/>
|
||||||
|
|
||||||
|
<TextBlock x:Name="lblTelAsp" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Telefonnummer Ansprechpartner:" VerticalAlignment="Top" Grid.Row="1"/>
|
||||||
|
<TextBox x:Name="tbTelAsp" Margin="20,0,20,0" TextWrapping="Wrap" ToolTip="Klicken zum Anrufen" Cursor="Hand" VerticalAlignment="Bottom" Grid.Row="1" IsReadOnly="True" PreviewMouseLeftButtonDown="TelNrs_PreviewMouseLeftButtonDown" Foreground="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" TextDecorations="Underline"/>
|
||||||
|
|
||||||
|
<TextBlock x:Name="lblVorgesetzter" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Vorgesetzter:" VerticalAlignment="Top" Grid.Row="4"/>
|
||||||
|
<TextBox x:Name="tbVorgesetzter" Margin="20,0,20,0" TextWrapping="Wrap" VerticalAlignment="Bottom" Grid.Row="4" IsReadOnly="True"/>
|
||||||
|
|
||||||
|
<TextBlock x:Name="lblTelVorgesetzter" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Telefonnummer Vorgesetzter:" VerticalAlignment="Top" Grid.Row="5"/>
|
||||||
|
<TextBox x:Name="tbTelVorgesetzter" Margin="20,0,20,0" TextWrapping="Wrap" ToolTip="Klicken zum Anrufen" Cursor="Hand" VerticalAlignment="Bottom" Grid.Row="5" IsReadOnly="True" PreviewMouseLeftButtonDown="TelNrs_PreviewMouseLeftButtonDown" Foreground="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" TextDecorations="Underline"/>
|
||||||
|
|
||||||
|
<TextBlock x:Name="lblLeistung" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Margin="10,10,0,0" TextWrapping="Wrap" Text="Beauftragte Leistung / Grund des Besuchs" VerticalAlignment="Top" Grid.Row="6" Height="20"/>
|
||||||
|
<TextBox x:Name="tbLeistung" Margin="20,35,20,0" TextWrapping="Wrap" Grid.Row="6" IsReadOnly="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<TextBlock x:Name="lblBemerkung" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Margin="10,10,10,0" TextWrapping="Wrap" Text="Bemerkung" VerticalAlignment="Top" Grid.Row="7" Height="20"/>
|
||||||
|
<TextBox x:Name="tbBemerkung" Margin="20,35,20,0" TextWrapping="Wrap" VerticalAlignment="Stretch" Grid.Row="7" IsReadOnly="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="8" Margin="10,0,10,0" Height="40">
|
||||||
<TextBlock Text="Ausgegebene Parkkarten:" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
<TextBlock Text="Ausgegebene Parkkarten:" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||||
<TextBlock x:Name="lblParkkarten" HorizontalAlignment="Center" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
<TextBlock x:Name="lblParkkarten" HorizontalAlignment="Center" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Button x:Name="btnSignature" Content="Unterschrift" Margin="10" Click="btnSignature_Click" Grid.Row="8"/>
|
<Button x:Name="btnSubInfo" Content="Weitere Infos" Height="30" Margin="10,5,10,0" Click="btnSubInfo_Click" Grid.Row="9" VerticalAlignment="Top"/>
|
||||||
<Button x:Name="btnClose" Content="Schließen" Margin="10" Click="BtnClose_Click" Grid.Row="9"/>
|
<Button x:Name="btnSignature" Content="Unterschrift" Height="30" Margin="10,5,10,0" Click="btnSignature_Click" Grid.Row="9" VerticalAlignment="Top"/>
|
||||||
|
<Button x:Name="btnClose" Content="Schließen" Height="30" Margin="10,0,10,0" Click="BtnClose_Click" Grid.Row="10" VerticalAlignment="Top"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<Popup x:Name="pop" AllowsTransparency="True" Closed="Pop_Closed">
|
||||||
|
<StackPanel Orientation="Vertical" Background="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" Margin="5">
|
||||||
|
<TextBlock Text="Hinterlegte Informationen zu dieser Ankunft:" Margin="5"/>
|
||||||
|
<DataGrid x:Name="dgFirmen" Visibility="Visible" ItemsSource="{Binding .}" Height="200" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" IsReadOnly="True">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
|
||||||
|
<DataGridTextColumn Header="Verantwortl. MA" Binding="{Binding Verantwortlicher_MA_Firma}"/>
|
||||||
|
<DataGridTextColumn Header="Tel. Firma" Binding="{Binding Tel_Nr_Verantwortlicher_Firma}"/>
|
||||||
|
<DataGridTextColumn Header="Anz. Fzg." Binding="{Binding Anzahl_Fzg}">
|
||||||
|
<DataGridTextColumn.ElementStyle>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
|
</Style>
|
||||||
|
</DataGridTextColumn.ElementStyle>
|
||||||
|
</DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="Beauftragte Leistung" Binding="{Binding Beauftragte_Leistung}"/>
|
||||||
|
<DataGridTextColumn Header="Arbeitsbeginn" Binding="{Binding Arbeitsbeginn, StringFormat=\{0:dd.MM.yyyy\}}">
|
||||||
|
<DataGridTextColumn.ElementStyle>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
|
</Style>
|
||||||
|
</DataGridTextColumn.ElementStyle>
|
||||||
|
</DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="Arbeitsende" Binding="{Binding Arbeitsende, StringFormat=\{0:dd.MM.yyyy\}}">
|
||||||
|
<DataGridTextColumn.ElementStyle>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
|
</Style>
|
||||||
|
</DataGridTextColumn.ElementStyle>
|
||||||
|
</DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="Ansprechpartner intern" Binding="{Binding Ansprechpartner_Intern}"/>
|
||||||
|
<DataGridTextColumn Header="Tel. Ansprechpartner" Binding="{Binding Tel_Nr_Ansprechpartner_Intern}"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</StackPanel>
|
||||||
|
</Popup>
|
||||||
|
<Popup x:Name="popBesuch" AllowsTransparency="True" Closed="Pop_Closed">
|
||||||
|
<StackPanel Orientation="Vertical" Background="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" Margin="5">
|
||||||
|
<TextBlock Text="Hinterlegte Informationen zu diesem Besuch:" Margin="5"/>
|
||||||
|
<DataGrid x:Name="dgBesucher" Visibility="Visible" ItemsSource="{Binding .}" Height="200" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" IsReadOnly="True">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
|
||||||
|
<DataGridTextColumn Header="Verantwortl. MA" Binding="{Binding Verantwortlicher_MA}"/>
|
||||||
|
<DataGridTextColumn Header="Tel. Besucher" Binding="{Binding Tel_Nr_Besucher}"/>
|
||||||
|
<DataGridTextColumn Header="Anz. Begleitpersonen" Binding="{Binding Anzahl_Begleitpersonen}">
|
||||||
|
<DataGridTextColumn.ElementStyle>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
|
</Style>
|
||||||
|
</DataGridTextColumn.ElementStyle>
|
||||||
|
</DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="Grund des Besuchs" Binding="{Binding Grund_des_Besuchs}"/>
|
||||||
|
<DataGridTextColumn Header="Örtlichkeit" Binding="{Binding Oertlichkeit}"/>
|
||||||
|
<DataGridTextColumn Header="Besuchstag" Binding="{Binding Besuchstag, StringFormat=\{0:dd.MM.yyyy\}}">
|
||||||
|
<DataGridTextColumn.ElementStyle>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
|
</Style>
|
||||||
|
</DataGridTextColumn.ElementStyle>
|
||||||
|
</DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="Ansprechpartner intern" Binding="{Binding Ansprechpartner_Intern}"/>
|
||||||
|
<DataGridTextColumn Header="Tel. Ansprechpartner" Binding="{Binding Tel_Nr_Ansprechpartner_Intern}"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</StackPanel>
|
||||||
|
</Popup>
|
||||||
</Grid>
|
</Grid>
|
||||||
</mah:MetroWindow>
|
</mah:MetroWindow>
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
using MahApps.Metro.Controls;
|
using MahApps.Metro.Controls;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Controls.Primitives;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
@ -21,21 +23,50 @@ namespace ZKuP
|
|||||||
public partial class AspInfo : MetroWindow
|
public partial class AspInfo : MetroWindow
|
||||||
{
|
{
|
||||||
public int id { get; set; }
|
public int id { get; set; }
|
||||||
|
private int idFirma { get; set; }
|
||||||
|
string firmOrVisit = "";
|
||||||
|
|
||||||
//info = Welcher InfoButton wurde gedrückt? 1 = Ankunft heute; 2 = bereits bestätigt
|
//info = Welcher InfoButton wurde gedrückt? 1 = Ankunft heute; 2 = bereits bestätigt
|
||||||
public AspInfo(int idFirma_Besucher, string kat, int info = 1, string idzutritte = "1", string Asp = "")
|
public AspInfo(int idFirma_Besucher, string kat, int info = 1, string idzutritte = "1", string Asp = "")
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
idFirma = idFirma_Besucher;
|
||||||
|
|
||||||
if (idzutritte != "1") id = Convert.ToInt32(idzutritte);
|
if (idzutritte != "1") id = Convert.ToInt32(idzutritte);
|
||||||
|
|
||||||
if (info == 1) { lblBemerkung.Visibility = Visibility.Collapsed; tbBemerkung.Visibility = Visibility.Collapsed; btnSignature.Visibility = Visibility.Collapsed; }
|
if (info == 1)
|
||||||
else if (info == 2) { lblBemerkung.Visibility = Visibility.Visible; tbBemerkung.Visibility = Visibility.Visible; }
|
{
|
||||||
else { lblBemerkung.Visibility = Visibility.Visible; tbBemerkung.Visibility = Visibility.Visible; }
|
lblBemerkung.Visibility = Visibility.Collapsed;
|
||||||
|
tbBemerkung.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
rowBemerkung.Height = new GridLength(0);
|
||||||
|
|
||||||
|
btnSubInfo.Visibility = Visibility.Visible;
|
||||||
|
btnSignature.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
else if (info == 2)
|
||||||
|
{
|
||||||
|
btnSubInfo.Visibility = Visibility.Collapsed;
|
||||||
|
lblBemerkung.Visibility = Visibility.Visible;
|
||||||
|
tbBemerkung.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
rowBemerkung.Height = new GridLength(1, GridUnitType.Star);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
btnSubInfo.Visibility = Visibility.Collapsed;
|
||||||
|
lblBemerkung.Visibility = Visibility.Visible;
|
||||||
|
tbBemerkung.Visibility = Visibility.Visible;
|
||||||
|
lblLeistung.Visibility = Visibility.Collapsed;
|
||||||
|
tbLeistung.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
rowBemerkung.Height = new GridLength(1, GridUnitType.Star);
|
||||||
|
}
|
||||||
|
|
||||||
if (kat != "")
|
if (kat != "")
|
||||||
{
|
{
|
||||||
var firmOrVisit = kat == "1" ? "Firmen" : "besucher";
|
firmOrVisit = kat == "1" ? "Firmen" : "besucher";
|
||||||
switch (kat)
|
switch (kat)
|
||||||
{
|
{
|
||||||
case "1":
|
case "1":
|
||||||
@ -60,7 +91,20 @@ namespace ZKuP
|
|||||||
string aspName = "";
|
string aspName = "";
|
||||||
|
|
||||||
if (firmOrVisit != "family")
|
if (firmOrVisit != "family")
|
||||||
aspName = SQL.ReadSingleValue($"SELECT Ansprechpartner_Intern FROM {MainWindow.table}.{firmOrVisit.ToLower()} WHERE id{firmOrVisit}='{idFirma_Besucher}'");
|
{
|
||||||
|
if (firmOrVisit == "Firmen")
|
||||||
|
{
|
||||||
|
var reading = SQL.ReadListStringTwoColumns($"SELECT Ansprechpartner_Intern, Beauftragte_Leistung FROM {MainWindow.table}.{firmOrVisit.ToLower()} WHERE id{firmOrVisit}='{idFirma_Besucher}'").Result;
|
||||||
|
aspName = reading.First().Split(';')[0];
|
||||||
|
tbLeistung.Text = reading.First().Split(';')[1];
|
||||||
|
}
|
||||||
|
else if (firmOrVisit == "besucher")
|
||||||
|
{
|
||||||
|
var reading = SQL.ReadListStringTwoColumns($"SELECT Ansprechpartner_Intern, Grund_des_Besuchs FROM {MainWindow.table}.{firmOrVisit.ToLower()} WHERE id{firmOrVisit}='{idFirma_Besucher}'").Result;
|
||||||
|
aspName = reading.First().Split(';')[0];
|
||||||
|
tbLeistung.Text = reading.First().Split(';')[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
aspName = Asp;
|
aspName = Asp;
|
||||||
|
|
||||||
@ -79,7 +123,7 @@ namespace ZKuP
|
|||||||
tbBemerkung.Text = SQL.ReadSingleValue($"SELECT Bemerkung FROM {MainWindow.table}.zutritte WHERE idzutritte='{idzutritte}'");
|
tbBemerkung.Text = SQL.ReadSingleValue($"SELECT Bemerkung FROM {MainWindow.table}.zutritte WHERE idzutritte='{idzutritte}'");
|
||||||
|
|
||||||
lblParkkarten.Text = SQL.ReadSingleValue($"SELECT GROUP_CONCAT(parkplatznr SEPARATOR ';') FROM {MainWindow.table}.parkplaetze WHERE firma = '{idFirma_Besucher}'").Replace(";", ", ");
|
lblParkkarten.Text = SQL.ReadSingleValue($"SELECT GROUP_CONCAT(parkplatznr SEPARATOR ';') FROM {MainWindow.table}.parkplaetze WHERE firma = '{idFirma_Besucher}'").Replace(";", ", ");
|
||||||
|
if (string.IsNullOrWhiteSpace(lblParkkarten.Text)) lblParkkarten.Text = "keine";
|
||||||
|
|
||||||
this.Visibility = Visibility.Visible;
|
this.Visibility = Visibility.Visible;
|
||||||
}
|
}
|
||||||
@ -132,6 +176,50 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Button lastButton = null;
|
||||||
|
private async void btnSubInfo_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (pop.IsOpen || popBesuch.IsOpen)
|
||||||
|
{
|
||||||
|
pop.IsOpen = popBesuch.IsOpen = false;
|
||||||
|
|
||||||
|
//(sender as Button).ClearValue(Button.BackgroundProperty);
|
||||||
|
(sender as Button).ClearValue(Button.ForegroundProperty);
|
||||||
|
(sender as Button).Content = "ⓘ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
(sender as Button).Content = "Popup schließen";
|
||||||
|
(sender as Button).Foreground = new SolidColorBrush(Colors.Red);
|
||||||
|
//(sender as Button).Background = new SolidColorBrush(Colors.DarkGray);
|
||||||
|
//var pop = new Popup();
|
||||||
|
pop.PopupAnimation = popBesuch.PopupAnimation = PopupAnimation.Slide;
|
||||||
|
pop.PlacementTarget = popBesuch.PlacementTarget = (sender as Button);
|
||||||
|
pop.HorizontalOffset = popBesuch.HorizontalOffset = 50;
|
||||||
|
|
||||||
|
if (firmOrVisit == "Firmen")
|
||||||
|
{
|
||||||
|
var Firma = await SQL.ReadSQL($"SELECT Name, Verantwortlicher_MA_Firma, Tel_Nr_Verantwortlicher_Firma, Anzahl_Fzg,Beauftragte_Leistung,Arbeitsbeginn, Arbeitsende,Ansprechpartner_Intern,Tel_Nr_Ansprechpartner_Intern FROM {MainWindow.table}.firmen WHERE idFirmen = '{idFirma}'");
|
||||||
|
dgFirmen.DataContext = Firma;
|
||||||
|
pop.IsOpen = true;
|
||||||
|
}
|
||||||
|
else if (firmOrVisit == "besucher")
|
||||||
|
{
|
||||||
|
var Besucher = await SQL.ReadSQL($"SELECT * FROM {MainWindow.table}.besucher WHERE idbesucher = '{idFirma}'");
|
||||||
|
dgBesucher.DataContext = Besucher;
|
||||||
|
popBesuch.IsOpen = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
lastButton = (sender as Button);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Pop_Closed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
lastButton.ClearValue(Button.ForegroundProperty);
|
||||||
|
lastButton.Content = "Weitere Infos";
|
||||||
|
}
|
||||||
|
|
||||||
private async void btnSignature_Click(object sender, RoutedEventArgs e)
|
private async void btnSignature_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var x = SQL.ReadSingleByteArr($"SELECT signature_blob FROM {MainWindow.table}.zutritte WHERE idzutritte = '{id}'");
|
var x = SQL.ReadSingleByteArr($"SELECT signature_blob FROM {MainWindow.table}.zutritte WHERE idzutritte = '{id}'");
|
||||||
@ -163,6 +251,9 @@ namespace ZKuP
|
|||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
private void Window_LocationChanged(object sender, EventArgs e)
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.IO.Ports;
|
using System.IO.Ports;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
@ -13,6 +14,14 @@ public class CardReaderViewModel : IDisposable
|
|||||||
|
|
||||||
public void StartListening(string portName = "COM3")
|
public void StartListening(string portName = "COM3")
|
||||||
{
|
{
|
||||||
|
// Prüfen, ob der Port existiert
|
||||||
|
var availablePorts = SerialPort.GetPortNames();
|
||||||
|
if (!availablePorts.Contains(portName, StringComparer.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
//throw new ArgumentException($"Der angegebene Port '{portName}' existiert nicht. Verfügbare Ports: {string.Join(", ", availablePorts)}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_port != null && _port.IsOpen)
|
if (_port != null && _port.IsOpen)
|
||||||
return; // Bereits aktiv
|
return; // Bereits aktiv
|
||||||
|
|
||||||
@ -25,8 +34,8 @@ public class CardReaderViewModel : IDisposable
|
|||||||
}
|
}
|
||||||
catch (UnauthorizedAccessException)
|
catch (UnauthorizedAccessException)
|
||||||
{
|
{
|
||||||
// Port bereits von anderem Fenster geöffnet
|
// Port ist bereits von einem anderen Prozess geöffnet
|
||||||
throw new InvalidOperationException("Port ist bereits in Verwendung");
|
throw new InvalidOperationException($"Der Port '{portName}' wird bereits von einem anderen Prozess verwendet.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -426,6 +426,8 @@ namespace ZKuP
|
|||||||
CheckAllBoxes(true);
|
CheckAllBoxes(true);
|
||||||
|
|
||||||
gridSpinner.Visibility = Visibility.Collapsed;
|
gridSpinner.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Query(CardType type)
|
private async Task Query(CardType type)
|
||||||
|
|||||||
@ -188,6 +188,7 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|
||||||
<local:NullToVisibilityConverter x:Key="NullToVisibilityConverter"/>
|
<local:NullToVisibilityConverter x:Key="NullToVisibilityConverter"/>
|
||||||
|
<local:NullToEnabledConverter x:Key="NullToEnabledConverter"/>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</mah:MetroWindow.Resources>
|
</mah:MetroWindow.Resources>
|
||||||
|
|
||||||
@ -202,10 +203,10 @@
|
|||||||
|
|
||||||
<StackPanel Margin="10,204,0,0" Width="340" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Horizontal">
|
<StackPanel Margin="10,204,0,0" Width="340" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Horizontal">
|
||||||
<TextBox x:Name="tbAnzahl_Begleiter" HorizontalAlignment="Left" Width="170" Height="23" TextWrapping="Wrap" Text="" VerticalAlignment="Top" TabIndex="4" PreviewKeyDown="TextBoxes_PreviewKeyDown" PreviewTextInput="tbAnzahl_Begleiter_PreviewTextInput" ToolTip="Nur Zahlen und max. 2 Stellen" CommandManager.PreviewExecuted="Textboxes_PreviewExecuted" ContextMenu="{x:Null}"/>
|
<TextBox x:Name="tbAnzahl_Begleiter" HorizontalAlignment="Left" Width="170" Height="23" TextWrapping="Wrap" Text="" VerticalAlignment="Top" TabIndex="4" PreviewKeyDown="TextBoxes_PreviewKeyDown" PreviewTextInput="tbAnzahl_Begleiter_PreviewTextInput" ToolTip="Nur Zahlen und max. 2 Stellen" CommandManager.PreviewExecuted="Textboxes_PreviewExecuted" ContextMenu="{x:Null}"/>
|
||||||
<Button x:Name="btnBegleiter" Content="Begleitpersonen angeben" Width="165" FontSize="12" Margin="5,0,0,0" HorizontalAlignment="Right" Click="btnBegleiter_Click"/>
|
<Button x:Name="btnBegleiter" Content="Personen angeben" Width="165" FontSize="12" Margin="5,0,0,0" HorizontalAlignment="Right" Click="btnBegleiter_Click"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<TextBlock Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,183,0,0" TextWrapping="Wrap" Text="Anzahl Begleitpersonen" VerticalAlignment="Top"/>
|
<TextBlock Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,183,0,0" TextWrapping="Wrap" Text="Anzahl Personen" VerticalAlignment="Top"/>
|
||||||
<TextBlock Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,379,0,0" TextWrapping="Wrap" Text="Arbeitsbeginn ab" VerticalAlignment="Top"/>
|
<TextBlock Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Left" Margin="10,379,0,0" TextWrapping="Wrap" Text="Arbeitsbeginn ab" VerticalAlignment="Top"/>
|
||||||
<TextBlock Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" x:Name="lbl1" HorizontalAlignment="Left" Margin="10,429,0,0" TextWrapping="Wrap" Text="Personen in Baumaßnahme eingewiesen bis" VerticalAlignment="Top"/>
|
<TextBlock Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" x:Name="lbl1" HorizontalAlignment="Left" Margin="10,429,0,0" TextWrapping="Wrap" Text="Personen in Baumaßnahme eingewiesen bis" VerticalAlignment="Top"/>
|
||||||
<ComboBox x:Name="cbAnsprechpartner_Intern" HorizontalAlignment="Left" Height="23" Margin="10,553,0,0" Text="" VerticalAlignment="Top" Width="340" SelectionChanged="CbAnsprechpartner_Intern_SelectionChanged" TabIndex="16"/>
|
<ComboBox x:Name="cbAnsprechpartner_Intern" HorizontalAlignment="Left" Height="23" Margin="10,553,0,0" Text="" VerticalAlignment="Top" Width="340" SelectionChanged="CbAnsprechpartner_Intern_SelectionChanged" TabIndex="16"/>
|
||||||
@ -305,7 +306,9 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</DataGridTextColumn.ElementStyle>
|
</DataGridTextColumn.ElementStyle>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
<!--<DataGridTemplateColumn ClipboardContentBinding="{x:Null}" Header="Tel. Firma">--><!--Binding="{Binding Tel_Nr_Verantwortlicher_Firma}"--><!--
|
<!--<DataGridTemplateColumn ClipboardContentBinding="{x:Null}" Header="Tel. Firma">-->
|
||||||
|
<!--Binding="{Binding Tel_Nr_Verantwortlicher_Firma}"-->
|
||||||
|
<!--
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBox Text="{Binding Tel_Nr_Verantwortlicher_Firma}" Background="Transparent" BorderThickness="0" VerticalAlignment="Center" HorizontalAlignment="Left" HorizontalContentAlignment="Center" Padding="5" PreviewTextInput="tbTel_Firma_PreviewTextInput" LostKeyboardFocus="TelNrVerantwortlicher_LostKeyboardFocus">
|
<TextBox Text="{Binding Tel_Nr_Verantwortlicher_Firma}" Background="Transparent" BorderThickness="0" VerticalAlignment="Center" HorizontalAlignment="Left" HorizontalContentAlignment="Center" Padding="5" PreviewTextInput="tbTel_Firma_PreviewTextInput" LostKeyboardFocus="TelNrVerantwortlicher_LostKeyboardFocus">
|
||||||
@ -322,7 +325,7 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</DataGridTextColumn.ElementStyle>
|
</DataGridTextColumn.ElementStyle>
|
||||||
</DataGridTextColumn>-->
|
</DataGridTextColumn>-->
|
||||||
<DataGridTemplateColumn Header="Anz. Begleitp.">
|
<DataGridTemplateColumn Header="Anz. Personen">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
|
||||||
@ -427,23 +430,87 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
<DataGridTemplateColumn Header="BE-Fläche" MinWidth="150">
|
<DataGridTemplateColumn x:Name="dataGridTemplateColumn" Header="BE-Fläche" MinWidth="330">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid x:Name="grid_dgBE" MouseEnter="cbBE_MouseEnter">
|
<Grid x:Name="grid_dgBE" VerticalAlignment="Stretch">
|
||||||
<TextBlock Text="{Binding BE, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding BE, Converter={StaticResource NullToVisibilityConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4,0,0,0"/>
|
<Grid.ColumnDefinitions>
|
||||||
<ComboBox x:Name="dg_cbBE" IsEnabled="{Binding BEColumnIsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:CreateFirma}}}" Template="{StaticResource ComboBoxControlTemplate1}" ItemsSource="{Binding BEItems, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:CreateFirma}}}" SelectedItem="{Binding BE, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" DropDownClosed="dg_cbBE_DropDownClosed" DropDownOpened="dg_cbBE_DropDownOpened">
|
<ColumnDefinition Width="*" />
|
||||||
<!--SelectedItem="{Binding BE, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" -->
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- TextBlock (sichtbar, wenn BE gesetzt ist) -->
|
||||||
|
<TextBlock
|
||||||
|
x:Name="txtBE"
|
||||||
|
Text="{Binding BE, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
Visibility="{Binding BE, Converter={StaticResource NullToVisibilityConverter}}"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
Grid.ColumnSpan="2" />
|
||||||
|
|
||||||
|
<!-- ComboBox -->
|
||||||
|
<ComboBox
|
||||||
|
x:Name="dg_cbBE"
|
||||||
|
Grid.Column="0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
IsEnabled="{Binding BEColumnIsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:CreateFirma}}}"
|
||||||
|
Template="{StaticResource ComboBoxControlTemplate1}"
|
||||||
|
ItemsSource="{Binding BEItems, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:CreateFirma}}}"
|
||||||
|
SelectedItem="{Binding BE, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
DropDownClosed="dg_cbBE_DropDownClosed"
|
||||||
|
DropDownOpened="dg_cbBE_DropDownOpened">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding}" />
|
<TextBlock Text="{Binding}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
|
||||||
|
<!-- Button rechts -->
|
||||||
|
|
||||||
|
<!-- Button nur enabled wenn es der angemeldete User ist-->
|
||||||
|
<Button
|
||||||
|
x:Name="btnDelBE"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="20"
|
||||||
|
Padding="0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
Content="3"
|
||||||
|
FontFamily="Wingdings 2"
|
||||||
|
FontSize="18"
|
||||||
|
ToolTip="Feld BE-Fläche leeren"
|
||||||
|
ToolTipService.ShowOnDisabled="True"
|
||||||
|
Click="btnDelBE_Click"
|
||||||
|
mah:ControlsHelper.CornerRadius="0"
|
||||||
|
IsEnabled="{Binding BE, Converter={StaticResource NullToEnabledConverter}}"
|
||||||
|
Visibility="{Binding btnDelBEVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:CreateFirma}},UpdateSourceTrigger=PropertyChanged}">
|
||||||
|
<Button.Style>
|
||||||
|
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||||
|
<Setter Property="Foreground" Value="Red" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter Property="Foreground" Value="Gray" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Button.Style>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<!-- Unsichtbare Overlay-Fläche für MouseEnter -->
|
||||||
|
<Border x:Name="popBorder"
|
||||||
|
Grid.Column="0"
|
||||||
|
Background="Transparent"
|
||||||
|
MouseEnter="cbBE_MouseEnter"
|
||||||
|
IsHitTestVisible="True" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
|
|
||||||
<!--<DataGridTextColumn Binding="{Binding Ansprechpartner_Intern}" ClipboardContentBinding="{x:Null}" Header="Anspr. intern"/>-->
|
<!--<DataGridTextColumn Binding="{Binding Ansprechpartner_Intern}" ClipboardContentBinding="{x:Null}" Header="Anspr. intern"/>-->
|
||||||
<DataGridTemplateColumn Header="Anspr. intern" MinWidth="150">
|
<DataGridTemplateColumn Header="Anspr. intern" MinWidth="150">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
@ -484,7 +551,7 @@
|
|||||||
<Button x:Name="btnBegleitung" Content="↑ Nur in Begleitung" FontSize="12" Padding="-2" HorizontalAlignment="Left" Margin="180,503,0,0" VerticalAlignment="Top" Width="170" Height="24" Background="#CCFFA200" BorderBrush="#FFFF8B00" Click="BtnEinweisung_PreValues_Click" ToolTip="Für Fimen die sich nur in Begleitung auf dem Gelände bewegen dürfen" TabIndex="15"/>
|
<Button x:Name="btnBegleitung" Content="↑ Nur in Begleitung" FontSize="12" Padding="-2" HorizontalAlignment="Left" Margin="180,503,0,0" VerticalAlignment="Top" Width="170" Height="24" Background="#CCFFA200" BorderBrush="#FFFF8B00" Click="BtnEinweisung_PreValues_Click" ToolTip="Für Fimen die sich nur in Begleitung auf dem Gelände bewegen dürfen" TabIndex="15"/>
|
||||||
<Button x:Name="btnHelp" Content="Hilfe zur Tabelle" FontSize="12" Padding="-2" HorizontalAlignment="Left" Margin="435,11,0,0" Height="23" VerticalAlignment="Top" Width="160" Click="btnHelp_Click"/>
|
<Button x:Name="btnHelp" Content="Hilfe zur Tabelle" FontSize="12" Padding="-2" HorizontalAlignment="Left" Margin="435,11,0,0" Height="23" VerticalAlignment="Top" Width="160" Click="btnHelp_Click"/>
|
||||||
|
|
||||||
<Popup PopupAnimation="Fade" AllowsTransparency="True" Width="250" StaysOpen="False" x:Name="M2WithGebuchterBETooltipPopup" Closed="TooltipPopup_Closed">
|
<Popup PopupAnimation="Fade" AllowsTransparency="True" Width="250" StaysOpen="False" x:Name="M2WithGebuchterBETooltipPopup" Closed="TooltipPopup_Closed" PreviewMouseWheel="M2WithGebuchterBETooltipPopup_PreviewMouseWheel">
|
||||||
<Border Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="LightGray" CornerRadius="3" BorderThickness="1">
|
<Border Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="LightGray" CornerRadius="3" BorderThickness="1">
|
||||||
<StackPanel Margin="0" Orientation="Vertical" >
|
<StackPanel Margin="0" Orientation="Vertical" >
|
||||||
<TextBlock Text="Gebuchte BE-Fläche wählen" Margin="5" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Center"/>
|
<TextBlock Text="Gebuchte BE-Fläche wählen" Margin="5" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Center"/>
|
||||||
@ -496,7 +563,7 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</Popup>
|
</Popup>
|
||||||
|
|
||||||
<Popup PopupAnimation="Fade" AllowsTransparency="True" StaysOpen="False" x:Name="M2WithoutGebuchterBETooltipPopup" Closed="TooltipPopup_Closed">
|
<Popup PopupAnimation="Fade" AllowsTransparency="True" StaysOpen="False" x:Name="M2WithoutGebuchterBETooltipPopup" Closed="TooltipPopup_Closed" MouseLeave="M2WithoutGebuchterBETooltipPopup_MouseLeave" PreviewMouseWheel="M2WithoutGebuchterBETooltipPopup_PreviewMouseWheel">
|
||||||
<Border Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="LightGray" CornerRadius="3" BorderThickness="1">
|
<Border Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="LightGray" CornerRadius="3" BorderThickness="1">
|
||||||
<StackPanel Margin="0" Orientation="Vertical" >
|
<StackPanel Margin="0" Orientation="Vertical" >
|
||||||
<TextBlock Text="Keine gebuchten BE-Flächen vorhanden" Margin="5" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Center"/>
|
<TextBlock Text="Keine gebuchten BE-Flächen vorhanden" Margin="5" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Center"/>
|
||||||
@ -507,7 +574,7 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</Popup>
|
</Popup>
|
||||||
|
|
||||||
<Popup PopupAnimation="Fade" AllowsTransparency="True" StaysOpen="False" x:Name="NotM2TooltipPopup" Closed="TooltipPopup_Closed">
|
<Popup PopupAnimation="Fade" AllowsTransparency="True" StaysOpen="False" x:Name="NotM2TooltipPopup" Closed="TooltipPopup_Closed" PreviewMouseWheel="NotM2TooltipPopup_PreviewMouseWheel">
|
||||||
<Border Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="LightGray" CornerRadius="3" BorderThickness="1">
|
<Border Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="LightGray" CornerRadius="3" BorderThickness="1">
|
||||||
<StackPanel Margin="10" Orientation="Vertical" >
|
<StackPanel Margin="10" Orientation="Vertical" >
|
||||||
<TextBlock Text="BE-Flächen können nur von M2 gebucht werden" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
<TextBlock Text="BE-Flächen können nur von M2 gebucht werden" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||||
|
|||||||
@ -9,6 +9,7 @@ using System.Data;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Runtime.Remoting.Channels;
|
using System.Runtime.Remoting.Channels;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
@ -24,6 +25,8 @@ using System.Windows.Media.Imaging;
|
|||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Windows.UI.Popups;
|
using Windows.UI.Popups;
|
||||||
|
using WpfScreenHelper;
|
||||||
|
|
||||||
//using Windows.UI.Xaml.Controls.Primitives;
|
//using Windows.UI.Xaml.Controls.Primitives;
|
||||||
using static System.Net.Mime.MediaTypeNames;
|
using static System.Net.Mime.MediaTypeNames;
|
||||||
|
|
||||||
@ -68,6 +71,14 @@ namespace ZKuP
|
|||||||
set { beColumnIsEnabled = value; OnPropertyChanged(); }
|
set { beColumnIsEnabled = value; OnPropertyChanged(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Visibility btndelBEVisible = Visibility.Collapsed;
|
||||||
|
public Visibility btnDelBEVisible
|
||||||
|
{
|
||||||
|
get { return btndelBEVisible; }
|
||||||
|
set { btndelBEVisible = value; OnPropertyChanged(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public string Personen { get; set; }
|
public string Personen { get; set; }
|
||||||
public string TelNr { get; set; }
|
public string TelNr { get; set; }
|
||||||
|
|
||||||
@ -99,17 +110,18 @@ namespace ZKuP
|
|||||||
existingFirmenTimer.Tick += ExistingFirmenTimer_Tick;
|
existingFirmenTimer.Tick += ExistingFirmenTimer_Tick;
|
||||||
existingFirmenTimer.Interval = TimeSpan.FromMilliseconds(500);
|
existingFirmenTimer.Interval = TimeSpan.FromMilliseconds(500);
|
||||||
|
|
||||||
popCloseTimer.Interval = TimeSpan.FromSeconds(5);
|
popCloseTimer.Interval = TimeSpan.FromSeconds(3);
|
||||||
popCloseTimer.Tick += (s, arg) =>
|
popCloseTimer.Tick += (s, arg) =>
|
||||||
{
|
{
|
||||||
dgFirmen.FindChild<Grid>("grid_dgBE").MouseEnter -= cbBE_MouseEnter;
|
//var pop = dgFirmen.FindChild<Grid>("grid_dgBE").FindChild<Popup>("popBorder");
|
||||||
|
dgFirmen.FindChild<Border>("popBorder").MouseEnter -= cbBE_MouseEnter;
|
||||||
ccBE.MouseEnter -= cbBE_MouseEnter;
|
ccBE.MouseEnter -= cbBE_MouseEnter;
|
||||||
|
|
||||||
M2WithoutGebuchterBETooltipPopup.IsOpen = false;
|
M2WithoutGebuchterBETooltipPopup.IsOpen = false;
|
||||||
M2WithGebuchterBETooltipPopup.IsOpen = false;
|
M2WithGebuchterBETooltipPopup.IsOpen = false;
|
||||||
NotM2TooltipPopup.IsOpen = false;
|
NotM2TooltipPopup.IsOpen = false;
|
||||||
|
|
||||||
dgFirmen.FindChild<Grid>("grid_dgBE").MouseEnter += cbBE_MouseEnter;
|
dgFirmen.FindChild<Border>("popBorder").MouseEnter += cbBE_MouseEnter;
|
||||||
ccBE.MouseEnter += cbBE_MouseEnter;
|
ccBE.MouseEnter += cbBE_MouseEnter;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -149,7 +161,7 @@ namespace ZKuP
|
|||||||
if (RoleManager.LoggedInRole == Roles.M2 || RoleManager.LoggedInRole == Roles.M2_AM || RoleManager.LoggedInRole == Roles.Admin)
|
if (RoleManager.LoggedInRole == Roles.M2 || RoleManager.LoggedInRole == Roles.M2_AM || RoleManager.LoggedInRole == Roles.Admin)
|
||||||
{
|
{
|
||||||
LoadBEs();
|
LoadBEs();
|
||||||
|
btnDelBEVisible = Visibility.Visible;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -159,6 +171,8 @@ namespace ZKuP
|
|||||||
dg_cbBE_Tooltip = "BE-Flächen können nur von M2 gebucht werden";
|
dg_cbBE_Tooltip = "BE-Flächen können nur von M2 gebucht werden";
|
||||||
ToolTipService.SetInitialShowDelay(cbBE, 100);
|
ToolTipService.SetInitialShowDelay(cbBE, 100);
|
||||||
ToolTipService.SetShowOnDisabled(cbBE, true);
|
ToolTipService.SetShowOnDisabled(cbBE, true);
|
||||||
|
|
||||||
|
btnDelBEVisible = Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
dpEinweisung_Bis.DisplayDateEnd = DateTime.Now + TimeSpan.FromDays(365);
|
dpEinweisung_Bis.DisplayDateEnd = DateTime.Now + TimeSpan.FromDays(365);
|
||||||
@ -227,14 +241,14 @@ namespace ZKuP
|
|||||||
{
|
{
|
||||||
|
|
||||||
var FK = "";
|
var FK = "";
|
||||||
var persons = SQL.ReadListStringTwoColumns($"SELECT Name,Vertreter FROM {MainWindow.table}.ansprechpartner WHERE Vorgesetzter = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName.ReplaceMiddleInitialWithSpace()).ReplaceUmlaute()}'").Result;
|
var persons = SQL.ReadListStringTwoColumns($"SELECT Name,Vertreter FROM {MainWindow.table}.ansprechpartner WHERE Vorgesetzter = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName.ReplaceMiddleInitialWithSpace())}'").Result;
|
||||||
|
|
||||||
if (persons.Count > 0)
|
if (persons.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var p in persons)
|
foreach (var p in persons)
|
||||||
{
|
{
|
||||||
FK += $" OR Ersteller = '{p.Split(';')[0].Replace(" ", "")}' OR Ansprechpartner_Intern = '{p.Split(';')[0].Replace(" ", "")}'";
|
FK += $" OR Ersteller = '{p.Split(';')[0].Replace(" ", "").ReplaceUmlaute()}' OR Ansprechpartner_Intern = '{p.Split(';')[0].Replace(" ", "")}'";
|
||||||
FK += $" OR Ersteller = '{p.Split(';')[1].Replace(" ", "")}' OR Ansprechpartner_Intern = '{p.Split(';')[1].Replace(" ", "")}'";
|
FK += $" OR Ersteller = '{p.Split(';')[1].Replace(" ", "").ReplaceUmlaute()}' OR Ansprechpartner_Intern = '{p.Split(';')[1].Replace(" ", "")}'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -430,6 +444,11 @@ namespace ZKuP
|
|||||||
MessageBox.Show("'Ansprechpartner intern' auswählen!", "Fehler");
|
MessageBox.Show("'Ansprechpartner intern' auswählen!", "Fehler");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if (string.IsNullOrWhiteSpace(tbAnzahl_Begleiter.Text))
|
||||||
|
{
|
||||||
|
MessageBox.Show("'Anzahl Personen' angeben!", "Fehler");
|
||||||
|
return;
|
||||||
|
}
|
||||||
else if (!dpEinweisung_Bis.SelectedDate.HasValue && GetDPText() == "...Einweisung folgt...")
|
else if (!dpEinweisung_Bis.SelectedDate.HasValue && GetDPText() == "...Einweisung folgt...")
|
||||||
{
|
{
|
||||||
if (dpArbeitsende.SelectedDate.Value < dpArbeitsbeginn.SelectedDate.Value)
|
if (dpArbeitsende.SelectedDate.Value < dpArbeitsbeginn.SelectedDate.Value)
|
||||||
@ -892,10 +911,13 @@ namespace ZKuP
|
|||||||
var arr = row.Row.ItemArray;
|
var arr = row.Row.ItemArray;
|
||||||
|
|
||||||
if (e.Key == Key.Delete)
|
if (e.Key == Key.Delete)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show(this, $"Markierte Firma '{arr[1]}' wirklich entfernen?", "Firma entfernen?", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
|
||||||
{
|
{
|
||||||
deleteRow(arr);
|
deleteRow(arr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private async void DgFirmen_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
|
private async void DgFirmen_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
|
||||||
@ -966,7 +988,7 @@ namespace ZKuP
|
|||||||
case "Tel. Firma":
|
case "Tel. Firma":
|
||||||
if (!System.Text.RegularExpressions.Regex.IsMatch(newValue, "^[0-9()+\\-/ ]*$"))
|
if (!System.Text.RegularExpressions.Regex.IsMatch(newValue, "^[0-9()+\\-/ ]*$"))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Telefonnummer der Firma muss qualifiziert angegeben werden!\nFalls keine Nummer des MA der Firma bekannt, die Nummer des Erstellers eintragen", "Fehler");
|
MessageBox.Show("Telefonnummer der Firma muss qualifiziert angegeben werden!\nFalls keine Nummer des MA der Firma bekannt, die Nummer des Erstellers eintragen", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
break;
|
break;
|
||||||
//new Popup() { Child = new TextBlock() { Text = $"'{tbTel_Firma.Text.Last()}' ist kein gültiges Zeichen\nTelefonnummer muss qualifiziert eingetragen werden!", Foreground = new SolidColorBrush(Colors.White), Margin = new Thickness(5) }, IsOpen = true, StaysOpen = false, Placement = PlacementMode.Mouse };
|
//new Popup() { Child = new TextBlock() { Text = $"'{tbTel_Firma.Text.Last()}' ist kein gültiges Zeichen\nTelefonnummer muss qualifiziert eingetragen werden!", Foreground = new SolidColorBrush(Colors.White), Margin = new Thickness(5) }, IsOpen = true, StaysOpen = false, Placement = PlacementMode.Mouse };
|
||||||
//break;
|
//break;
|
||||||
@ -974,7 +996,7 @@ namespace ZKuP
|
|||||||
|
|
||||||
if (newValue.ToList<char>().Distinct().Count() < 5)
|
if (newValue.ToList<char>().Distinct().Count() < 5)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Telefonnummer der Firma muss qualifiziert angegeben werden!\nFalls keine Nummer des MA der Firma bekannt, die Nummer des Erstellers eintragen", "Fehler");
|
MessageBox.Show("Telefonnummer der Firma muss qualifiziert angegeben werden!\nFalls keine Nummer des MA der Firma bekannt, die Nummer des Erstellers eintragen", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -988,9 +1010,14 @@ namespace ZKuP
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "Anz. Begleitp.":
|
case "Anz. Personen":
|
||||||
if (!System.Text.RegularExpressions.Regex.IsMatch(newValue, "^[0-9]*$"))
|
if (!System.Text.RegularExpressions.Regex.IsMatch(newValue, "^[0-9]*$"))
|
||||||
MessageBox.Show(this, "Anzahl Begleiter darf nur Zahlen enthalten", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show(this, "Anzahl Begleiter darf nur Zahlen enthalten", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
else if (string.IsNullOrWhiteSpace(newValue) || newValue == "0")
|
||||||
|
{
|
||||||
|
MessageBox.Show("'Anzahl Personen' darf nicht leer oder 0 sein!", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
//await SQL.WriteSQL($"UPDATE {MainWindow.table}.firmen SET Anzahl_Begleiter = '{newValue}', Bearbeiter = '{Environment.UserName}' WHERE idFirmen = '{id}'");
|
//await SQL.WriteSQL($"UPDATE {MainWindow.table}.firmen SET Anzahl_Begleiter = '{newValue}', Bearbeiter = '{Environment.UserName}' WHERE idFirmen = '{id}'");
|
||||||
await SQL.CreateAndWriteSQL($"UPDATE {MainWindow.table}.firmen SET Anzahl_Begleiter = @newValue, Bearbeiter = @UserName WHERE idFirmen = @id", new List<MySqlParameter>()
|
await SQL.CreateAndWriteSQL($"UPDATE {MainWindow.table}.firmen SET Anzahl_Begleiter = @newValue, Bearbeiter = @UserName WHERE idFirmen = @id", new List<MySqlParameter>()
|
||||||
@ -1609,6 +1636,10 @@ namespace ZKuP
|
|||||||
private async void TextBox_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
|
private async void TextBox_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
|
||||||
{
|
{
|
||||||
var textBoxes = Helper.FindVisualChildren<TextBox>(dgFirmen).Where(tb => tb.Name == "tbdgAnzBegleit");
|
var textBoxes = Helper.FindVisualChildren<TextBox>(dgFirmen).Where(tb => tb.Name == "tbdgAnzBegleit");
|
||||||
|
var newValue = (sender as TextBox).Text;
|
||||||
|
var id = ((sender as TextBox).DataContext as DataRowView).Row.ItemArray[0];
|
||||||
|
|
||||||
|
if (oldValue == newValue) return;
|
||||||
|
|
||||||
foreach (var textBox in textBoxes)
|
foreach (var textBox in textBoxes)
|
||||||
{
|
{
|
||||||
@ -1616,25 +1647,35 @@ namespace ZKuP
|
|||||||
textBox.GotKeyboardFocus -= TextBox_GotKeyboardFocus;
|
textBox.GotKeyboardFocus -= TextBox_GotKeyboardFocus;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldValue != (sender as TextBox).Text && !string.IsNullOrWhiteSpace((sender as TextBox).Text))
|
if (oldValue != newValue && !string.IsNullOrWhiteSpace(newValue) && newValue != "0")
|
||||||
{
|
{
|
||||||
if (MessageBox.Show(this, $"Möchten Sie den Eintrag '{oldValue}' in der Spalte 'Anz. Begleitp.' sicher zu '{(sender as TextBox).Text}' ändern?", "Sicher ändern?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) == MessageBoxResult.Yes)
|
if (MessageBox.Show(this, $"Möchten Sie den Eintrag '{oldValue}' in der Spalte 'Anz. Personen' sicher zu '{newValue}' ändern?", "Sicher ändern?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) == MessageBoxResult.Yes)
|
||||||
{
|
{
|
||||||
var tb = sender as TextBox;
|
var tb = sender as TextBox;
|
||||||
DataGridRow dataGridRow = Helper.FindParent<DataGridRow>(tb);
|
DataGridRow dataGridRow = Helper.FindParent<DataGridRow>(tb);
|
||||||
int index = dataGridRow.GetIndex();
|
int index = dataGridRow.GetIndex();
|
||||||
|
|
||||||
var id = (DataGridRow.GetRowContainingElement((sender as TextBox)).Item as DataRowView).Row.ItemArray[0];
|
//var id = (DataGridRow.GetRowContainingElement((sender as TextBox)).Item as DataRowView).Row.ItemArray[0];
|
||||||
//await SQL.WriteSQL($"UPDATE {MainWindow.table}.firmen SET Arbeitsbeginn = '{(sender as DatePicker).SelectedDate.Value.ToString("yyyy-MM-dd")}', Bearbeiter = '{Environment.UserName}' WHERE idFirmen = '{id}'");
|
//await SQL.WriteSQL($"UPDATE {MainWindow.table}.firmen SET Arbeitsbeginn = '{(sender as DatePicker).SelectedDate.Value.ToString("yyyy-MM-dd")}', Bearbeiter = '{Environment.UserName}' WHERE idFirmen = '{id}'");
|
||||||
await SQL.CreateAndWriteSQL($"UPDATE {MainWindow.table}.firmen SET Anzahl_Begleiter = @AnzBegleit, Bearbeiter = @UserName WHERE idFirmen = @id", new List<MySqlParameter>()
|
await SQL.CreateAndWriteSQL($"UPDATE {MainWindow.table}.firmen SET Anzahl_Begleiter = @AnzBegleit, Bearbeiter = @UserName WHERE idFirmen = @id", new List<MySqlParameter>()
|
||||||
{
|
{
|
||||||
new MySqlParameter("@AnzBegleit", (sender as TextBox).Text),
|
new MySqlParameter("@AnzBegleit", newValue),
|
||||||
new MySqlParameter("@UserName", Environment.UserName),
|
new MySqlParameter("@UserName", Environment.UserName),
|
||||||
new MySqlParameter("@id", id)
|
new MySqlParameter("@id", id)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else (sender as TextBox).Text = oldValue;
|
else (sender as TextBox).Text = oldValue;
|
||||||
}
|
}
|
||||||
|
else if (string.IsNullOrWhiteSpace(newValue))
|
||||||
|
{
|
||||||
|
MessageBox.Show("Das Feld 'Anz. Personen' darf nicht leer sein!", "Fehlende Daten", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
(sender as TextBox).Text = oldValue;
|
||||||
|
}
|
||||||
|
else if (newValue == "0")
|
||||||
|
{
|
||||||
|
MessageBox.Show("Das Feld 'Anz. Personen' darf nicht 0 sein!", "Fehlerhafte Daten", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
(sender as TextBox).Text = oldValue;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var textBox in textBoxes)
|
foreach (var textBox in textBoxes)
|
||||||
{
|
{
|
||||||
@ -1643,6 +1684,7 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void dpDataGridArbeitsbeginn_CalendarOpened(object sender, RoutedEventArgs e)
|
private void dpDataGridArbeitsbeginn_CalendarOpened(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
oldValue = (sender as DatePicker).Text;
|
oldValue = (sender as DatePicker).Text;
|
||||||
@ -2023,6 +2065,27 @@ namespace ZKuP
|
|||||||
|
|
||||||
private void ShowExistingFirmen()
|
private void ShowExistingFirmen()
|
||||||
{
|
{
|
||||||
|
if (tbName.Text.ToLower().Contains("bewerb"))
|
||||||
|
{
|
||||||
|
tt.Placement = PlacementMode.RelativePoint;
|
||||||
|
tt.PlacementTarget = tbName;
|
||||||
|
tt.HorizontalOffset = tbName.Width * .75;
|
||||||
|
//tt.VerticalOffset = -(tbName.Height + tt.ActualHeight);
|
||||||
|
tt.Width = tbName.Width * 1.5;
|
||||||
|
tt.Background = new SolidColorBrush(Colors.Red);
|
||||||
|
//tt.StaysOpen = false;
|
||||||
|
tt.Content = new Grid();
|
||||||
|
(tt.Content as Grid).Background = new SolidColorBrush(Colors.DarkBlue);
|
||||||
|
(tt.Content as Grid).Children.Add(new StackPanel());
|
||||||
|
((tt.Content as Grid).Children[0] as StackPanel).Children.Add(new TextBlock()
|
||||||
|
{
|
||||||
|
Text = "Bewerber sind keine Firmen!\n\nBewerber nur als Besucher anlegen!"
|
||||||
|
});
|
||||||
|
|
||||||
|
tt.IsOpen = true;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (tbName.Text.ToLower().StartsWith("fa") || tbName.Text.ToLower().StartsWith("firma"))
|
if (tbName.Text.ToLower().StartsWith("fa") || tbName.Text.ToLower().StartsWith("firma"))
|
||||||
{
|
{
|
||||||
@ -2127,6 +2190,8 @@ namespace ZKuP
|
|||||||
this.LocationChanged -= Window_LocationChanged;
|
this.LocationChanged -= Window_LocationChanged;
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
this.LocationChanged += Window_LocationChanged;
|
this.LocationChanged += Window_LocationChanged;
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2153,13 +2218,15 @@ namespace ZKuP
|
|||||||
|
|
||||||
private void cbBE_MouseEnter(object sender, MouseEventArgs e)
|
private void cbBE_MouseEnter(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
|
Point pos = GetScreenPosition();
|
||||||
|
|
||||||
if (RoleManager.LoggedInRole == Roles.M2 || RoleManager.LoggedInRole == Roles.M2_AM || RoleManager.LoggedInRole == Roles.Admin)
|
if (RoleManager.LoggedInRole == Roles.M2 || RoleManager.LoggedInRole == Roles.M2_AM || RoleManager.LoggedInRole == Roles.Admin)
|
||||||
{
|
{
|
||||||
if ((cbBE.Items).Count > 0)
|
if ((cbBE.Items).Count > 0)
|
||||||
{
|
{
|
||||||
M2WithGebuchterBETooltipPopup.PlacementTarget = sender as Grid;
|
M2WithGebuchterBETooltipPopup.Placement = PlacementMode.AbsolutePoint;
|
||||||
M2WithGebuchterBETooltipPopup.Placement = PlacementMode.Mouse;
|
M2WithGebuchterBETooltipPopup.VerticalOffset = pos.Y + 20;
|
||||||
//M2WithGebuchterBETooltipPopup.IsOpen = true;
|
M2WithGebuchterBETooltipPopup.HorizontalOffset = pos.X + 20;
|
||||||
|
|
||||||
// Popup-Zustand komplett zurücksetzen
|
// Popup-Zustand komplett zurücksetzen
|
||||||
M2WithGebuchterBETooltipPopup.IsOpen = false;
|
M2WithGebuchterBETooltipPopup.IsOpen = false;
|
||||||
@ -2179,9 +2246,12 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
M2WithoutGebuchterBETooltipPopup.PlacementTarget = sender as Grid;
|
|
||||||
M2WithoutGebuchterBETooltipPopup.Placement = PlacementMode.Mouse;
|
M2WithoutGebuchterBETooltipPopup.Placement = PlacementMode.AbsolutePoint;
|
||||||
//M2WithoutGebuchterBETooltipPopup.IsOpen = true;
|
M2WithoutGebuchterBETooltipPopup.VerticalOffset = pos.Y + 20;
|
||||||
|
M2WithoutGebuchterBETooltipPopup.HorizontalOffset = pos.X + 20;
|
||||||
|
|
||||||
|
|
||||||
// Popup-Zustand komplett zurücksetzen
|
// Popup-Zustand komplett zurücksetzen
|
||||||
M2WithoutGebuchterBETooltipPopup.IsOpen = false;
|
M2WithoutGebuchterBETooltipPopup.IsOpen = false;
|
||||||
M2WithoutGebuchterBETooltipPopup.UpdateLayout();
|
M2WithoutGebuchterBETooltipPopup.UpdateLayout();
|
||||||
@ -2200,16 +2270,93 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NotM2TooltipPopup.PlacementTarget = sender as Grid;
|
NotM2TooltipPopup.Placement = PlacementMode.AbsolutePoint;
|
||||||
NotM2TooltipPopup.Placement = PlacementMode.Mouse;
|
NotM2TooltipPopup.VerticalOffset = pos.Y + 20;
|
||||||
|
NotM2TooltipPopup.HorizontalOffset = pos.X + 20;
|
||||||
|
|
||||||
NotM2TooltipPopup.IsOpen = true;
|
NotM2TooltipPopup.IsOpen = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
|
private static extern bool GetCursorPos(out POINT lpPoint);
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
private struct POINT
|
||||||
|
{
|
||||||
|
public int X;
|
||||||
|
public int Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Point GetScreenPosition()
|
||||||
|
{
|
||||||
|
GetCursorPos(out POINT p);
|
||||||
|
return new Point(p.X, p.Y);
|
||||||
|
}
|
||||||
|
|
||||||
private void TooltipPopup_Closed(object sender, EventArgs e)
|
private void TooltipPopup_Closed(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
popCloseTimer.Stop();
|
popCloseTimer.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void btnDelBE_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var btn = sender as Button;
|
||||||
|
DataGridRow dataGridRow = Helper.FindParent<DataGridRow>(btn);
|
||||||
|
//int index = dataGridRow.GetIndex();
|
||||||
|
var be = ((System.Data.DataRowView)dataGridRow.DataContext).Row.ItemArray[15].ToString();
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(be))
|
||||||
|
{
|
||||||
|
var id = ((System.Data.DataRowView)dataGridRow.DataContext).Row.ItemArray[0];
|
||||||
|
|
||||||
|
if (MessageBoxResult.Yes == MessageBox.Show($"Möchten Sie die eingetragene BE Fläche {be} der Firma {((System.Data.DataRowView)dataGridRow.DataContext).Row.ItemArray[1]} wirklich entfernen?", "BE Fläche entfernen", MessageBoxButton.YesNoCancel, MessageBoxImage.Question))
|
||||||
|
{
|
||||||
|
SQL.CreateAndWriteSQL($"UPDATE {MainWindow.table}.firmen SET BE = @box,BEint = @box_SelectedIndex, Bearbeiter = @UserName WHERE idfirmen = @id", new List<MySqlParameter>()
|
||||||
|
{
|
||||||
|
new MySqlParameter("@box", ""),
|
||||||
|
new MySqlParameter("@box_SelectedIndex", -1),
|
||||||
|
new MySqlParameter("@UserName", Environment.UserName),
|
||||||
|
new MySqlParameter("@id", id)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
updateList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//private void btnDelBE_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
//{
|
||||||
|
// var btn = sender as Button;
|
||||||
|
// var arr = (btn.DataContext as DataRowView).Row.ItemArray;
|
||||||
|
// var user = arr[13].ToString();
|
||||||
|
// var be = arr[15].ToString();
|
||||||
|
|
||||||
|
// btn.Visibility = Visibility.Collapsed;
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
private void M2WithoutGebuchterBETooltipPopup_MouseLeave(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
(sender as Popup).IsOpen = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void M2WithoutGebuchterBETooltipPopup_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
(sender as Popup).IsOpen = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NotM2TooltipPopup_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
(sender as Popup).IsOpen = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void M2WithGebuchterBETooltipPopup_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
(sender as Popup).IsOpen = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//public class Firma
|
//public class Firma
|
||||||
|
|||||||
@ -149,6 +149,8 @@ namespace ZKuP
|
|||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
private void Window_LocationChanged(object sender, EventArgs e)
|
||||||
|
|||||||
@ -75,13 +75,5 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//public static void createCryptoStrings()
|
|
||||||
//{
|
|
||||||
// Debug.WriteLine($"ip: {Crypto.Encrypt(Crypto.GetHashKey("25F2B0D01752AE26E3F67EED9824A3C6"), "10.20.98.34")}");
|
|
||||||
// Debug.WriteLine($"uid: {Crypto.Encrypt(Crypto.GetHashKey("B0B51FB2C09E99976749EA4EEF0AD754"), "ZK")}");
|
|
||||||
// Debug.WriteLine($"pwd: {Crypto.Encrypt(Crypto.GetHashKey("B73DD0426C4D45BFE20E0C70E72CCF13"), "ZKUser#2001")}");
|
|
||||||
// Debug.WriteLine($"db: {Crypto.Encrypt(Crypto.GetHashKey("3C2F062772F4D4348C8BAFB3B8F4BE80"), "zkup")}");
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -310,6 +310,8 @@ namespace ZKuP
|
|||||||
|
|
||||||
|
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -507,7 +509,6 @@ namespace ZKuP
|
|||||||
|
|
||||||
await SQL.CreateAndWriteSQLwithSignature(cmd, _signature);
|
await SQL.CreateAndWriteSQLwithSignature(cmd, _signature);
|
||||||
//await SQL.WriteSQL(query, _signature);
|
//await SQL.WriteSQL(query, _signature);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -179,6 +179,8 @@ namespace ZKuP
|
|||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
private void Window_LocationChanged(object sender, EventArgs e)
|
||||||
|
|||||||
@ -77,7 +77,7 @@ namespace ZKuP
|
|||||||
$"E-Mail: {Email}%0D%0A" +
|
$"E-Mail: {Email}%0D%0A" +
|
||||||
$"Firma: {Firma}%0D%0A%0D%0A" +
|
$"Firma: {Firma}%0D%0A%0D%0A" +
|
||||||
$"%0D%0A%0D%0A" +
|
$"%0D%0A%0D%0A" +
|
||||||
$"Parkkarten können in ca. 5 Tagen im Gebäude G Raum G0006/7 abgeholt werden.%0D%0A" +
|
$"Sie erhalten eine weitere Email wenn der Ausweis abholbereit ist.%0D%0A" +
|
||||||
"Mit freundlichen Grüßen%0D%0A" +
|
"Mit freundlichen Grüßen%0D%0A" +
|
||||||
$"Ihr Anlagenmanagement");
|
$"Ihr Anlagenmanagement");
|
||||||
break;
|
break;
|
||||||
|
|||||||
334
ZKuP/Helper.cs
334
ZKuP/Helper.cs
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
//using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Ports;
|
using System.IO.Ports;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -821,36 +822,52 @@ namespace ZKuP
|
|||||||
|
|
||||||
static double lastDpiScale = -1;
|
static double lastDpiScale = -1;
|
||||||
static bool _isCurrentlyScaled = false;
|
static bool _isCurrentlyScaled = false;
|
||||||
internal static async void CheckScale(Window mainWindow)
|
internal static async void CheckScaleOld(Window mainWindow)
|
||||||
{
|
{
|
||||||
if (!(width == 0 || height == 0))
|
if (!(width == 0 || height == 0))
|
||||||
{
|
{
|
||||||
var dpi = VisualTreeHelper.GetDpi(mainWindow);
|
var dpi = VisualTreeHelper.GetDpi(mainWindow);
|
||||||
|
Log.WriteLog("dpiscale:" + dpi.DpiScaleX.ToString() + " " + dpi.DpiScaleY.ToString());
|
||||||
double dpiScale = dpi.DpiScaleX; // or DpiScaleY
|
double dpiScale = dpi.DpiScaleX; // or DpiScaleY
|
||||||
|
|
||||||
|
|
||||||
double scaledWidth = width * dpiScale;
|
double scaledWidth = width * dpiScale;
|
||||||
double scaledHeight = height * dpiScale;
|
double scaledHeight = height * dpiScale;
|
||||||
|
|
||||||
|
Log.WriteLog($"widthHeight: {width} {height}");
|
||||||
|
Log.WriteLog($"scaled: {scaledWidth} {scaledHeight}");
|
||||||
|
|
||||||
var screen = WpfScreenHelper.Screen.FromHandle(new WindowInteropHelper(mainWindow).Handle);
|
var screen = WpfScreenHelper.Screen.FromHandle(new WindowInteropHelper(mainWindow).Handle);
|
||||||
var workingArea = screen.WorkingArea;
|
var workingArea = screen.WorkingArea;
|
||||||
|
|
||||||
|
|
||||||
|
Log.WriteLog($"workingArea: {workingArea.Width} {workingArea.Height}");
|
||||||
|
|
||||||
bool needsScaling = (width * dpiScale) > workingArea.Width || (height * dpiScale) > workingArea.Height;
|
bool needsScaling = (width * dpiScale) > workingArea.Width || (height * dpiScale) > workingArea.Height;
|
||||||
|
|
||||||
lastDpiScale = dpiScale;
|
lastDpiScale = dpiScale;
|
||||||
|
|
||||||
if (needsScaling && !_isCurrentlyScaled)
|
if (needsScaling && !_isCurrentlyScaled)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Log.WriteLog($"needsScaling: {needsScaling}");
|
||||||
// Calculate the scale to fit in working area
|
// Calculate the scale to fit in working area
|
||||||
double scaleX = width / workingArea.Width;
|
double scaleX = width / workingArea.Width;
|
||||||
double scaleY = height / workingArea.Height;
|
double scaleY = height / workingArea.Height;
|
||||||
scale = Math.Min(scaleX, scaleY);
|
scale = Math.Min(scaleX, scaleY);
|
||||||
|
Log.WriteLog($"scale1: {scale}");
|
||||||
|
Log.WriteLog($"scaleRound: {Math.Round(scale * 4,1)}");
|
||||||
|
|
||||||
scale = Math.Round(scale * 4) / 4.0;
|
scale = Math.Round(scale / 0.25,1) * 0.25;
|
||||||
|
|
||||||
|
|
||||||
|
Log.WriteLog($"scaleXY: {scaleX} {scaleY}");
|
||||||
|
Log.WriteLog($"scale2: {scale}");
|
||||||
|
|
||||||
mainWindow.MinWidth = scale * width;
|
mainWindow.MinWidth = scale * width;
|
||||||
mainWindow.MinHeight = scale * height;
|
mainWindow.MinHeight = scale * height;
|
||||||
mainWindow.LayoutTransform = new ScaleTransform(scale, scale);
|
mainWindow.LayoutTransform = new ScaleTransform(scale, scale);
|
||||||
|
Log.WriteLog($"Min: {mainWindow.MinWidth} {mainWindow.MinHeight}");
|
||||||
|
|
||||||
|
|
||||||
mainWindow.Width = mainWindow.MinWidth;
|
mainWindow.Width = mainWindow.MinWidth;
|
||||||
@ -876,55 +893,228 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//public static SerialPort serial = new SerialPort();
|
// Zustand pro Window (speichert Originalwerte + Flags)
|
||||||
//static bool serialInitialized = false;
|
internal class WindowState
|
||||||
//public static void InitSerial(string COM = "", bool forced = false)
|
{
|
||||||
//{
|
public double OrigWidth;
|
||||||
// if (!serialInitialized || forced)
|
public double OrigHeight;
|
||||||
// {
|
public double OrigMinWidth;
|
||||||
// if (COM == "" && string.IsNullOrWhiteSpace(Settings.GetSettingString("COMPort")) && GetCOMPortCount() > 0)
|
public double OrigMinHeight;
|
||||||
// {
|
public bool WasWidthAuto;
|
||||||
// COMSelector cOMSelector = new COMSelector();
|
public bool WasHeightAuto;
|
||||||
// cOMSelector.ShowDialog();
|
|
||||||
// }
|
|
||||||
// else if (COM != "")
|
|
||||||
// {
|
|
||||||
// var match = Regex.Match(COM, @"COM\d+(?=\))");
|
|
||||||
// Settings.WriteSetting("COMPort", match.Value);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (forced && serial.IsOpen) { serial.Close(); }
|
public double CurrentScale = 1.0;
|
||||||
|
public bool IsUpdating = false; // true while we programmatically change size/transform
|
||||||
|
public bool UserResized = false; // true if user manually resized the window
|
||||||
|
}
|
||||||
|
|
||||||
// if (!serial.IsOpen)
|
internal static readonly Dictionary<Window, WindowState> _states = new Dictionary<Window, WindowState>();
|
||||||
// {
|
|
||||||
// try
|
internal static void AttachSizeHandlers(MainWindow mainWindow)
|
||||||
// {
|
{
|
||||||
// var port = Settings.GetSettingString("COMPort");
|
if (!_states.ContainsKey(mainWindow))
|
||||||
// if (!string.IsNullOrWhiteSpace(port))
|
{
|
||||||
// {
|
_states[mainWindow] = new WindowState();
|
||||||
// serial.PortName = port; //Com Port Name
|
// subscribe once
|
||||||
// serial.BaudRate = Convert.ToInt32(9600); //COM Port Sp
|
mainWindow.SizeChanged += MainWindow_SizeChanged;
|
||||||
// serial.Handshake = System.IO.Ports.Handshake.None;
|
mainWindow.Closed += (s, e) =>
|
||||||
// serial.Parity = Parity.None;
|
{
|
||||||
// serial.DataBits = 8;
|
// cleanup on close
|
||||||
// serial.StopBits = StopBits.One;
|
mainWindow.SizeChanged -= MainWindow_SizeChanged;
|
||||||
// serial.ReadTimeout = 200;
|
_states.Remove(mainWindow);
|
||||||
// serial.WriteTimeout = 50;
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (!(sender is Window w)) return;
|
||||||
|
if (!Helper._states.TryGetValue(w, out var st)) return;
|
||||||
|
|
||||||
|
// wenn wir gerade selber schreiben, ignorieren
|
||||||
|
if (st.IsUpdating) return;
|
||||||
|
|
||||||
|
// Benutzer hat vermutlich die Größe geändert -> merken und aktualisieren die "Original"-Größe
|
||||||
|
st.UserResized = true;
|
||||||
|
|
||||||
|
// Wenn aktuell skaliert (CurrentScale != 0), speichern wir die unskalierte Originalgröße:
|
||||||
|
// Die sichtbare Width ist die tatsächlich gesetzte Width (programmgesteuert oder user).
|
||||||
|
// Um die "Original"-unskalierte Größe zu erhalten dividieren wir durch CurrentScale.
|
||||||
|
var scale = st.CurrentScale;
|
||||||
|
if (scale <= 0) scale = 1.0;
|
||||||
|
|
||||||
|
// Wenn Width/Height sind NaN (Auto), ActualWidth/ActualHeight sind zuverlässiger.
|
||||||
|
double actualW = double.IsNaN(w.Width) ? w.ActualWidth : w.Width;
|
||||||
|
double actualH = double.IsNaN(w.Height) ? w.ActualHeight : w.Height;
|
||||||
|
|
||||||
|
st.OrigWidth = actualW / scale;
|
||||||
|
st.OrigHeight = actualH / scale;
|
||||||
|
|
||||||
|
// optional: aktualisiere auch Min-Werte, falls sinnvoll
|
||||||
|
st.OrigMinWidth = w.MinWidth / scale;
|
||||||
|
st.OrigMinHeight = w.MinHeight / scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void CheckScale(MainWindow mainWindow)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// ensure we have handlers/state (AttachSizeHandlers registriert SizeChanged und Closed)
|
||||||
|
AttachSizeHandlers(mainWindow);
|
||||||
|
|
||||||
|
// Hole Screen / DPI
|
||||||
|
var screen = WpfScreenHelper.Screen.FromHandle(new WindowInteropHelper(mainWindow).Handle);
|
||||||
|
const double _fillRatio = 0.8; // 80% des verfügbaren Platzes
|
||||||
|
|
||||||
|
// Falls content width/height (deine Variablen) nicht gesetzt sind -> abbrechen
|
||||||
|
if (width <= 0 || height <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var source = PresentationSource.FromVisual(mainWindow);
|
||||||
|
double dpiScaleX = 1.0, dpiScaleY = 1.0;
|
||||||
|
if (source?.CompositionTarget != null)
|
||||||
|
{
|
||||||
|
var m = source.CompositionTarget.TransformToDevice;
|
||||||
|
dpiScaleX = m.M11;
|
||||||
|
dpiScaleY = m.M22;
|
||||||
|
}
|
||||||
|
|
||||||
|
var wa = screen.WorkingArea; // in device pixels
|
||||||
|
double availWidthDip = wa.Width / dpiScaleX;
|
||||||
|
double availHeightDip = wa.Height / dpiScaleY;
|
||||||
|
|
||||||
|
// gewünschte Zielgröße (80% des Arbeitsbereichs)
|
||||||
|
double targetWidth = availWidthDip * _fillRatio;
|
||||||
|
double targetHeight = availHeightDip * _fillRatio;
|
||||||
|
|
||||||
|
// absolute Obergrenzen für Min-Size
|
||||||
|
const double ABS_MAX_MIN_WIDTH = 1680.0;
|
||||||
|
const double ABS_MAX_MIN_HEIGHT = 675.0;
|
||||||
|
|
||||||
|
// gewünschte Minima (80% capped)
|
||||||
|
double desiredMinWidth = Math.Min(targetWidth, ABS_MAX_MIN_WIDTH);
|
||||||
|
double desiredMinHeight = Math.Min(targetHeight, ABS_MAX_MIN_HEIGHT);
|
||||||
|
|
||||||
|
// setze Minima IMMER bei Skalierungsberechnung (Anforderung)
|
||||||
|
mainWindow.MinWidth = Math.Max(1.0, desiredMinWidth);
|
||||||
|
mainWindow.MinHeight = Math.Max(1.0, desiredMinHeight);
|
||||||
|
|
||||||
|
// berechne scale basierend auf Content-Größe (width/height sind deine Content-DIPs)
|
||||||
|
double contentWidth = width;
|
||||||
|
double contentHeight = height;
|
||||||
|
|
||||||
|
double scaleX = targetWidth / contentWidth;
|
||||||
|
double scaleY = targetHeight / contentHeight;
|
||||||
|
double scale = Math.Min(scaleX, scaleY);
|
||||||
|
if (scale <= 0) scale = 0.1;
|
||||||
|
|
||||||
|
// hole oder erzeuge State für das Window
|
||||||
|
if (!_states.TryGetValue(mainWindow, out var state))
|
||||||
|
{
|
||||||
|
state = new WindowState();
|
||||||
|
_states[mainWindow] = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wenn scale ~ 1 => Reset auf Identity-Transform (aber Minima bleiben gesetzt wie oben)
|
||||||
|
if (scale >= 0.9999)
|
||||||
|
{
|
||||||
|
state.IsUpdating = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Rücksetzen des Transforms
|
||||||
|
mainWindow.LayoutTransform = new ScaleTransform(1.0, 1.0);
|
||||||
|
state.CurrentScale = 1.0;
|
||||||
|
|
||||||
|
// Wenn wir Orig-Werte haben und der Benutzer NICHT manuell resized hat, restore original sizes.
|
||||||
|
// Wenn Benutzer resized hat, respektiere seine Größe (do nothing).
|
||||||
|
if (!state.UserResized && state.OrigWidth > 0 && state.OrigHeight > 0)
|
||||||
|
{
|
||||||
|
if (state.WasWidthAuto)
|
||||||
|
mainWindow.ClearValue(Window.WidthProperty);
|
||||||
|
else
|
||||||
|
mainWindow.Width = state.OrigWidth;
|
||||||
|
|
||||||
|
if (state.WasHeightAuto)
|
||||||
|
mainWindow.ClearValue(Window.HeightProperty);
|
||||||
|
else
|
||||||
|
mainWindow.Height = state.OrigHeight;
|
||||||
|
|
||||||
|
// Restore Minima (unskaliert originals) falls gewünscht; wir haben jedoch die Minima bereits oben gesetzt.
|
||||||
|
mainWindow.MinWidth = Math.Max(1.0, state.OrigMinWidth);
|
||||||
|
mainWindow.MinHeight = Math.Max(1.0, state.OrigMinHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
// optional: wenn du möchtest, dass nach Reset die UserResized-Markierung gelöscht wird, entkommentiere:
|
||||||
|
// state.UserResized = false;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
state.IsUpdating = false;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- APPLY SCALE: falls noch keine Orig-Werte gespeichert, speichern (nur einmal)
|
||||||
|
if (state.OrigWidth <= 0 || state.OrigHeight <= 0)
|
||||||
|
{
|
||||||
|
state.WasWidthAuto = double.IsNaN(mainWindow.Width);
|
||||||
|
state.WasHeightAuto = double.IsNaN(mainWindow.Height);
|
||||||
|
|
||||||
|
state.OrigWidth = state.WasWidthAuto ? mainWindow.ActualWidth : mainWindow.Width;
|
||||||
|
state.OrigHeight = state.WasHeightAuto ? mainWindow.ActualHeight : mainWindow.Height;
|
||||||
|
state.OrigMinWidth = mainWindow.MinWidth;
|
||||||
|
state.OrigMinHeight = mainWindow.MinHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply transform + Minima (Minima bereits gesetzt, aber setze nochmal relativ zu OrigMin falls sinnvoll)
|
||||||
|
state.IsUpdating = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
mainWindow.LayoutTransform = new ScaleTransform(scale, scale);
|
||||||
|
state.CurrentScale = scale;
|
||||||
|
|
||||||
|
// Minima: setze relativ zu originalen unskalierten Minima, aber respektiere die Cap die oben gesetzt wurde.
|
||||||
|
double minWFromOrig = Math.Max(1.0, state.OrigMinWidth * scale);
|
||||||
|
double minHFromOrig = Math.Max(1.0, state.OrigMinHeight * scale);
|
||||||
|
|
||||||
|
// final minima: wir wollen immer MIN(avail*0.8, ABS_MAX) — bereits oben berechnet.
|
||||||
|
// damit keine Widersprüche, wähle das größere der beiden (damit Min ist nicht kleiner als orig*scale)
|
||||||
|
mainWindow.MinWidth = Math.Max(mainWindow.MinWidth, minWFromOrig);
|
||||||
|
mainWindow.MinHeight = Math.Max(mainWindow.MinHeight, minHFromOrig);
|
||||||
|
|
||||||
|
// Width/Height nur setzen, wenn Benutzer nicht manuell geändert hat
|
||||||
|
if (!state.UserResized)
|
||||||
|
{
|
||||||
|
if (state.WasWidthAuto)
|
||||||
|
mainWindow.Width = Math.Max(1.0, state.OrigWidth * scale);
|
||||||
|
else
|
||||||
|
mainWindow.Width = state.OrigWidth * scale;
|
||||||
|
|
||||||
|
if (state.WasHeightAuto)
|
||||||
|
mainWindow.Height = Math.Max(1.0, state.OrigHeight * scale);
|
||||||
|
else
|
||||||
|
mainWindow.Height = state.OrigHeight * scale;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Benutzer hat manuell resizet — wir respektieren die aktuelle Größe.
|
||||||
|
// Optional: ensure current size is not larger than available area:
|
||||||
|
// double curW = double.IsNaN(mainWindow.Width) ? mainWindow.ActualWidth : mainWindow.Width;
|
||||||
|
// if (curW > availWidthDip) mainWindow.Width = availWidthDip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
state.IsUpdating = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine("AdaptiveWindowScaler.CheckScale error: " + ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// serial.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(OnDataReceived);
|
|
||||||
// serial.Open();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// catch (Exception ex)
|
|
||||||
// {
|
|
||||||
// MessageBox.Show("Fehler beim Öffnen des COM Ports\nKartenleser kann nicht aktiviert werden\n\nBitte Kartenleser anstecken oder anderen COM Port versuchen", "Fehler beim COM Port", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
// Log.WriteLog(ex.ToString());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// serialInitialized = true;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
public static int GetCOMPortCount()
|
public static int GetCOMPortCount()
|
||||||
{
|
{
|
||||||
@ -1011,7 +1201,15 @@ namespace ZKuP
|
|||||||
//return null; // or IPAddress.None if you prefer
|
//return null; // or IPAddress.None if you prefer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static DataGridRow GetParentRowFromButton(object sender)
|
||||||
|
{
|
||||||
|
var depObj = sender as DependencyObject;
|
||||||
|
while (depObj != null && !(depObj is DataGridRow))
|
||||||
|
{
|
||||||
|
depObj = VisualTreeHelper.GetParent(depObj);
|
||||||
|
}
|
||||||
|
return depObj as DataGridRow;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static Mutex _mutex;
|
private static Mutex _mutex;
|
||||||
@ -1272,6 +1470,19 @@ namespace ZKuP
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
public class NullToEnabledConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||||
|
{
|
||||||
|
// Wenn value null ist -> sichtbar (Collapsed), sonst Hidden oder Visible
|
||||||
|
return string.IsNullOrWhiteSpace(value.ToString()) ? false : true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class NullToVisibilityConverter : IValueConverter
|
public class NullToVisibilityConverter : IValueConverter
|
||||||
{
|
{
|
||||||
@ -1499,6 +1710,33 @@ namespace ZKuP
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class NameToEmailConverter : IMultiValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||||
|
{
|
||||||
|
if (values == null || values.Length != 2)
|
||||||
|
return string.Empty;
|
||||||
|
|
||||||
|
string vorname = values[0]?.ToString()?.Trim() ?? string.Empty;
|
||||||
|
string nachname = values[1]?.ToString()?.Trim() ?? string.Empty;
|
||||||
|
|
||||||
|
//if (string.IsNullOrWhiteSpace(vorname) || string.IsNullOrWhiteSpace(nachname))
|
||||||
|
// return string.Empty;
|
||||||
|
|
||||||
|
return $"{vorname.ToLower()}.{nachname.ToLower()}@deutschebahn.com";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class ComboBoxDisplayConverter : IValueConverter
|
public class ComboBoxDisplayConverter : IValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
<RadioButton Content="Zutritte" Margin="5" Checked="RadioButton_Checked" IsChecked="True"/>
|
<RadioButton Content="Zutritte" Margin="5" Checked="RadioButton_Checked" IsChecked="True"/>
|
||||||
<RadioButton Content="Karten" Margin="5" Checked="RadioButton_Checked"/>
|
<RadioButton Content="Karten" Margin="5" Checked="RadioButton_Checked"/>
|
||||||
<RadioButton Content="McFit" Margin="5" Checked="RadioButton_Checked"/>
|
<RadioButton Content="McFit" Margin="5" Checked="RadioButton_Checked"/>
|
||||||
|
<RadioButton Content="MA Gast" Margin="5" Checked="RadioButton_Checked"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using MahApps.Metro.Controls;
|
using MahApps.Metro.Controls;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -27,7 +28,8 @@ namespace ZKuP
|
|||||||
{
|
{
|
||||||
Zutritte,
|
Zutritte,
|
||||||
Karten,
|
Karten,
|
||||||
McFit
|
McFit,
|
||||||
|
GastkartenMA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -84,6 +86,7 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bitmap j = null;
|
||||||
private void cBSignature_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void cBSignature_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
switch (category)
|
switch (category)
|
||||||
@ -106,6 +109,20 @@ namespace ZKuP
|
|||||||
{
|
{
|
||||||
var i = SQL.ReadSingleByteArr($"SELECT Signature FROM {MainWindow.table}.kartenLog WHERE benutzer = '{cBSignature.SelectedItem.ToString().Split(';')[1]}' AND AusgegebenTimestamp = '{cBSignature.SelectedItem.ToString().Split(';')[0]}'");
|
var i = SQL.ReadSingleByteArr($"SELECT Signature FROM {MainWindow.table}.kartenLog WHERE benutzer = '{cBSignature.SelectedItem.ToString().Split(';')[1]}' AND AusgegebenTimestamp = '{cBSignature.SelectedItem.ToString().Split(';')[0]}'");
|
||||||
|
|
||||||
|
if (i != null)
|
||||||
|
{
|
||||||
|
imageSignature.Source = Helper.ConvertBitmapToImage(i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
imageSignature.Source = new BitmapImage(new Uri(@"/Resources/NoSignature.png", UriKind.Relative));
|
||||||
|
MessageBox.Show(this, "Keine Unterschrift vorhanden!", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Categories.McFit:
|
||||||
|
if (cBSignature.SelectedItem != null && cBSignature.SelectedIndex != -1)
|
||||||
|
{
|
||||||
|
var i = SQL.ReadSingleByteArr($"SELECT Signature FROM {MainWindow.table}.mcFitLog WHERE Nachname = '{cBSignature.SelectedItem.ToString().Split(';')[1]}' AND AusgabeTimestamp = '{cBSignature.SelectedItem.ToString().Split(';')[0]}'");
|
||||||
|
|
||||||
|
|
||||||
if (i != null)
|
if (i != null)
|
||||||
imageSignature.Source = Helper.ConvertBitmapToImage(i);
|
imageSignature.Source = Helper.ConvertBitmapToImage(i);
|
||||||
@ -114,10 +131,10 @@ namespace ZKuP
|
|||||||
//MessageBox.Show(this, "Keine Unterschrift vorhanden!", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
//MessageBox.Show(this, "Keine Unterschrift vorhanden!", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Categories.McFit:
|
case Categories.GastkartenMA:
|
||||||
if (cBSignature.SelectedItem != null && cBSignature.SelectedIndex != -1)
|
if (cBSignature.SelectedItem != null && cBSignature.SelectedIndex != -1)
|
||||||
{
|
{
|
||||||
var i = SQL.ReadSingleByteArr($"SELECT Signature FROM {MainWindow.table}.mcFitLog WHERE Nachname = '{cBSignature.SelectedItem.ToString().Split(';')[1]}' AND AusgabeTimestamp = '{cBSignature.SelectedItem.ToString().Split(';')[0]}'");
|
var i = SQL.ReadSingleByteArr($"SELECT Signature_blob FROM {MainWindow.table}.lostCard WHERE MitarbeiterNachname = '{cBSignature.SelectedItem.ToString().Split(';')[1]}' AND AusgegebenTimestamp = '{cBSignature.SelectedItem.ToString().Split(';')[0]}'");
|
||||||
|
|
||||||
|
|
||||||
if (i != null)
|
if (i != null)
|
||||||
@ -343,6 +360,12 @@ namespace ZKuP
|
|||||||
list = await SQL.ReadDateTimeAndStringList($"SELECT AusgabeTimestamp,Nachname FROM {MainWindow.table}.mcFitLog WHERE AusgabeTimestamp IS NOT NULL");
|
list = await SQL.ReadDateTimeAndStringList($"SELECT AusgabeTimestamp,Nachname FROM {MainWindow.table}.mcFitLog WHERE AusgabeTimestamp IS NOT NULL");
|
||||||
list = list.OrderByDescending(p => p).ToList();
|
list = list.OrderByDescending(p => p).ToList();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "MA Gast":
|
||||||
|
category = Categories.GastkartenMA;
|
||||||
|
list = await SQL.ReadDateTimeAndStringList($"SELECT AusgegebenTimestamp,MitarbeiterNachname FROM {MainWindow.table}.lostCard");
|
||||||
|
list = list.OrderByDescending(p => p).ToList();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -209,6 +209,8 @@ namespace ZKuP
|
|||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
private void Window_LocationChanged(object sender, EventArgs e)
|
||||||
|
|||||||
64
ZKuP/LeihausweisAusgeben.xaml
Normal file
64
ZKuP/LeihausweisAusgeben.xaml
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<mah:MetroWindow x:Class="ZKuP.LeihausweisAusgeben"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
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:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||||||
|
xmlns:local="clr-namespace:ZKuP"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Leihausweis ausgeben" Height="450" Width="1200" Closing="MetroWindow_Closing">
|
||||||
|
<Grid>
|
||||||
|
<DataGrid x:Name="dgLostCards" AutoGenerateColumns="False" ItemsSource="{Binding .}" CanUserAddRows="False">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="Vorname" Binding="{Binding MitarbeiterVorname}" Width="*" MinWidth="100"/>
|
||||||
|
<DataGridTextColumn Header="Nachname" Binding="{Binding MitarbeiterNachname}" Width="*" MinWidth="100"/>
|
||||||
|
<DataGridTextColumn Header="Abteilung" Binding="{Binding Abteilung}"/>
|
||||||
|
<DataGridTextColumn Header="Antrag vom" SortDirection="Descending" Binding="{Binding TimestampAntrag, StringFormat=\{0:dd.MM.yyyy HH:mm:ss\}}"/>
|
||||||
|
<DataGridCheckBoxColumn Header="Karte ist ausgegeben?" Binding="{Binding Ausgegeben}"/>
|
||||||
|
<DataGridTextColumn Header="Karte" Binding="{Binding Kartennummer}"/>
|
||||||
|
<DataGridTextColumn Header="Ausgegeben am" Binding="{Binding AusgegebenTimestamp, StringFormat=\{0:dd.MM.yyyy HH:mm:ss\}}"/>
|
||||||
|
<DataGridTextColumn Header="Ausgegeben durch" Binding="{Binding AusgegebenDurch}"/>
|
||||||
|
<DataGridTemplateColumn Header="Ausgeben" Width="90">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Button Click="Button_Click">
|
||||||
|
<Button.Content>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Karte" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Text="ausgeben" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Header="Rückgabe" Width="120">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Button Click="ButtonRueck_Click">
|
||||||
|
<Button.Content>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Karte" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Text="zurückgegeben" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
|
||||||
|
<Popup PopupAnimation="Fade" AllowsTransparency="True" StaysOpen="False" x:Name="popupCardNr">
|
||||||
|
<Border Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="LightGray" CornerRadius="3" BorderThickness="1">
|
||||||
|
<StackPanel Margin="0" Orientation="Vertical" >
|
||||||
|
<TextBlock Text="Karte einscannen/eintragen" Margin="5" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" HorizontalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="tbNr" Margin="5"/>
|
||||||
|
<Border BorderBrush="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderThickness="1" CornerRadius="3">
|
||||||
|
<Button Content="Karte ausgeben" HorizontalAlignment="Stretch" Margin="0,5,0,0" VerticalAlignment="Bottom" Click="btnAusgeben_Click"/>
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</Popup>
|
||||||
|
</Grid>
|
||||||
|
</mah:MetroWindow>
|
||||||
136
ZKuP/LeihausweisAusgeben.xaml.cs
Normal file
136
ZKuP/LeihausweisAusgeben.xaml.cs
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
using MahApps.Metro.Controls;
|
||||||
|
using MySql.Data.MySqlClient;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
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.Shapes;
|
||||||
|
|
||||||
|
namespace ZKuP
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaktionslogik für LeihausweisAusgeben.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class LeihausweisAusgeben : MetroWindow
|
||||||
|
{
|
||||||
|
DataTable dtLostCards = new DataTable("LostCards");
|
||||||
|
private CardReaderViewModel _cardReader;
|
||||||
|
Button btnRow;
|
||||||
|
|
||||||
|
public LeihausweisAusgeben()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
updateList();
|
||||||
|
|
||||||
|
_cardReader = new CardReaderViewModel();
|
||||||
|
_cardReader.CardDetected += OnCardDetected;
|
||||||
|
_cardReader.StartListening(Settings.GetSettingString("COMPort"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateList()
|
||||||
|
{
|
||||||
|
dtLostCards = SQL.ReadSQL($"SELECT * FROM {MainWindow.table}.lostCard WHERE Zurueckgegeben = 0", dtLostCards).Result;
|
||||||
|
dgLostCards.DataContext = dtLostCards;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
popupCardNr.Placement = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
|
||||||
|
popupCardNr.IsOpen = true;
|
||||||
|
tbNr.Focus();
|
||||||
|
btnRow = sender as Button;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnAusgeben_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
//Signature abfragen
|
||||||
|
if (!string.IsNullOrWhiteSpace(tbNr.Text))
|
||||||
|
{
|
||||||
|
if(tbNr.Text.Length != 19)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Kartennummer muss 19 Stellen haben!", "Fehlerhafte Nummer", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var arr = ((Helper.GetParentRowFromButton(btnRow) as DataGridRow).DataContext as DataRowView).Row.ItemArray;
|
||||||
|
|
||||||
|
byte[] _signature = null;
|
||||||
|
|
||||||
|
var sig = new Signature(Signature.DisclaimerType.LostCard, $"{arr[1]} {arr[2]}", arr[3].ToString());
|
||||||
|
if (sig.ShowDialog() == false)
|
||||||
|
{
|
||||||
|
if (sig.ResultByte != null)
|
||||||
|
{
|
||||||
|
_signature = sig.ResultByte;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Keine Unterschrift, erneut versuchen", "Keine Unterschrift", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
MessageBox.Show("Kein Unterschriftenpad gefunden\nMeldung 0x01", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
|
||||||
|
|
||||||
|
var query = SQL.CreateAndReturnSQLCommand($"UPDATE {MainWindow.table}.lostCard SET Kartennummer = @pKartennummer, Ausgegeben = @pAusgegeben, AusgegebenDurch = @pAusgegebenDurch, AusgegebenTimestamp = @pAusgegebenTimestamp, Signature_blob = @signature WHERE idlostCard = @pidlostCard", new List<MySqlParameter>()
|
||||||
|
{
|
||||||
|
new MySqlParameter("pAusgegeben", 1),
|
||||||
|
new MySqlParameter("pAusgegebenDurch", Environment.UserName),
|
||||||
|
new MySqlParameter("pAusgegebenTimestamp", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
|
||||||
|
new MySqlParameter("pidlostCard", arr[0]),
|
||||||
|
new MySqlParameter("pKartennummer", tbNr.Text)
|
||||||
|
});
|
||||||
|
|
||||||
|
SQL.CreateAndWriteSQLwithSignature(query, _signature);
|
||||||
|
|
||||||
|
updateList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonRueck_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var row = Helper.GetParentRowFromButton(sender);
|
||||||
|
var cardno = (row.DataContext as DataRowView).Row.ItemArray[9];
|
||||||
|
var name = $"{(row.DataContext as DataRowView).Row.ItemArray[1]} {(row.DataContext as DataRowView).Row.ItemArray[2]}";
|
||||||
|
var id = (row.DataContext as DataRowView).Row.ItemArray[0];
|
||||||
|
|
||||||
|
if (MessageBoxResult.Yes == MessageBox.Show($"Die Karte {cardno},\nausgegeben an {name},\nwurde zurückgegeben?", "Karte zurückgegeben?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question))
|
||||||
|
{
|
||||||
|
SQL.CreateAndWriteSQL($"UPDATE {MainWindow.table}.lostCard SET Zurueckgegeben = @pZurueckgegeben, ZurueckgegebenTimestamp = @pZurueckgegebenTimestamp WHERE idlostCard = @pID", new List<MySqlParameter>()
|
||||||
|
{
|
||||||
|
new MySqlParameter("pZurueckgegeben", 1),
|
||||||
|
new MySqlParameter("pZurueckgegebenTimestamp", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
|
||||||
|
new MySqlParameter("pID", id)
|
||||||
|
});
|
||||||
|
|
||||||
|
updateList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void OnCardDetected(string cardNumber)
|
||||||
|
{
|
||||||
|
// Deine Logik
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
tbNr.Text = cardNumber.Split('=')[0].ToString();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||||
|
{
|
||||||
|
_cardReader.StopListening();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
44
ZKuP/LeihausweisBeantragen.xaml
Normal file
44
ZKuP/LeihausweisBeantragen.xaml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<mah:MetroWindow x:Class="ZKuP.LeihausweisBeantragen"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
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:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||||||
|
xmlns:local="clr-namespace:ZKuP"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Leihausweis beantragen" Height="450" Width="400" ResizeMode="NoResize">
|
||||||
|
|
||||||
|
<Window.Resources>
|
||||||
|
<local:NameToEmailConverter x:Key="NameToEmailConverter"/>
|
||||||
|
</Window.Resources>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<Grid Margin="5">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Abteilung" VerticalAlignment="Top" Margin="5"/>
|
||||||
|
<ComboBox x:Name="cbAbteilung" Height="35" VerticalAlignment="Top" Margin="5"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Vorname" VerticalAlignment="Top" Margin="5"/>
|
||||||
|
<TextBox x:Name="tbVorname" VerticalAlignment="Top" Margin="5"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Nachname" VerticalAlignment="Top" Margin="5"/>
|
||||||
|
<TextBox x:Name="tbNachname" VerticalAlignment="Top" Margin="5"/>
|
||||||
|
|
||||||
|
<TextBlock Text="DB-Email Mitarbeiter" VerticalAlignment="Top" Margin="5"/>
|
||||||
|
<TextBox x:Name="tbEmailMA" VerticalAlignment="Top" Margin="5" GotFocus="tbEmailMA_GotFocus">
|
||||||
|
<TextBox.Text>
|
||||||
|
<MultiBinding Converter="{StaticResource NameToEmailConverter}">
|
||||||
|
<Binding ElementName="tbVorname" Path="Text" UpdateSourceTrigger="PropertyChanged"/>
|
||||||
|
<Binding ElementName="tbNachname" Path="Text" UpdateSourceTrigger="PropertyChanged"/>
|
||||||
|
</MultiBinding>
|
||||||
|
</TextBox.Text>
|
||||||
|
</TextBox>
|
||||||
|
|
||||||
|
<TextBlock Text="DB-Email Vorgesetzter" VerticalAlignment="Top" Margin="5"/>
|
||||||
|
<TextBox x:Name="tbEmailChef" Text="@deutschebahn.com" VerticalAlignment="Top" Margin="5" GotFocus="tbEmailChef_GotFocus"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Button x:Name="btnSend" Content="Ausweis beantragen" Margin="5" VerticalAlignment="Bottom" Click="btnSend_Click"/>
|
||||||
|
</Grid>
|
||||||
|
</mah:MetroWindow>
|
||||||
90
ZKuP/LeihausweisBeantragen.xaml.cs
Normal file
90
ZKuP/LeihausweisBeantragen.xaml.cs
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
using MahApps.Metro.Controls;
|
||||||
|
using MySql.Data.MySqlClient;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
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.Shapes;
|
||||||
|
|
||||||
|
namespace ZKuP
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaktionslogik für LeihausweisBeantragen.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class LeihausweisBeantragen : MetroWindow
|
||||||
|
{
|
||||||
|
public List<string> AbteilungsList { get; set; } = new List<string>() { "P.FBW-M 1", "P.FBW-M 2", "P.FBW-M 3", "P.FBW-M 4", "P.FBW-M 5" };
|
||||||
|
|
||||||
|
public LeihausweisBeantragen()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
cbAbteilung.ItemsSource = AbteilungsList;
|
||||||
|
|
||||||
|
tbEmailChef.Text = Helper.InsertSpaceBeforeUpperCase(Environment.UserName).ReplaceUmlaute().Replace(" ", ".").ToLower() + "@deutschebahn.com";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSend_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(tbVorname.Text)
|
||||||
|
&& !string.IsNullOrWhiteSpace(tbNachname.Text)
|
||||||
|
&& !string.IsNullOrWhiteSpace(tbEmailMA.Text)
|
||||||
|
&& tbEmailMA.Text != "@deutschebahn.com"
|
||||||
|
&& !string.IsNullOrWhiteSpace(tbEmailChef.Text)
|
||||||
|
&& tbEmailChef.Text != "@deutschebahn.com"
|
||||||
|
&& cbAbteilung.SelectedIndex != -1)
|
||||||
|
{
|
||||||
|
SQL.CreateAndWriteSQL($"INSERT INTO {MainWindow.table}.lostCard " +
|
||||||
|
$"(MitarbeiterVorname, MitarbeiterNachname, Abteilung, EmailMA, EmailChef, TimestampAntrag) " +
|
||||||
|
$"VALUES (@pMitarbeiterVorname, @pMitarbeiterNachname, @pAbteilung, @pEmailMA, @pEmailChef, @pTimestampAntrag)", new List<MySqlParameter>()
|
||||||
|
{
|
||||||
|
new MySqlParameter("pMitarbeiterVorname", tbVorname.Text),
|
||||||
|
new MySqlParameter("pMitarbeiterNachname", tbNachname.Text),
|
||||||
|
new MySqlParameter("pAbteilung", cbAbteilung.SelectedValue.ToString()),
|
||||||
|
new MySqlParameter("pEmailMA", tbEmailMA.Text),
|
||||||
|
new MySqlParameter("pEmailChef", tbEmailChef.Text),
|
||||||
|
new MySqlParameter("pTimestampAntrag", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
MessageBox.Show("Alle Felder müssen vollständig ausgefüllt werden", "Fehlende Angaben", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.WriteLog(ex.Message);
|
||||||
|
MessageBox.Show("Fehler beim Anlegen des Antrags", "Fehler beim Anlegen", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Der Antrag für {tbVorname.Text} {tbNachname.Text} wurde beim Pförtner hinterlegt\nEine Gastkarte kann mit Vorlage eines Ausweisdokuments (Personalausweis, Führerschein, defekter Konzernausweis, ...) abgeholt werden", "Antrag angelegt", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tbEmailMA_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
tbEmailMA.Dispatcher.BeginInvoke(new Action(() =>
|
||||||
|
{
|
||||||
|
tbEmailMA.CaretIndex = 0;
|
||||||
|
}), System.Windows.Threading.DispatcherPriority.Input);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tbEmailChef_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
tbEmailChef.Dispatcher.BeginInvoke(new Action(() =>
|
||||||
|
{
|
||||||
|
tbEmailChef.CaretIndex = 0;
|
||||||
|
}), System.Windows.Threading.DispatcherPriority.Input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -283,7 +283,7 @@
|
|||||||
</local:ucSpinnerPiston.RenderTransform>
|
</local:ucSpinnerPiston.RenderTransform>
|
||||||
</local:ucSpinnerPiston>
|
</local:ucSpinnerPiston>
|
||||||
</Canvas>-->
|
</Canvas>-->
|
||||||
<Image x:Name="imgLoading" gif:AnimationBehavior.SourceUri="/Resources/Loading.gif" gif:AnimationBehavior.CacheFramesInMemory="True" gif:AnimationBehavior.RepeatBehavior="3x" gif:AnimationBehavior.AnimationCompleted="imgLoading_AnimationCompleted" VerticalAlignment="Center" Width="400" Height="120" Margin="0,0,0,80"/>
|
<Image x:Name="imgLoading" gif:AnimationBehavior.SourceUri="/Resources/Loading.gif" gif:AnimationBehavior.CacheFramesInMemory="True" gif:AnimationBehavior.AnimationCompleted="imgLoading_AnimationCompleted" VerticalAlignment="Center" Width="400" Height="120" Margin="0,0,0,80"/>
|
||||||
<!--gif:ImageBehavior.RepeatBehavior="3x"-->
|
<!--gif:ImageBehavior.RepeatBehavior="3x"-->
|
||||||
<TextBlock Text="ZKuP wird geladen..." HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,120,0,0" FontSize="20" Foreground="#CC000000"/>
|
<TextBlock Text="ZKuP wird geladen..." HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,120,0,0" FontSize="20" Foreground="#CC000000"/>
|
||||||
<ProgressBar x:Name="pgLoad" Maximum="100" Value="0" Background="{x:Null}" Margin="0,368,0,184" VerticalAlignment="Center" Height="30" HorizontalAlignment="Center" Width="400"/>
|
<ProgressBar x:Name="pgLoad" Maximum="100" Value="0" Background="{x:Null}" Margin="0,368,0,184" VerticalAlignment="Center" Height="30" HorizontalAlignment="Center" Width="400"/>
|
||||||
@ -296,6 +296,11 @@
|
|||||||
|
|
||||||
|
|
||||||
<TabControl x:Name="tcMainMenu" HorizontalAlignment="Right" VerticalAlignment="Top" Width="650" MinHeight="190" MaxHeight="190" Margin="0,7,10,0" SelectionChanged="TabControl_SelectionChanged">
|
<TabControl x:Name="tcMainMenu" HorizontalAlignment="Right" VerticalAlignment="Top" Width="650" MinHeight="190" MaxHeight="190" Margin="0,7,10,0" SelectionChanged="TabControl_SelectionChanged">
|
||||||
|
<TabControl.Resources>
|
||||||
|
<Style TargetType="TabItem" BasedOn="{StaticResource {x:Type TabItem}}">
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
</Style>
|
||||||
|
</TabControl.Resources>
|
||||||
<TabItem x:Name="tabPark" Header="Parkausweise" Visibility="Collapsed" Margin="5,0" Width="130" Height="30" mah:HeaderedControlHelper.HeaderFontSize="18" mah:HeaderedControlHelper.HeaderHorizontalContentAlignment="Center" mah:HeaderedControlHelper.HeaderVerticalContentAlignment="Center">
|
<TabItem x:Name="tabPark" Header="Parkausweise" Visibility="Collapsed" Margin="5,0" Width="130" Height="30" mah:HeaderedControlHelper.HeaderFontSize="18" mah:HeaderedControlHelper.HeaderHorizontalContentAlignment="Center" mah:HeaderedControlHelper.HeaderVerticalContentAlignment="Center">
|
||||||
<StackPanel Orientation="Horizontal" Margin="0,5">
|
<StackPanel Orientation="Horizontal" Margin="0,5">
|
||||||
<StackPanel Orientation="Vertical" Margin="2">
|
<StackPanel Orientation="Vertical" Margin="2">
|
||||||
@ -314,7 +319,13 @@
|
|||||||
<TextBlock Text="Hier kann überprüft werden ob Kennzeichen einen Parkschein hat"/>
|
<TextBlock Text="Hier kann überprüft werden ob Kennzeichen einen Parkschein hat"/>
|
||||||
</Button.ToolTip>
|
</Button.ToolTip>
|
||||||
</Button>
|
</Button>
|
||||||
<Button x:Name="btnCheckKennzeichen" Content="Kennzeichen prüfen" Height="37" FontSize="12" Padding="-5" Margin="2,5" VerticalAlignment="Bottom" FontWeight="Regular" Width="150" Click="btnCheckKennzeichen_Click" Visibility="Collapsed">
|
<Button x:Name="btnCheckKennzeichen" Height="37" FontSize="12" Padding="-5" Margin="2,5" VerticalAlignment="Bottom" FontWeight="Regular" Width="150" Click="btnCheckKennzeichen_Click" Visibility="Collapsed">
|
||||||
|
<Button.Content>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Eingefahrene" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Text="Kennzeichen prüfen" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Button.Content>
|
||||||
<Button.ToolTip>
|
<Button.ToolTip>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Für eingefahrene Fzg. zb von Firmen das Kennzeichen prüfen"/>
|
<TextBlock Text="Für eingefahrene Fzg. zb von Firmen das Kennzeichen prüfen"/>
|
||||||
@ -390,7 +401,31 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Vertical" Margin="4,2">
|
<StackPanel Orientation="Vertical" Margin="4,2">
|
||||||
<Button x:Name="btnCreateDeliveries" Content="Lieferanten verwalten" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Visibility="Collapsed" Click="btnCreateDeliveries_Click"/>
|
<StackPanel Orientation="Horizontal" Width="150" Height="47">
|
||||||
|
<Button x:Name="btnLostCard" Height="37" FontSize="12" Padding="-5" Margin="0,5,4,5" FontWeight="Regular" Width="69" Visibility="Collapsed" Click="btnLostCard_Click">
|
||||||
|
<Button.Content>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Karte" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Text="verloren" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Button.Content>
|
||||||
|
<Button.ToolTip>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Ist der Konzernausweis eines Mitarbeiters defekt/verloren/nicht verfügbar,"/>
|
||||||
|
<TextBlock Text="kann hierrüber temporär eine Gastkarte ausgegeben werden"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Button.ToolTip>
|
||||||
|
</Button>
|
||||||
|
<Button x:Name="btnCreateDeliveries" Height="37" FontSize="12" Padding="-5" Margin="2,5,0,5" FontWeight="Regular" Width="75" Visibility="Collapsed" Click="btnCreateDeliveries_Click">
|
||||||
|
<Button.Content>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Lieferanten" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Text="verwalten" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
<Button x:Name="btnCheckAusgegebeneParkausweise" Content="Ausgegebene Parkausweise" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Visibility="Visible" Click="btnCheckAusgegebeneParkausweise_Click"/>
|
<Button x:Name="btnCheckAusgegebeneParkausweise" Content="Ausgegebene Parkausweise" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Visibility="Visible" Click="btnCheckAusgegebeneParkausweise_Click"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
@ -411,6 +446,9 @@
|
|||||||
<StackPanel Orientation="Vertical" Margin="2">
|
<StackPanel Orientation="Vertical" Margin="2">
|
||||||
<Button x:Name="btnMcFitSign" Content="McFit User erstellen" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Visibility="Collapsed" Click="btnMcFitSignUp_Click"/>
|
<Button x:Name="btnMcFitSign" Content="McFit User erstellen" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Visibility="Collapsed" Click="btnMcFitSignUp_Click"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Vertical" Margin="2">
|
||||||
|
<Button x:Name="btnLeihAusweis" Content="Leihausweis beantragen" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Visibility="Visible" Click="btnLeihAusweis_Click"/>
|
||||||
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem x:Name="tabAdmin" Header="Admin" Visibility="Collapsed" Margin="5,0" Width="80" FontSize="8" Height="30" mah:HeaderedControlHelper.HeaderFontSize="18" mah:HeaderedControlHelper.HeaderHorizontalContentAlignment="Center" mah:HeaderedControlHelper.HeaderVerticalContentAlignment="Center">
|
<TabItem x:Name="tabAdmin" Header="Admin" Visibility="Collapsed" Margin="5,0" Width="80" FontSize="8" Height="30" mah:HeaderedControlHelper.HeaderFontSize="18" mah:HeaderedControlHelper.HeaderHorizontalContentAlignment="Center" mah:HeaderedControlHelper.HeaderVerticalContentAlignment="Center">
|
||||||
@ -458,7 +496,7 @@
|
|||||||
<Button x:Name="btnSetHinweis" Visibility="Collapsed" FontSize="12" Padding="-5" Height="23" Content="Hinweis setzen" FontWeight="Regular" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="620,0,0,-10" Width="220" Click="btnSetHinweis_Click"/>-->
|
<Button x:Name="btnSetHinweis" Visibility="Collapsed" FontSize="12" Padding="-5" Height="23" Content="Hinweis setzen" FontWeight="Regular" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="620,0,0,-10" Width="220" Click="btnSetHinweis_Click"/>-->
|
||||||
|
|
||||||
|
|
||||||
<Grid x:Name="BE" Margin="215, 30, 0, 0" Width="350" VerticalAlignment="Top" HorizontalAlignment="Left" ToolTip="Rote Parkplätze sind belegt, Gelbe belegt durch BE-Fläche, Grüne frei">
|
<Grid x:Name="BE" Margin="215, 30, 0, 0" Width="350" Visibility="Collapsed" VerticalAlignment="Top" HorizontalAlignment="Left" ToolTip="Rote Parkplätze sind belegt, Gelbe belegt durch BE-Fläche, Grüne frei">
|
||||||
|
|
||||||
<TextBlock Text="Parkplätze im Werk:" Margin="0, -20, 0, 0" Height="20" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
<TextBlock Text="Parkplätze im Werk:" Margin="0, -20, 0, 0" Height="20" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||||
<Button x:Name="btnBE" Content="BE-Flächenansicht" FontSize="12" Padding="-5" Margin="0, 110, 120, 0" Height="20" FontWeight="Regular" HorizontalAlignment="Center" VerticalAlignment="Top" Width="150" Visibility="Collapsed" Click="btnBEImages_Click"/>
|
<Button x:Name="btnBE" Content="BE-Flächenansicht" FontSize="12" Padding="-5" Margin="0, 110, 120, 0" Height="20" FontWeight="Regular" HorizontalAlignment="Center" VerticalAlignment="Top" Width="150" Visibility="Collapsed" Click="btnBEImages_Click"/>
|
||||||
@ -505,13 +543,15 @@
|
|||||||
<TextBlock Text="18" Margin="100, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
|
<TextBlock Text="18" Margin="100, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
|
||||||
<Rectangle x:Name="P19" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="100, 40, 0, 0" StrokeThickness="0" Fill="Green"/>
|
<Rectangle x:Name="P19" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="100, 40, 0, 0" StrokeThickness="0" Fill="Green"/>
|
||||||
<TextBlock Text="19" Margin="100, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
|
<TextBlock Text="19" Margin="100, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
|
||||||
<Rectangle x:Name="P20" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="100, 60, 0, 0" StrokeThickness="0" Fill="Green"/>
|
|
||||||
<TextBlock Text="20" Margin="100, 60, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="4" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
|
|
||||||
|
|
||||||
<Rectangle x:Name="P21" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 0, 0, 0" StrokeThickness="0" Fill="Green"/>
|
<Rectangle x:Name="exP20" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="100, 60, 0, 0" StrokeThickness="0" Fill="Gray"/>
|
||||||
<TextBlock Text="21" Margin="125, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="4" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
|
<TextBlock Text="20" TextDecorations="Strikethrough" Margin="100, 60, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="4" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/><!--PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown"-->
|
||||||
<Rectangle x:Name="P22" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 20, 0, 0" StrokeThickness="0" Fill="Green"/>
|
|
||||||
<TextBlock Text="22" Margin="125, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="4" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
|
<Rectangle x:Name="exP21" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 0, 0, 0" StrokeThickness="0" Fill="Gray"/>
|
||||||
|
<TextBlock Text="21" TextDecorations="Strikethrough" Margin="125, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="4" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/><!--PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown"-->
|
||||||
|
<Rectangle x:Name="exP22" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 20, 0, 0" StrokeThickness="0" Fill="Gray"/>
|
||||||
|
<TextBlock Text="22" TextDecorations="Strikethrough" Margin="125, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="4" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/><!--PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown"-->
|
||||||
|
|
||||||
<Rectangle x:Name="P23" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 40, 0, 0" StrokeThickness="0" Fill="Green"/>
|
<Rectangle x:Name="P23" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 40, 0, 0" StrokeThickness="0" Fill="Green"/>
|
||||||
<TextBlock Text="23" Margin="125, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
|
<TextBlock Text="23" Margin="125, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
|
||||||
<Rectangle x:Name="P24" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 60, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
|
<Rectangle x:Name="P24" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 60, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
|
||||||
@ -554,7 +594,7 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</ItemsControl.ItemContainerStyle>
|
</ItemsControl.ItemContainerStyle>
|
||||||
</ItemsControl>-->
|
</ItemsControl>-->
|
||||||
<Grid x:Name="BesuchP" Margin="465, 26, 0, 10" Width="30" HorizontalAlignment="Left" VerticalAlignment="Top">
|
<Grid x:Name="BesuchP" Margin="465, 26, 0, 10" Width="30" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Collapsed">
|
||||||
<TextBlock Text="Besucherparkplätze" Margin="-20,1,0,-5" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top">
|
<TextBlock Text="Besucherparkplätze" Margin="-20,1,0,-5" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||||
<TextBlock.LayoutTransform>
|
<TextBlock.LayoutTransform>
|
||||||
<RotateTransform Angle="270"/>
|
<RotateTransform Angle="270"/>
|
||||||
@ -638,7 +678,7 @@
|
|||||||
<ColumnDefinition x:Name="columnRight" Width="1*" MinWidth="450"/>
|
<ColumnDefinition x:Name="columnRight" Width="1*" MinWidth="450"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBox x:Name="tbSearch" mah:TextBoxHelper.Watermark="Ankunft heute durchsuchen..." HorizontalAlignment="Left" Height="23" Margin="10,-15,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="180" Visibility="Collapsed" Padding="0,2,0,0" TextChanged="TextBox_TextChanged" PreviewGotKeyboardFocus="TbSearch_PreviewGotKeyboardFocus" PreviewLostKeyboardFocus="TbSearch_PreviewLostKeyboardFocus"/>
|
<TextBox x:Name="tbSearch" mah:TextBoxHelper.Watermark="Ankunft heute durchsuchen..." HorizontalAlignment="Left" Height="23" Margin="10,-15,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="180" Visibility="Collapsed" Padding="0,2,0,0" TextChanged="SearchTextBox_TextChanged" PreviewGotKeyboardFocus="TbSearch_PreviewGotKeyboardFocus" PreviewLostKeyboardFocus="TbSearch_PreviewLostKeyboardFocus"/>
|
||||||
<!--<TextBlock x:Name="lblSearch" Text="Ankunft heute durchsuchen..." Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" IsHitTestVisible="False" Margin="12,-15,0,0" Padding="3" Visibility="Collapsed" HorizontalAlignment="Left" Width="180"/>-->
|
<!--<TextBlock x:Name="lblSearch" Text="Ankunft heute durchsuchen..." Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" IsHitTestVisible="False" Margin="12,-15,0,0" Padding="3" Visibility="Collapsed" HorizontalAlignment="Left" Width="180"/>-->
|
||||||
<Button x:Name="btnClearSearch" HorizontalAlignment="Left" Content="X" Padding="0" VerticalAlignment="Top" Margin="190,-15,0,0" Height="26" Width="14" Foreground="Red" Visibility="Collapsed" FontWeight="Bold" ToolTip="Suchfeld leeren" Click="btnClearSearch_Click"/>
|
<Button x:Name="btnClearSearch" HorizontalAlignment="Left" Content="X" Padding="0" VerticalAlignment="Top" Margin="190,-15,0,0" Height="26" Width="14" Foreground="Red" Visibility="Collapsed" FontWeight="Bold" ToolTip="Suchfeld leeren" Click="btnClearSearch_Click"/>
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Controls.Primitives;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
@ -44,7 +45,7 @@ namespace ZKuP
|
|||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
}
|
}
|
||||||
|
|
||||||
public const string Version = "5.2.1.2";
|
public const string Version = "5.2.4.0";
|
||||||
//public static Roles LoggedInRole { get; private set; } = Roles.None;
|
//public static Roles LoggedInRole { get; private set; } = Roles.None;
|
||||||
internal static MainWindow main;
|
internal static MainWindow main;
|
||||||
ThemeManager TM;
|
ThemeManager TM;
|
||||||
@ -100,6 +101,10 @@ namespace ZKuP
|
|||||||
bool ReadyToSavePosition = false;
|
bool ReadyToSavePosition = false;
|
||||||
bool isSecureConn = false;
|
bool isSecureConn = false;
|
||||||
|
|
||||||
|
string vertAspName = "";
|
||||||
|
string nameAspVert = "";
|
||||||
|
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -319,6 +324,7 @@ namespace ZKuP
|
|||||||
#region Check if Window was moved and released
|
#region Check if Window was moved and released
|
||||||
private const int WM_ENTERSIZEMOVE = 0x0231;
|
private const int WM_ENTERSIZEMOVE = 0x0231;
|
||||||
private const int WM_EXITSIZEMOVE = 0x0232;
|
private const int WM_EXITSIZEMOVE = 0x0232;
|
||||||
|
private const int WM_DPICHANGED = 0x02E0;
|
||||||
|
|
||||||
private Point _startPosition;
|
private Point _startPosition;
|
||||||
private Size _startSize;
|
private Size _startSize;
|
||||||
@ -349,6 +355,11 @@ namespace ZKuP
|
|||||||
OnWindowMoveFinished();
|
OnWindowMoveFinished();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_DPICHANGED:
|
||||||
|
|
||||||
|
OnWindowMoveFinished();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return IntPtr.Zero;
|
return IntPtr.Zero;
|
||||||
@ -358,6 +369,9 @@ namespace ZKuP
|
|||||||
{
|
{
|
||||||
Helper.CheckScale(this);
|
Helper.CheckScale(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
@ -477,6 +491,82 @@ namespace ZKuP
|
|||||||
|
|
||||||
if (TM == null) TM = new ThemeManager();
|
if (TM == null) TM = new ThemeManager();
|
||||||
|
|
||||||
|
// Nag User to Setup Asp on First Start
|
||||||
|
if (Settings.GetSetting("DarkMode").Equals("")) // if firstStart false then its the first start
|
||||||
|
{
|
||||||
|
if (RoleManager.LoggedInRole != Roles.Pförtner &&
|
||||||
|
RoleManager.LoggedInRole != Roles.None)
|
||||||
|
{
|
||||||
|
if (MessageBoxResult.OK == MessageBox.Show("Willkommen zu ZKuP\n\nDies ist ihr erster Start der Anwendung\n\nBitte tragen Sie sich zuerst als Ansprechpartner ein um die Anwendung nutzen zu können", "Erster Start", MessageBoxButton.OK, MessageBoxImage.Exclamation))
|
||||||
|
{
|
||||||
|
ManageAsp map = new ManageAsp();
|
||||||
|
map.ShowDialog();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (MessageBoxResult.OK == MessageBox.Show("Eingabe des Ansprechpartners ist zwingend erforderlich!", "Erster Start", MessageBoxButton.OK, MessageBoxImage.Error))
|
||||||
|
{
|
||||||
|
ManageAsp map = new ManageAsp();
|
||||||
|
map.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Check if User has entered as Asp.
|
||||||
|
|
||||||
|
var id = SQL.ReadSingleValue($"SELECT idusers FROM {MainWindow.table}.users WHERE `Username` = '{Environment.UserName}'");
|
||||||
|
|
||||||
|
var aspId = SQL.ReadSingleValue($"SELECT EXISTS (SELECT 1 FROM ansprechpartner WHERE CreatorID = '{id}')");
|
||||||
|
|
||||||
|
if (aspId == "0")
|
||||||
|
{
|
||||||
|
if (MessageBoxResult.OK == MessageBox.Show("Eingabe des Ansprechpartners ist zwingend erforderlich!", "Erster Start", MessageBoxButton.OK, MessageBoxImage.Error))
|
||||||
|
{
|
||||||
|
ManageAsp map = new ManageAsp();
|
||||||
|
map.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Nag User if no Asp Entry or no CreatorID in Asp
|
||||||
|
|
||||||
|
if (RoleManager.LoggedInRole != Roles.Pförtner &&
|
||||||
|
RoleManager.LoggedInRole != Roles.None)
|
||||||
|
{
|
||||||
|
var id = SQL.ReadSingleValue($"SELECT idusers FROM {MainWindow.table}.users WHERE `Username` = '{Environment.UserName}'");
|
||||||
|
var aspId = SQL.ReadSingleValue($"SELECT EXISTS (SELECT 1 FROM ansprechpartner WHERE CreatorID = '{id}')");
|
||||||
|
|
||||||
|
if (aspId != "0")
|
||||||
|
{
|
||||||
|
var res = SQL.ReadSQL($"SELECT * FROM {MainWindow.table}.ansprechpartner WHERE CreatorID = '{id}'").Result;
|
||||||
|
var firstRow = res.Rows[0];
|
||||||
|
bool hasEmptyOrNull = firstRow.ItemArray.Any(field =>
|
||||||
|
field == DBNull.Value ||
|
||||||
|
(field is string str && string.IsNullOrWhiteSpace(str))
|
||||||
|
);
|
||||||
|
|
||||||
|
if (hasEmptyOrNull)
|
||||||
|
{
|
||||||
|
if (MessageBoxResult.OK == MessageBox.Show("Ihr Eintrag als Ansprechpartner ist nicht vorhanden oder unvollständig!\n\nBitte erstellen oder vervollständigen", "Fehlende Asp Informationen", MessageBoxButton.OK, MessageBoxImage.Warning))
|
||||||
|
{
|
||||||
|
ManageAsp map = new ManageAsp();
|
||||||
|
map.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aspId == "0")
|
||||||
|
{
|
||||||
|
if (MessageBoxResult.OK == MessageBox.Show("Ihr Eintrag als Ansprechpartner ist nicht vorhanden oder unvollständig!\n\nBitte erstellen oder vervollständigen", "Fehlende Asp Informationen", MessageBoxButton.OK, MessageBoxImage.Warning))
|
||||||
|
{
|
||||||
|
ManageAsp map = new ManageAsp();
|
||||||
|
map.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
TM.ChangeTheme(Settings.GetSettingBool("DarkMode"));
|
TM.ChangeTheme(Settings.GetSettingBool("DarkMode"));
|
||||||
TM.ChangeAccent(Settings.GetSettingString("Accent"));
|
TM.ChangeAccent(Settings.GetSettingString("Accent"));
|
||||||
this.Title = "ZKuP - " + Version + "\tRolle: " + RoleManager.LoggedInRole.ToString().Replace("_", " ");
|
this.Title = "ZKuP - " + Version + "\tRolle: " + RoleManager.LoggedInRole.ToString().Replace("_", " ");
|
||||||
@ -585,6 +675,9 @@ namespace ZKuP
|
|||||||
ReadyToSavePosition = true;
|
ReadyToSavePosition = true;
|
||||||
gridSpinner.Visibility = Visibility.Hidden;
|
gridSpinner.Visibility = Visibility.Hidden;
|
||||||
|
|
||||||
|
var gif = XamlAnimatedGif.AnimationBehavior.GetAnimator(imgLoading);
|
||||||
|
gif.Dispose();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
reloadTimer.Interval = TimeSpan.FromSeconds(10);
|
reloadTimer.Interval = TimeSpan.FromSeconds(10);
|
||||||
@ -601,7 +694,6 @@ namespace ZKuP
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ((RoleManager.LoggedInRole == Roles.Admin || RoleManager.LoggedInRole == Roles.M2_AM) && Settings.GetSettingBool("ShowParkcardAccept"))
|
if ((RoleManager.LoggedInRole == Roles.Admin || RoleManager.LoggedInRole == Roles.M2_AM) && Settings.GetSettingBool("ShowParkcardAccept"))
|
||||||
{
|
{
|
||||||
if (SQL.RowExists("parkausweise", "Genehmigt", "0").Result == true)
|
if (SQL.RowExists("parkausweise", "Genehmigt", "0").Result == true)
|
||||||
@ -1032,6 +1124,10 @@ namespace ZKuP
|
|||||||
|
|
||||||
DateTime lastChange = DateTime.MinValue;
|
DateTime lastChange = DateTime.MinValue;
|
||||||
private async Task getToday()
|
private async Task getToday()
|
||||||
|
{
|
||||||
|
bool isVisible = false;
|
||||||
|
Dispatcher.Invoke(() => isVisible = gridToday.Visibility == Visibility.Visible);
|
||||||
|
if (isVisible)
|
||||||
{
|
{
|
||||||
//bool changeTable = false;
|
//bool changeTable = false;
|
||||||
|
|
||||||
@ -1070,20 +1166,23 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vertAspName = string.IsNullOrEmpty(vertAspName) ? SQL.ReadSingleValue($"SELECT Vertreter FROM {MainWindow.table}.ansprechpartner WHERE Name = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "") : vertAspName;
|
||||||
|
nameAspVert = string.IsNullOrEmpty(nameAspVert) ? SQL.ReadSingleValue($"SELECT Name FROM {MainWindow.table}.ansprechpartner WHERE Vertreter = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "") : nameAspVert;
|
||||||
|
|
||||||
DataTable tempFirm = await SQL.ReadSQL($"Select * FROM {MainWindow.table}.firmen where (Arbeitsbeginn <= current_date() AND Arbeitsende >= current_date()) AND (Ersteller = '{Environment.UserName}' " +
|
DataTable tempFirm = await SQL.ReadSQL($"Select * FROM {MainWindow.table}.firmen where (Arbeitsbeginn <= current_date() AND Arbeitsende >= current_date()) AND (Ersteller = '{Environment.UserName}' " +
|
||||||
$"OR Ersteller = '{Environment.UserDomainName}{Environment.UserName}' " +
|
$"OR Ersteller = '{Environment.UserDomainName}{Environment.UserName}' " +
|
||||||
$"OR Ersteller = '{SQL.ReadSingleValue($"SELECT Vertreter FROM {MainWindow.table}.ansprechpartner WHERE Name = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "")}' " +
|
$"OR Ersteller = '{vertAspName}' " +
|
||||||
$"OR Ersteller = '{Environment.UserDomainName}{SQL.ReadSingleValue($"SELECT Vertreter FROM {MainWindow.table}.ansprechpartner WHERE Name = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "")}' " +
|
$"OR Ersteller = '{Environment.UserDomainName}{vertAspName}' " +
|
||||||
$"OR Ersteller = '{SQL.ReadSingleValue($"SELECT Name FROM {MainWindow.table}.ansprechpartner WHERE Vertreter = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "")}' " +
|
$"OR Ersteller = '{nameAspVert}' " +
|
||||||
$"OR Ersteller = '{Environment.UserDomainName}{SQL.ReadSingleValue($"SELECT Name FROM {MainWindow.table}.ansprechpartner WHERE Vertreter = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "")}' " +
|
$"OR Ersteller = '{Environment.UserDomainName}{nameAspVert}' " +
|
||||||
$"OR Ansprechpartner_Intern = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}')" +
|
$"OR Ansprechpartner_Intern = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}')" +
|
||||||
$"{FK}");/*, todayFirm*/
|
$"{FK}");/*, todayFirm*/
|
||||||
DataTable tempBesuch = await SQL.ReadSQL($"SELECT idbesucher, concat('Besucher: ', Name) AS Name, Verantwortlicher_MA AS Verantwortlicher_MA_Firma,Tel_Nr_Besucher AS Tel_Nr_Verantwortlicher_Firma,Anzahl_Begleitpersonen,Besuchstag,Grund_des_Besuchs,Ansprechpartner_Intern,Tel_Nr_Ansprechpartner_Intern,Kleine_Unterweisung_bis,Oertlichkeit FROM {MainWindow.table}.besucher WHERE Besuchstag = current_date() AND (Ersteller = '{Environment.UserName}' " +
|
DataTable tempBesuch = await SQL.ReadSQL($"SELECT idbesucher, concat('Besucher: ', Name) AS Name, Verantwortlicher_MA AS Verantwortlicher_MA_Firma,Tel_Nr_Besucher AS Tel_Nr_Verantwortlicher_Firma,Anzahl_Begleitpersonen,Besuchstag,Grund_des_Besuchs,Ansprechpartner_Intern,Tel_Nr_Ansprechpartner_Intern,Kleine_Unterweisung_bis,Oertlichkeit FROM {MainWindow.table}.besucher WHERE Besuchstag = current_date() AND (Ersteller = '{Environment.UserName}' " +
|
||||||
$"OR Ersteller = '{Environment.UserDomainName}{Environment.UserName}' " +
|
$"OR Ersteller = '{Environment.UserDomainName}{Environment.UserName}' " +
|
||||||
$"OR Ersteller = '{SQL.ReadSingleValue($"SELECT Vertreter FROM {MainWindow.table}.ansprechpartner WHERE Name = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "")}' " +
|
$"OR Ersteller = '{vertAspName}' " +
|
||||||
$"OR Ersteller = '{Environment.UserDomainName}{SQL.ReadSingleValue($"SELECT Vertreter FROM {MainWindow.table}.ansprechpartner WHERE Name = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "")}' " +
|
$"OR Ersteller = '{Environment.UserDomainName}{vertAspName}' " +
|
||||||
$"OR Ersteller = '{SQL.ReadSingleValue($"SELECT Name FROM {MainWindow.table}.ansprechpartner WHERE Vertreter = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "")}' " +
|
$"OR Ersteller = '{nameAspVert}' " +
|
||||||
$"OR Ersteller = '{Environment.UserDomainName}{SQL.ReadSingleValue($"SELECT Name FROM {MainWindow.table}.ansprechpartner WHERE Vertreter = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "")}' " +
|
$"OR Ersteller = '{Environment.UserDomainName}{nameAspVert}' " +
|
||||||
$"OR Ansprechpartner_Intern = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}')" +
|
$"OR Ansprechpartner_Intern = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}')" +
|
||||||
$"{FK}");/*, todayBesuch*/
|
$"{FK}");/*, todayBesuch*/
|
||||||
DataTable tempFamily = await SQL.ReadSQL($"SELECT concat('Führung: ', Name) AS Name, Name AS Verantwortlicher_MA_Firma, Name AS Ansprechpartner_Intern,TelNr AS Tel_Nr_Verantwortlicher_Firma FROM {MainWindow.table}.family WHERE `Date` = '{DateTime.Now.Date.ToString("yyyy-MM-dd")}' AND `User` = '{Environment.UserName}'");
|
DataTable tempFamily = await SQL.ReadSQL($"SELECT concat('Führung: ', Name) AS Name, Name AS Verantwortlicher_MA_Firma, Name AS Ansprechpartner_Intern,TelNr AS Tel_Nr_Verantwortlicher_Firma FROM {MainWindow.table}.family WHERE `Date` = '{DateTime.Now.Date.ToString("yyyy-MM-dd")}' AND `User` = '{Environment.UserName}'");
|
||||||
@ -1142,16 +1241,19 @@ namespace ZKuP
|
|||||||
q.Click += BtnInfo_Click;
|
q.Click += BtnInfo_Click;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private async Task getZutritte()
|
private async Task getZutritte()
|
||||||
|
{
|
||||||
|
bool isVisible = false;
|
||||||
|
Dispatcher.Invoke(() => isVisible = gridArrived.Visibility == Visibility.Visible);
|
||||||
|
if (isVisible)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (RoleManager.LoggedInRole == Roles.Admin || RoleManager.LoggedInRole == Roles.Pförtner || RoleManager.LoggedInRole == Roles.M2_AM)
|
if (RoleManager.LoggedInRole == Roles.Admin || RoleManager.LoggedInRole == Roles.Pförtner || RoleManager.LoggedInRole == Roles.M2_AM)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (lastEntryZutritte == temp)
|
if (lastEntryZutritte == temp)
|
||||||
{
|
{
|
||||||
overv = await SQL.ReadSQL($"SELECT * FROM {MainWindow.table}.zutritte where Zutritt >= now() + INTERVAL -10 DAY", overv);
|
overv = await SQL.ReadSQL($"SELECT * FROM {MainWindow.table}.zutritte where Zutritt >= now() + INTERVAL -10 DAY", overv);
|
||||||
@ -1183,8 +1285,8 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var vertAspName = SQL.ReadSingleValue($"SELECT Vertreter FROM {MainWindow.table}.ansprechpartner WHERE Name = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "");
|
vertAspName = string.IsNullOrEmpty(vertAspName) ? SQL.ReadSingleValue($"SELECT Vertreter FROM {MainWindow.table}.ansprechpartner WHERE Name = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "") : vertAspName;
|
||||||
var nameAspVert = SQL.ReadSingleValue($"SELECT Name FROM {MainWindow.table}.ansprechpartner WHERE Vertreter = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "");
|
nameAspVert = string.IsNullOrEmpty(nameAspVert) ? SQL.ReadSingleValue($"SELECT Name FROM {MainWindow.table}.ansprechpartner WHERE Vertreter = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "") : nameAspVert;
|
||||||
|
|
||||||
if (lastEntryZutritte == temp)
|
if (lastEntryZutritte == temp)
|
||||||
{
|
{
|
||||||
@ -1259,6 +1361,7 @@ namespace ZKuP
|
|||||||
// throw;
|
// throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async void getHinweis()
|
private async void getHinweis()
|
||||||
{
|
{
|
||||||
@ -1281,8 +1384,10 @@ namespace ZKuP
|
|||||||
|
|
||||||
private async Task getPark()
|
private async Task getPark()
|
||||||
{
|
{
|
||||||
//if (LoggedInRole == Roles.Admin || LoggedInRole == Roles.Pförtner)
|
bool isVisible = false;
|
||||||
//{
|
Dispatcher.Invoke(() => isVisible = BE.Visibility == Visibility.Visible);
|
||||||
|
if (isVisible)
|
||||||
|
{
|
||||||
|
|
||||||
var park = await SQL.ReadListString($"SELECT Parkplatz FROM {MainWindow.table}.`beParkplaetze` LEFT JOIN {MainWindow.table}.`beBelegung` ON beParkplaetze.beNr = beBelegung.beNr WHERE Parkplatz IS NOT null AND CURDATE() BETWEEN beBelegung.von AND beBelegung.bis");
|
var park = await SQL.ReadListString($"SELECT Parkplatz FROM {MainWindow.table}.`beParkplaetze` LEFT JOIN {MainWindow.table}.`beBelegung` ON beParkplaetze.beNr = beBelegung.beNr WHERE Parkplatz IS NOT null AND CURDATE() BETWEEN beBelegung.von AND beBelegung.bis");
|
||||||
//var singlePark = await SQL.ReadDictionary2($"SELECT parkplatznr, FROM {MainWindow.table}.`parkplaetze`", 0 , 1);
|
//var singlePark = await SQL.ReadDictionary2($"SELECT parkplatznr, FROM {MainWindow.table}.`parkplaetze`", 0 , 1);
|
||||||
@ -1325,10 +1430,16 @@ namespace ZKuP
|
|||||||
if (singlePark.ContainsKey(s.Name.TrimStart('P')) && x && !string.IsNullOrWhiteSpace(y) && sp.Children[sp.Children.Count - 1].GetType() != typeof(TextBlock))
|
if (singlePark.ContainsKey(s.Name.TrimStart('P')) && x && !string.IsNullOrWhiteSpace(y) && sp.Children[sp.Children.Count - 1].GetType() != typeof(TextBlock))
|
||||||
sp.Children.Add(new TextBlock() { Text = $"Ausgegeben an {y}" });
|
sp.Children.Add(new TextBlock() { Text = $"Ausgegeben an {y}" });
|
||||||
}
|
}
|
||||||
else if (!s.Name.StartsWith("Red"))
|
else if (!s.Name.StartsWith("Red") && !s.Name.StartsWith("ex"))
|
||||||
{
|
{
|
||||||
s.Fill = new SolidColorBrush(Colors.Green);
|
s.Fill = new SolidColorBrush(Colors.Green);
|
||||||
}
|
}
|
||||||
|
else if (s.Name.StartsWith("ex"))
|
||||||
|
{
|
||||||
|
s.ToolTip = "Parkplatz nicht verfügbar\nNicht vergeben!";
|
||||||
|
var text = tbs.Find(p => p.Text == s.Name.Replace("exP", ""));
|
||||||
|
text.ToolTip = "Parkplatz nicht verfügbar\nNicht vergeben!";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1397,15 +1508,24 @@ namespace ZKuP
|
|||||||
}));
|
}));
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async Task getMcFitCards()
|
private async Task getMcFitCards()
|
||||||
|
{
|
||||||
|
bool isVisible = false;
|
||||||
|
Dispatcher.Invoke(() => isVisible = lblmcfit.Visibility == Visibility.Visible);
|
||||||
|
if (isVisible)
|
||||||
{
|
{
|
||||||
var avail = await SQL.ReadSingleValueAsync($"SELECT 5-sum(AktuellAusgegeben) FROM {MainWindow.table}.mcFit");
|
var avail = await SQL.ReadSingleValueAsync($"SELECT 5-sum(AktuellAusgegeben) FROM {MainWindow.table}.mcFit");
|
||||||
Dispatcher.Invoke(() => { lblmcfit.Text = $"Aktuell verfügbare McFit Karten: {avail} von 5"; });
|
Dispatcher.Invoke(() => { lblmcfit.Text = $"Aktuell verfügbare McFit Karten: {avail} von 5"; });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal async Task getFahrzeuge()
|
internal async Task getFahrzeuge()
|
||||||
|
{
|
||||||
|
bool isVisible = false;
|
||||||
|
Dispatcher.Invoke(() => isVisible = gridLieferanten.Visibility == Visibility.Visible);
|
||||||
|
if (isVisible)
|
||||||
{
|
{
|
||||||
var res = await SQL.ReadListStringMultipleColumns($"SELECT * FROM {MainWindow.table}.fahrzeuge", 4);
|
var res = await SQL.ReadListStringMultipleColumns($"SELECT * FROM {MainWindow.table}.fahrzeuge", 4);
|
||||||
var i = res.First().Split(';');
|
var i = res.First().Split(';');
|
||||||
@ -1432,11 +1552,17 @@ namespace ZKuP
|
|||||||
lblLKW.Foreground = lblLKWLang.Foreground = lblSprinter.Foreground = lblPKW.Foreground = new SolidColorBrush(Color.FromRgb(col.R, col.G, col.B));
|
lblLKW.Foreground = lblLKWLang.Foreground = lblSprinter.Foreground = lblPKW.Foreground = new SolidColorBrush(Color.FromRgb(col.R, col.G, col.B));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal void getBikes()
|
internal void getBikes()
|
||||||
|
{
|
||||||
|
bool isVisible = false;
|
||||||
|
Dispatcher.Invoke(() => isVisible = gridBike.Visibility == Visibility.Visible);
|
||||||
|
if (isVisible)
|
||||||
{
|
{
|
||||||
var i = SQL.ReadSingleValue($"SELECT bikes FROM {MainWindow.table}.motorraeder");
|
var i = SQL.ReadSingleValue($"SELECT bikes FROM {MainWindow.table}.motorraeder");
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(i)) i = "0";
|
||||||
if (TM == null) Dispatcher.Invoke(() => TM = new ThemeManager());
|
if (TM == null) Dispatcher.Invoke(() => TM = new ThemeManager());
|
||||||
var bright = TM.dark ? 100 : 50;
|
var bright = TM.dark ? 100 : 50;
|
||||||
var col = ColorHelper.ColorConverter.HsvToRgb(new HSV((100 / maxBikes) * (maxBikes - Convert.ToInt16(i)), 100, (byte)bright));
|
var col = ColorHelper.ColorConverter.HsvToRgb(new HSV((100 / maxBikes) * (maxBikes - Convert.ToInt16(i)), 100, (byte)bright));
|
||||||
@ -1477,67 +1603,95 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void BtnManageUsers_Click(object sender, RoutedEventArgs e)
|
private void BtnManageUsers_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
ManageUsers mU = new ManageUsers();
|
ManageUsers mU = new ManageUsers();
|
||||||
mU.Owner = this;
|
mU.Owner = this;
|
||||||
mU.ShowDialog();
|
mU.ShowDialog();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void BtnCreateVisitor_Click(object sender, RoutedEventArgs e)
|
private async void BtnCreateVisitor_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
ManageVisitor mV = new ManageVisitor();
|
ManageVisitor mV = new ManageVisitor();
|
||||||
mV.Owner = this;
|
mV.Owner = this;
|
||||||
mV.ShowDialog();
|
mV.ShowDialog();
|
||||||
|
|
||||||
getToday();
|
getToday();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void BtnCreateFirma_Click(object sender, RoutedEventArgs e)
|
private async void BtnCreateFirma_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
CreateFirma cF = new CreateFirma();
|
CreateFirma cF = new CreateFirma();
|
||||||
cF.Owner = this;
|
cF.Owner = this;
|
||||||
cF.ShowDialog();
|
cF.ShowDialog();
|
||||||
|
|
||||||
getToday();
|
getToday();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnManageAsp_Click(object sender, RoutedEventArgs e)
|
private void BtnManageAsp_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
ManageAsp mA = new ManageAsp();
|
ManageAsp mA = new ManageAsp();
|
||||||
mA.Owner = this;
|
mA.Owner = this;
|
||||||
mA.ShowDialog();
|
mA.ShowDialog();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void btnFamily_Click(object sender, RoutedEventArgs e)
|
private void btnFamily_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
Family fam = new Family();
|
Family fam = new Family();
|
||||||
fam.Owner = this;
|
fam.Owner = this;
|
||||||
fam.WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
fam.WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
fam.ShowDialog();
|
fam.ShowDialog();
|
||||||
|
|
||||||
getToday();
|
getToday();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private async void btnUserCreate_Click(object sender, RoutedEventArgs e)
|
private async void btnUserCreate_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
CreateVisitor cV = new CreateVisitor();
|
CreateVisitor cV = new CreateVisitor();
|
||||||
cV.Owner = this;
|
cV.Owner = this;
|
||||||
cV.ShowDialog();
|
cV.ShowDialog();
|
||||||
|
|
||||||
getToday();
|
getToday();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void btnKarten_Click(object sender, RoutedEventArgs e)
|
private void btnKarten_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
Cards cards = new Cards();
|
Cards cards = new Cards();
|
||||||
cards.Owner = this;
|
cards.Owner = this;
|
||||||
cards.ShowDialog();
|
cards.ShowDialog();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1597,6 +1751,8 @@ namespace ZKuP
|
|||||||
|
|
||||||
private async void btnDelivery_Click(object sender, RoutedEventArgs e)
|
private async void btnDelivery_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
if ((sender as Button).Tag.ToString() == "DB")
|
if ((sender as Button).Tag.ToString() == "DB")
|
||||||
{
|
{
|
||||||
Delivery delivery = new Delivery(true);
|
Delivery delivery = new Delivery(true);
|
||||||
@ -1620,6 +1776,8 @@ namespace ZKuP
|
|||||||
//dgOverview.Items.SortDescriptions.Clear();
|
//dgOverview.Items.SortDescriptions.Clear();
|
||||||
//dgOverview.Items.SortDescriptions.Add(new SortDescription("Zutritt", ListSortDirection.Descending));
|
//dgOverview.Items.SortDescriptions.Add(new SortDescription("Zutritt", ListSortDirection.Descending));
|
||||||
//dgOverview.Items.Refresh();
|
//dgOverview.Items.Refresh();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1712,15 +1870,18 @@ namespace ZKuP
|
|||||||
getFahrzeuge();
|
getFahrzeuge();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
|
private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
var x = (sender as TextBox).Text;
|
var x = (sender as TextBox).Text;
|
||||||
var source = (dgToday.ItemsSource as DataView);
|
var source = (dgToday.ItemsSource as DataView);
|
||||||
|
var besuchSource = (dgTodayBesucher.ItemsSource as DataView);
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(x))
|
if (!string.IsNullOrWhiteSpace(x))
|
||||||
{
|
{
|
||||||
var filter = ($"Name LIKE '%{x}%' OR Ansprechpartner_Intern LIKE '%{x}%' OR Verantwortlicher_MA_Firma LIKE '%{x}%'");
|
var filter = ($"Name LIKE '%{x}%' OR Ansprechpartner_Intern LIKE '%{x}%' OR Verantwortlicher_MA_Firma LIKE '%{x}%'");
|
||||||
|
//var filterBesuch = ($"Name LIKE '%{x}%' OR Ansprechpartner_Intern LIKE '%{x}%' OR Verantwortlicher_MA_Firma LIKE '%{x}%'");
|
||||||
source.RowFilter = filter;
|
source.RowFilter = filter;
|
||||||
|
besuchSource.RowFilter = filter;
|
||||||
|
|
||||||
if (source.Count == 0)
|
if (source.Count == 0)
|
||||||
{
|
{
|
||||||
@ -1770,6 +1931,7 @@ namespace ZKuP
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
source.RowFilter = "";
|
source.RowFilter = "";
|
||||||
|
besuchSource.RowFilter = "";
|
||||||
//dgFirmen.DataContext = new DataTable();
|
//dgFirmen.DataContext = new DataTable();
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
@ -1779,6 +1941,7 @@ namespace ZKuP
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
source.RowFilter = "";
|
source.RowFilter = "";
|
||||||
|
besuchSource.RowFilter = "";
|
||||||
//dgFirmen.DataContext = new DataTable();
|
//dgFirmen.DataContext = new DataTable();
|
||||||
}
|
}
|
||||||
//if (dgOverview != null) todayFirm.DefaultView.RowFilter = $"Name like '%{(sender as TextBox).Text}%' OR Ansprechpartner_Intern like '%{(sender as TextBox).Text}%' OR Verantwortlicher_MA_Firma like '%{(sender as TextBox).Text}%'";
|
//if (dgOverview != null) todayFirm.DefaultView.RowFilter = $"Name like '%{(sender as TextBox).Text}%' OR Ansprechpartner_Intern like '%{(sender as TextBox).Text}%' OR Verantwortlicher_MA_Firma like '%{(sender as TextBox).Text}%'";
|
||||||
@ -1932,6 +2095,8 @@ namespace ZKuP
|
|||||||
{
|
{
|
||||||
if (RoleManager.LoggedInRole == Roles.Admin || RoleManager.LoggedInRole == Roles.Pförtner)
|
if (RoleManager.LoggedInRole == Roles.Admin || RoleManager.LoggedInRole == Roles.Pförtner)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
reloadTimer.Stop();
|
reloadTimer.Stop();
|
||||||
reloadTimerHinweis.Stop();
|
reloadTimerHinweis.Stop();
|
||||||
|
|
||||||
@ -2009,6 +2174,8 @@ namespace ZKuP
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void Arrivals_Closed(object sender, EventArgs e)
|
private async void Arrivals_Closed(object sender, EventArgs e)
|
||||||
@ -2022,6 +2189,8 @@ namespace ZKuP
|
|||||||
|
|
||||||
private void BtnInfo_Click(object sender, RoutedEventArgs e)
|
private void BtnInfo_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
var dc = ((sender as Button).DataContext) as DataRowView;
|
var dc = ((sender as Button).DataContext) as DataRowView;
|
||||||
int id = -1;
|
int id = -1;
|
||||||
string kat = "";
|
string kat = "";
|
||||||
@ -2047,34 +2216,51 @@ namespace ZKuP
|
|||||||
AspInfo aI = new AspInfo(id, kat, 1);
|
AspInfo aI = new AspInfo(id, kat, 1);
|
||||||
aI.Owner = this;
|
aI.Owner = this;
|
||||||
aI.ShowDialog();
|
aI.ShowDialog();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void btnCard_Click(object sender, RoutedEventArgs e)
|
private void btnCard_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
var dc = ((sender as Button).DataContext) as DataRowView;
|
var dc = ((sender as Button).DataContext) as DataRowView;
|
||||||
|
|
||||||
AddCardUser aI = new AddCardUser((dc).Row.ItemArray[2].ToString());
|
AddCardUser aI = new AddCardUser((dc).Row.ItemArray[2].ToString());
|
||||||
aI.Owner = this;
|
aI.Owner = this;
|
||||||
aI.ShowDialog();
|
aI.ShowDialog();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnKartenTausch_Click(object sender, RoutedEventArgs e)
|
private void btnKartenTausch_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
KartenTausch kT = new KartenTausch();
|
KartenTausch kT = new KartenTausch();
|
||||||
kT.Owner = this;
|
kT.Owner = this;
|
||||||
kT.ShowDialog();
|
kT.ShowDialog();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnArrivalsOverview_Click(object sender, RoutedEventArgs e)
|
private void btnArrivalsOverview_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
ArrivalsOverview aOv = new ArrivalsOverview(RoleManager.LoggedInRole);
|
ArrivalsOverview aOv = new ArrivalsOverview(RoleManager.LoggedInRole);
|
||||||
aOv.Owner = this;
|
aOv.Owner = this;
|
||||||
aOv.ShowDialog();
|
aOv.ShowDialog();
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void BtnInfoArrived_Click(object sender, RoutedEventArgs e)
|
private void BtnInfoArrived_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Cursor = Cursors.Wait;
|
||||||
|
|
||||||
var dc = ((sender as Button).DataContext) as DataRowView;
|
var dc = ((sender as Button).DataContext) as DataRowView;
|
||||||
int idFirma_Besucher = -1;
|
int idFirma_Besucher = -1;
|
||||||
string kat = "";
|
string kat = "";
|
||||||
@ -2098,6 +2284,8 @@ namespace ZKuP
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
MessageBox.Show("Keine gültigen Informationen vorhanden", "Fehler", MessageBoxButton.OK, MessageBoxImage.Information);
|
MessageBox.Show("Keine gültigen Informationen vorhanden", "Fehler", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
#pragma warning restore CS0472
|
#pragma warning restore CS0472
|
||||||
|
|
||||||
@ -2338,8 +2526,8 @@ namespace ZKuP
|
|||||||
bool isAdminEntry = false;
|
bool isAdminEntry = false;
|
||||||
if (RoleManager.LoggedInRole == Roles.Admin)
|
if (RoleManager.LoggedInRole == Roles.Admin)
|
||||||
{
|
{
|
||||||
var vertAspName = SQL.ReadSingleValue($"SELECT Vertreter FROM {MainWindow.table}.ansprechpartner WHERE Name = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "");
|
vertAspName = string.IsNullOrEmpty(vertAspName) ? SQL.ReadSingleValue($"SELECT Vertreter FROM {MainWindow.table}.ansprechpartner WHERE Name = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "") : vertAspName;
|
||||||
var nameAspVert = SQL.ReadSingleValue($"SELECT Name FROM {MainWindow.table}.ansprechpartner WHERE Vertreter = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "");
|
nameAspVert = string.IsNullOrEmpty(nameAspVert) ? SQL.ReadSingleValue($"SELECT Name FROM {MainWindow.table}.ansprechpartner WHERE Vertreter = '{Helper.InsertSpaceBeforeUpperCase(Environment.UserName)}'").Replace("-", "").Replace(" ", "") : nameAspVert;
|
||||||
|
|
||||||
var check = await SQL.ReadSQL($"SELECT * FROM {MainWindow.table}.zutritte where Zutritt >= now() + INTERVAL -20 SECOND AND (idFirma_Besucher IN (select idfirmen from {MainWindow.table}.firmen where Ersteller = '{Environment.UserName}' " +
|
var check = await SQL.ReadSQL($"SELECT * FROM {MainWindow.table}.zutritte where Zutritt >= now() + INTERVAL -20 SECOND AND (idFirma_Besucher IN (select idfirmen from {MainWindow.table}.firmen where Ersteller = '{Environment.UserName}' " +
|
||||||
$"OR Ersteller = '{Environment.UserDomainName}{Environment.UserName}' " +
|
$"OR Ersteller = '{Environment.UserDomainName}{Environment.UserName}' " +
|
||||||
@ -2875,7 +3063,7 @@ namespace ZKuP
|
|||||||
var gif = XamlAnimatedGif.AnimationBehavior.GetAnimator(imgLoading);
|
var gif = XamlAnimatedGif.AnimationBehavior.GetAnimator(imgLoading);
|
||||||
gif.Dispose();
|
gif.Dispose();
|
||||||
|
|
||||||
gridSpinner.Visibility = Visibility.Collapsed;
|
//gridSpinner.Visibility = Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MetroWindow_DragLeave(object sender, DragEventArgs e)
|
private void MetroWindow_DragLeave(object sender, DragEventArgs e)
|
||||||
@ -2911,6 +3099,21 @@ namespace ZKuP
|
|||||||
mEd.ShowDialog();
|
mEd.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void btnLostCard_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
//Leihausweis ausgeben
|
||||||
|
LeihausweisAusgeben lAa = new LeihausweisAusgeben();
|
||||||
|
lAa.WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
|
lAa.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnLeihAusweis_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
//Leihausweis beantragen
|
||||||
|
LeihausweisBeantragen lAb = new LeihausweisBeantragen();
|
||||||
|
lAb.WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
|
lAb.ShowDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
xmlns:local="clr-namespace:ZKuP"
|
xmlns:local="clr-namespace:ZKuP"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Ansprechpartner verwalten" Height="450" Width="1080"
|
Title="Ansprechpartner verwalten" Height="450" Width="1080"
|
||||||
WindowStartupLocation="CenterOwner" MinHeight="450" MinWidth="1080">
|
WindowStartupLocation="CenterScreen" MinHeight="450" MinWidth="1080">
|
||||||
<Grid>
|
<Grid>
|
||||||
<DataGrid x:Name="dgAsp" Margin="305,10,7,52" ItemsSource="{Binding Path=., Mode=OneWay}" ToolTip="Einträge können mit Doppelklick auf die Zelle geändert werden" CanUserAddRows="False" AutoGenerateColumns="False" CanUserReorderColumns="False" PreviewKeyDown="DgAsp_PreviewKeyDown" CellEditEnding="DgAsp_CellEditEnding" BeginningEdit="DgAsp_BeginningEdit">
|
<DataGrid x:Name="dgAsp" Margin="305,10,7,52" ItemsSource="{Binding Path=., Mode=OneWay}" ToolTip="Einträge können mit Doppelklick auf die Zelle geändert werden" CanUserAddRows="False" AutoGenerateColumns="False" CanUserReorderColumns="False" PreviewKeyDown="DgAsp_PreviewKeyDown" CellEditEnding="DgAsp_CellEditEnding" BeginningEdit="DgAsp_BeginningEdit">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
|
|||||||
@ -213,6 +213,8 @@ namespace ZKuP
|
|||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
private void Window_LocationChanged(object sender, EventArgs e)
|
||||||
|
|||||||
@ -170,6 +170,8 @@ namespace ZKuP
|
|||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
private void Window_LocationChanged(object sender, EventArgs e)
|
||||||
|
|||||||
@ -588,6 +588,8 @@ namespace ZKuP
|
|||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
|
|
||||||
|
Cursor = Cursors.Arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void dpDataGridBesuchstag_CalendarClosed(object sender, RoutedEventArgs e)
|
private async void dpDataGridBesuchstag_CalendarClosed(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
53
ZKuP/ParkMultiplePrint.xaml
Normal file
53
ZKuP/ParkMultiplePrint.xaml
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<mah:MetroWindow x:Class="ZKuP.ParkMultiplePrint"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
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:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||||||
|
xmlns:local="clr-namespace:ZKuP"
|
||||||
|
SizeToContent="Height"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Mehrere Parkausweis-Drucke bestätigen" Height="158" Width="170" ResizeMode="NoResize" WindowStartupLocation="CenterOwner">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition/>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<ListView x:Name="lvAusweise" Margin="5,5,5,10" ItemsSource="{Binding Ausweise}">
|
||||||
|
<ListView.View>
|
||||||
|
<GridView>
|
||||||
|
<GridViewColumn Header="☑">
|
||||||
|
<GridViewColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox IsChecked="{Binding IstAusgewählt, Mode=TwoWay}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</GridViewColumn.CellTemplate>
|
||||||
|
</GridViewColumn>
|
||||||
|
|
||||||
|
<GridViewColumn Header="Ausweisnummer" Width="Auto">
|
||||||
|
<GridViewColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding Ausweisnummer}"
|
||||||
|
TextAlignment="Center"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Margin="0,0,5,0" />
|
||||||
|
</DataTemplate>
|
||||||
|
</GridViewColumn.CellTemplate>
|
||||||
|
</GridViewColumn>
|
||||||
|
</GridView>
|
||||||
|
</ListView.View>
|
||||||
|
</ListView>
|
||||||
|
<!--<DataGrid x:Name="dgAusweise" Margin="5,5,5,10">
|
||||||
|
<DataGridCheckBoxColumn Header="☑"/>
|
||||||
|
<DataGridTextColumn Binding="{Binding .}"/>
|
||||||
|
</DataGrid>-->
|
||||||
|
<Button x:Name="btnPrinted" Grid.Row="1" VerticalAlignment="Bottom" mah:ControlsHelper.CornerRadius="0" Click="btnPrinted_Click">
|
||||||
|
<Button.Content>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Ausgewählte" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Text="erfolgreich gedruckt" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
</mah:MetroWindow>
|
||||||
54
ZKuP/ParkMultiplePrint.xaml.cs
Normal file
54
ZKuP/ParkMultiplePrint.xaml.cs
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
using MahApps.Metro.Controls;
|
||||||
|
using Org.BouncyCastle.Crypto;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
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.Shapes;
|
||||||
|
|
||||||
|
namespace ZKuP
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaktionslogik für ParkMultiplePrint.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class ParkMultiplePrint : MetroWindow
|
||||||
|
{
|
||||||
|
public ParkMultiplePrint(List<int> Ausweise)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
var ausweisListe = Ausweise
|
||||||
|
.Select(id => new Ausweis { Ausweisnummer = id })
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
lvAusweise.ItemsSource = ausweisListe;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnPrinted_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var ausgewählte = lvAusweise.ItemsSource.Cast<Ausweis>().Where(a => a.IstAusgewählt).ToList();
|
||||||
|
|
||||||
|
foreach (var i in ausgewählte)
|
||||||
|
SQL.WriteSQL($"UPDATE {MainWindow.table}.parkausweise SET Gedruckt = '1' WHERE idparkausweise = '{i.Ausweisnummer}'");
|
||||||
|
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Ausweis
|
||||||
|
{
|
||||||
|
public bool IstAusgewählt { get; set; }
|
||||||
|
public int Ausweisnummer { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -6,7 +6,7 @@
|
|||||||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||||||
xmlns:local="clr-namespace:ZKuP"
|
xmlns:local="clr-namespace:ZKuP"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Parkausweise drucken" Height="450" Width="800" Loaded="Window_Loaded" LocationChanged="Window_LocationChanged">
|
Title="Parkausweise drucken" Height="450" Width="800" Loaded="Window_Loaded" LocationChanged="Window_LocationChanged" Closing="MetroWindow_Closing" >
|
||||||
<Grid>
|
<Grid>
|
||||||
<DataGrid x:Name="dgPrint" AutoGenerateColumns="False" ItemsSource="{Binding .}" CanUserDeleteRows="False" CanUserAddRows="False" CanUserReorderColumns="False">
|
<DataGrid x:Name="dgPrint" AutoGenerateColumns="False" ItemsSource="{Binding .}" CanUserDeleteRows="False" CanUserAddRows="False" CanUserReorderColumns="False">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using MahApps.Metro.Controls;
|
using MahApps.Metro.Controls;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -20,6 +21,7 @@ namespace ZKuP
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class PrintParkausweis : MetroWindow
|
public partial class PrintParkausweis : MetroWindow
|
||||||
{
|
{
|
||||||
|
List<int> park = new List<int>();
|
||||||
public PrintParkausweis()
|
public PrintParkausweis()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -36,10 +38,21 @@ namespace ZKuP
|
|||||||
{
|
{
|
||||||
if (Helper.OpenAndEditWord($"{arr[1].ToString()} {arr[2].ToString()}", arr[3].ToString(), arr[7].ToString(), arr[0].ToString(), Convert.ToInt16(arr[19]), arr[6].ToString()))
|
if (Helper.OpenAndEditWord($"{arr[1].ToString()} {arr[2].ToString()}", arr[3].ToString(), arr[7].ToString(), arr[0].ToString(), Convert.ToInt16(arr[19]), arr[6].ToString()))
|
||||||
{
|
{
|
||||||
if (MessageBox.Show(this, "Wurde der Parkausweis erfolgreich gedruckt?", "Erfolgreich gedruckt?", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
|
var msgRes = MessageBox.Show(this, "Wurde der Parkausweis erfolgreich gedruckt?\n\nJa: Ausweis wurde erfolgreich gedruckt\nNein: Ausweis nicht erfolgreich gedruckt\nAbbrechen: Später fragen, da mehrere Ausweise gedruckt werden", "Erfolgreich gedruckt?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question, MessageBoxResult.No);
|
||||||
|
if (msgRes == MessageBoxResult.Yes)
|
||||||
{
|
{
|
||||||
await SQL.WriteSQL($"UPDATE {MainWindow.table}.parkausweise SET Gedruckt = '1' WHERE idparkausweise = '{(int)arr[0]}'");
|
await SQL.WriteSQL($"UPDATE {MainWindow.table}.parkausweise SET Gedruckt = '1' WHERE idparkausweise = '{(int)arr[0]}'");
|
||||||
}
|
}
|
||||||
|
else if (msgRes == MessageBoxResult.Cancel)
|
||||||
|
{
|
||||||
|
var row = (DataGridRow)dgPrint.ItemContainerGenerator.ContainerFromItem(((sender as Button).DataContext as System.Data.DataRowView));
|
||||||
|
if (row != null)
|
||||||
|
{
|
||||||
|
row.Background = (SolidColorBrush)Application.Current.Resources["MahApps.Brushes.Accent"];
|
||||||
|
}
|
||||||
|
park.Add((int)arr[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -64,5 +77,15 @@ namespace ZKuP
|
|||||||
{
|
{
|
||||||
Helper.CheckWindowIsInScreenSpace(this);
|
Helper.CheckWindowIsInScreenSpace(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||||
|
{
|
||||||
|
if (park.Count > 0)
|
||||||
|
{
|
||||||
|
ParkMultiplePrint pMp = new ParkMultiplePrint(park);
|
||||||
|
pMp.Owner = this;
|
||||||
|
pMp.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,6 +59,7 @@ namespace ZKuP
|
|||||||
main.btnKartenTausch.Visibility = Visibility.Visible;
|
main.btnKartenTausch.Visibility = Visibility.Visible;
|
||||||
main.btnBE.Visibility = Visibility.Visible;
|
main.btnBE.Visibility = Visibility.Visible;
|
||||||
main.btnApproveFzg.Visibility = Visibility.Visible;
|
main.btnApproveFzg.Visibility = Visibility.Visible;
|
||||||
|
main.btnLostCard.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
main.btnCheckParkausweis.Visibility = Visibility.Visible;
|
main.btnCheckParkausweis.Visibility = Visibility.Visible;
|
||||||
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
||||||
@ -86,6 +87,10 @@ namespace ZKuP
|
|||||||
//MessageBox.Show("Sie sind Admin");
|
//MessageBox.Show("Sie sind Admin");
|
||||||
// something that only an admin user should be able to do
|
// something that only an admin user should be able to do
|
||||||
|
|
||||||
|
//Parkplatzanzeige
|
||||||
|
main.BE.Visibility = Visibility.Visible;
|
||||||
|
main.BesuchP.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
if (Environment.UserName == "RainerGaertner")
|
if (Environment.UserName == "RainerGaertner")
|
||||||
{
|
{
|
||||||
main.btnIvoBackground.Visibility = Visibility.Visible;
|
main.btnIvoBackground.Visibility = Visibility.Visible;
|
||||||
@ -131,6 +136,7 @@ namespace ZKuP
|
|||||||
main.btnBE.Visibility = Visibility.Visible;
|
main.btnBE.Visibility = Visibility.Visible;
|
||||||
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
||||||
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
||||||
|
main.btnLostCard.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
@ -145,6 +151,9 @@ namespace ZKuP
|
|||||||
main.btnMcFitSign.Visibility = Visibility.Visible;
|
main.btnMcFitSign.Visibility = Visibility.Visible;
|
||||||
//btnNotification.Visibility = Visibility.Visible;
|
//btnNotification.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
//Parkplatzanzeige
|
||||||
|
main.BE.Visibility = Visibility.Collapsed;
|
||||||
|
main.BesuchP.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
main.tcMainMenu.SelectedIndex = 1;
|
main.tcMainMenu.SelectedIndex = 1;
|
||||||
}
|
}
|
||||||
@ -183,6 +192,7 @@ namespace ZKuP
|
|||||||
main.btnBE.Visibility = Visibility.Visible;
|
main.btnBE.Visibility = Visibility.Visible;
|
||||||
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
||||||
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
||||||
|
main.btnLostCard.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
@ -197,6 +207,9 @@ namespace ZKuP
|
|||||||
main.btnMcFitSign.Visibility = Visibility.Visible;
|
main.btnMcFitSign.Visibility = Visibility.Visible;
|
||||||
//btnNotification.Visibility = Visibility.Visible;
|
//btnNotification.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
//Parkplatzanzeige
|
||||||
|
main.BE.Visibility = Visibility.Collapsed;
|
||||||
|
main.BesuchP.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
main.tcMainMenu.SelectedIndex = 1;
|
main.tcMainMenu.SelectedIndex = 1;
|
||||||
}
|
}
|
||||||
@ -235,6 +248,7 @@ namespace ZKuP
|
|||||||
main.btnBE.Visibility = Visibility.Visible;
|
main.btnBE.Visibility = Visibility.Visible;
|
||||||
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
||||||
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
||||||
|
main.btnLostCard.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
||||||
main.btnCheckParkausweis.Visibility = Visibility.Visible;
|
main.btnCheckParkausweis.Visibility = Visibility.Visible;
|
||||||
@ -254,6 +268,9 @@ namespace ZKuP
|
|||||||
main.btnMcFitSign.Visibility = Visibility.Visible;
|
main.btnMcFitSign.Visibility = Visibility.Visible;
|
||||||
//btnNotification.Visibility = Visibility.Visible;
|
//btnNotification.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
//Parkplatzanzeige
|
||||||
|
main.BE.Visibility = Visibility.Visible;
|
||||||
|
main.BesuchP.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
main.tcMainMenu.SelectedIndex = 1;
|
main.tcMainMenu.SelectedIndex = 1;
|
||||||
}
|
}
|
||||||
@ -292,6 +309,7 @@ namespace ZKuP
|
|||||||
main.btnBE.Visibility = Visibility.Visible;
|
main.btnBE.Visibility = Visibility.Visible;
|
||||||
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
||||||
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
||||||
|
main.btnLostCard.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
||||||
main.btnCheckParkausweis.Visibility = Visibility.Visible;
|
main.btnCheckParkausweis.Visibility = Visibility.Visible;
|
||||||
@ -311,6 +329,9 @@ namespace ZKuP
|
|||||||
main.btnMcFitSign.Visibility = Visibility.Visible;
|
main.btnMcFitSign.Visibility = Visibility.Visible;
|
||||||
//btnNotification.Visibility = Visibility.Visible;
|
//btnNotification.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
//Parkplatzanzeige
|
||||||
|
main.BE.Visibility = Visibility.Visible;
|
||||||
|
main.BesuchP.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
main.tcMainMenu.SelectedIndex = 1;
|
main.tcMainMenu.SelectedIndex = 1;
|
||||||
}
|
}
|
||||||
@ -351,6 +372,7 @@ namespace ZKuP
|
|||||||
main.btnBE.Visibility = Visibility.Visible;
|
main.btnBE.Visibility = Visibility.Visible;
|
||||||
main.btnKartenTausch.Visibility = Visibility.Visible;
|
main.btnKartenTausch.Visibility = Visibility.Visible;
|
||||||
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
||||||
|
main.btnLostCard.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
main.btnCheckParkausweis.Visibility = Visibility.Visible;
|
main.btnCheckParkausweis.Visibility = Visibility.Visible;
|
||||||
//btnPrintParkausweis.Visibility = Visibility.Visible;
|
//btnPrintParkausweis.Visibility = Visibility.Visible;
|
||||||
@ -366,6 +388,9 @@ namespace ZKuP
|
|||||||
main.btnMcFitSign.Visibility = Visibility.Collapsed;
|
main.btnMcFitSign.Visibility = Visibility.Collapsed;
|
||||||
//btnNotification.Visibility = Visibility.Collapsed;
|
//btnNotification.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
//Parkplatzanzeige
|
||||||
|
main.BE.Visibility = Visibility.Visible;
|
||||||
|
main.BesuchP.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
main.tcMainMenu.SelectedIndex = 2;
|
main.tcMainMenu.SelectedIndex = 2;
|
||||||
}
|
}
|
||||||
@ -417,6 +442,7 @@ namespace ZKuP
|
|||||||
main.btnBE.Visibility = Visibility.Collapsed;
|
main.btnBE.Visibility = Visibility.Collapsed;
|
||||||
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
||||||
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
||||||
|
main.btnLostCard.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
main.btnCheckParkausweis.Visibility = Visibility.Collapsed;
|
main.btnCheckParkausweis.Visibility = Visibility.Collapsed;
|
||||||
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
main.btnCreateParkausweis.Visibility = Visibility.Visible;
|
||||||
@ -432,6 +458,9 @@ namespace ZKuP
|
|||||||
main.btnMcFitSign.Visibility = Visibility.Visible;
|
main.btnMcFitSign.Visibility = Visibility.Visible;
|
||||||
//btnNotification.Visibility = Visibility.Collapsed;
|
//btnNotification.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
//Parkplatzanzeige
|
||||||
|
main.BE.Visibility = Visibility.Collapsed;
|
||||||
|
main.BesuchP.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
main.tcMainMenu.SelectedIndex = 1;
|
main.tcMainMenu.SelectedIndex = 1;
|
||||||
}
|
}
|
||||||
@ -479,6 +508,7 @@ namespace ZKuP
|
|||||||
main.btnMcFitSign.Visibility = Visibility.Collapsed;
|
main.btnMcFitSign.Visibility = Visibility.Collapsed;
|
||||||
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
||||||
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
||||||
|
main.btnLostCard.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
//lblSearch.Visibility = Visibility.Collapsed;
|
//lblSearch.Visibility = Visibility.Collapsed;
|
||||||
main.tbSearch.Visibility = Visibility.Collapsed;
|
main.tbSearch.Visibility = Visibility.Collapsed;
|
||||||
@ -490,6 +520,9 @@ namespace ZKuP
|
|||||||
//main.lblmcfit2.Visibility = Visibility.Collapsed;
|
//main.lblmcfit2.Visibility = Visibility.Collapsed;
|
||||||
//btnNotification.Visibility = Visibility.Collapsed;
|
//btnNotification.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
//Parkplatzanzeige
|
||||||
|
main.BE.Visibility = Visibility.Collapsed;
|
||||||
|
main.BesuchP.Visibility = Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void BesucherCreateStart()
|
internal void BesucherCreateStart()
|
||||||
@ -538,6 +571,7 @@ namespace ZKuP
|
|||||||
main.btnMcFitSign.Visibility = Visibility.Visible;
|
main.btnMcFitSign.Visibility = Visibility.Visible;
|
||||||
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
main.btnKartenTausch.Visibility = Visibility.Collapsed;
|
||||||
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
main.btnApproveFzg.Visibility = Visibility.Collapsed;
|
||||||
|
main.btnLostCard.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
//lblSearch.Visibility = Visibility.Collapsed;
|
//lblSearch.Visibility = Visibility.Collapsed;
|
||||||
main.tbSearch.Visibility = Visibility.Collapsed;
|
main.tbSearch.Visibility = Visibility.Collapsed;
|
||||||
@ -547,9 +581,13 @@ namespace ZKuP
|
|||||||
main.btnClearSearchArrived.Visibility = Visibility.Collapsed;
|
main.btnClearSearchArrived.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
main.btnDarkMode.Visibility = Visibility.Collapsed;
|
main.btnDarkMode.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
//main.lblmcfit2.Visibility = Visibility.Visible;
|
//main.lblmcfit2.Visibility = Visibility.Visible;
|
||||||
//btnNotification.Visibility = Visibility.Collapsed;
|
//btnNotification.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
//Parkplatzanzeige
|
||||||
|
main.BE.Visibility = Visibility.Collapsed;
|
||||||
|
main.BesuchP.Visibility = Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
31
ZKuP/SQL.cs
31
ZKuP/SQL.cs
@ -5,6 +5,7 @@ using System.Data;
|
|||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics.Eventing.Reader;
|
using System.Diagnostics.Eventing.Reader;
|
||||||
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.NetworkInformation;
|
using System.Net.NetworkInformation;
|
||||||
@ -12,7 +13,10 @@ using System.Runtime.CompilerServices;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Interop;
|
||||||
using System.Windows.Markup;
|
using System.Windows.Markup;
|
||||||
|
using System.Windows.Resources;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Windows.Phone.PersonalInformation;
|
using Windows.Phone.PersonalInformation;
|
||||||
|
|
||||||
@ -21,7 +25,7 @@ namespace ZKuP
|
|||||||
public static class SQL
|
public static class SQL
|
||||||
{
|
{
|
||||||
private static string p = "fNZG8bO+b8lbajxNUCPCIRNBap4/T5N5Qoa0Rec3P9b2EiwC5eNIwfEMjR5Fvc/W";
|
private static string p = "fNZG8bO+b8lbajxNUCPCIRNBap4/T5N5Qoa0Rec3P9b2EiwC5eNIwfEMjR5Fvc/W";
|
||||||
private static string s = "KYgjkRVn0edFDca2GbZq/A==";
|
private static string s = "KYgjkRVn0edFDca2GbZq/A=="; // "d0cRVbko84WkycpOfE30db5kQvnIprtdeNhhB6BtCdg="; new server
|
||||||
private static string uSSL = "miSRZrFLxAAWlzRLx9B6Ww==";
|
private static string uSSL = "miSRZrFLxAAWlzRLx9B6Ww==";
|
||||||
private static string d = "xWb4X9gPEzwe76zqpysF3w==";
|
private static string d = "xWb4X9gPEzwe76zqpysF3w==";
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
@ -62,15 +66,15 @@ namespace ZKuP
|
|||||||
{
|
{
|
||||||
System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping();
|
System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping();
|
||||||
//change the following ip variable into the ip adress you are looking for
|
//change the following ip variable into the ip adress you are looking for
|
||||||
System.Net.IPAddress address = System.Net.IPAddress.Parse(GetIP());
|
//System.Net.IPAddress address = System.Net.IPAddress.Parse(GetIP());
|
||||||
System.Net.NetworkInformation.PingReply pong = ping.Send(address);
|
System.Net.NetworkInformation.PingReply pong = ping.Send(GetIP());
|
||||||
if (pong.Status == System.Net.NetworkInformation.IPStatus.Success)
|
if (pong.Status == System.Net.NetworkInformation.IPStatus.Success)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pong = ping.Send(address);
|
pong = ping.Send(GetIP());
|
||||||
|
|
||||||
if (pong.Status == System.Net.NetworkInformation.IPStatus.Success)
|
if (pong.Status == System.Net.NetworkInformation.IPStatus.Success)
|
||||||
{
|
{
|
||||||
@ -125,7 +129,7 @@ namespace ZKuP
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(ip))
|
if (string.IsNullOrWhiteSpace(ip))
|
||||||
{
|
{
|
||||||
ip = Crypto.Decrypt(Crypto.GetHashKey("866D137B10C95A4E8D5091B0CC0EFB8F"), s);
|
ip = Crypto.Decrypt(Crypto.GetHashKey("866D137B10C95A4E8D5091B0CC0EFB8F"), s); // new Hash "534939882ECA063C7F8B15E10DCBE3D5"
|
||||||
return ip;
|
return ip;
|
||||||
}
|
}
|
||||||
else return ip;
|
else return ip;
|
||||||
@ -174,7 +178,8 @@ namespace ZKuP
|
|||||||
|
|
||||||
public static MySqlConnection GetConnection()
|
public static MySqlConnection GetConnection()
|
||||||
{
|
{
|
||||||
return new MySqlConnection(GetConnstr());
|
var str = GetConnstr();
|
||||||
|
return new MySqlConnection(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -764,8 +769,22 @@ namespace ZKuP
|
|||||||
//And use:
|
//And use:
|
||||||
//using (System.IO.MemoryStream ms = new System.IO.MemoryStream(data))
|
//using (System.IO.MemoryStream ms = new System.IO.MemoryStream(data))
|
||||||
//{
|
//{
|
||||||
|
|
||||||
|
if (data.Length > 100)
|
||||||
|
{
|
||||||
System.IO.MemoryStream ms = new System.IO.MemoryStream(data);
|
System.IO.MemoryStream ms = new System.IO.MemoryStream(data);
|
||||||
image = new System.Drawing.Bitmap(ms);
|
image = new System.Drawing.Bitmap(ms);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var uri = new Uri(@"/Resources/NoSignature.png", UriKind.Relative);
|
||||||
|
StreamResourceInfo info = System.Windows.Application.GetResourceStream(uri);
|
||||||
|
using (var stream = info.Stream)
|
||||||
|
{
|
||||||
|
image = new Bitmap(stream);
|
||||||
|
}
|
||||||
|
//image = new System.Windows.Media.Imaging.BitmapImage(new Uri(@"/Resources/NoSignature.png", UriKind.Relative));
|
||||||
|
}
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,6 +70,9 @@ namespace ZKuP
|
|||||||
case DisclaimerType.Rueck:
|
case DisclaimerType.Rueck:
|
||||||
signoPad.ShowDisclaimerRueck(ansprechpartner, showDisclaimer);
|
signoPad.ShowDisclaimerRueck(ansprechpartner, showDisclaimer);
|
||||||
break;
|
break;
|
||||||
|
case DisclaimerType.LostCard:
|
||||||
|
signoPad.ShowDisclaimerLostCard(Name, Firma_Abteilung, showDisclaimer);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
signoPad.ShowDisclaimerParken(Name, Firma_Abteilung, Kennzeichen_Handynr, showDisclaimer);
|
signoPad.ShowDisclaimerParken(Name, Firma_Abteilung, Kennzeichen_Handynr, showDisclaimer);
|
||||||
break;
|
break;
|
||||||
@ -174,7 +177,8 @@ namespace ZKuP
|
|||||||
McFit,
|
McFit,
|
||||||
Gruen,
|
Gruen,
|
||||||
Rot,
|
Rot,
|
||||||
Rueck
|
Rueck,
|
||||||
|
LostCard
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:ZKuP"
|
xmlns:local="clr-namespace:ZKuP"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="XMessageBox" Height="430" Width="700" ResizeMode="NoResize" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" Closing="MetroWindow_Closing">
|
Title="XMessageBox" Height="460" Width="700" ResizeMode="NoResize" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" Closing="MetroWindow_Closing">
|
||||||
<Grid>
|
<Grid>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom">
|
||||||
<Button x:Name="btnYes" Content="Ja" IsEnabled="False" ToolTip="Für 'Ja' muss eine gültige Email-Adresse eingetragen werden" ToolTipService.InitialShowDelay="200" ToolTipService.ShowOnDisabled="True" Margin="0,0,10,10" Width="94" Height="29" Click="btnYes_Click"/>
|
<Button x:Name="btnYes" Content="Ja" IsEnabled="False" ToolTip="Für 'Ja' muss eine gültige Email-Adresse eingetragen werden" ToolTipService.InitialShowDelay="200" ToolTipService.ShowOnDisabled="True" Margin="0,0,10,10" Width="94" Height="29" Click="btnYes_Click"/>
|
||||||
@ -14,6 +14,7 @@
|
|||||||
<Button x:Name="btnCancel" Content="Abbrechen" Margin="0,0,10,10" Width="94" Height="29" Click="btnCancel_Click"/>
|
<Button x:Name="btnCancel" Content="Abbrechen" Margin="0,0,10,10" Width="94" Height="29" Click="btnCancel_Click"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<TextBlock x:Name="Message" Margin="90,20,10,0" TextWrapping="Wrap" TextAlignment="Left" VerticalAlignment="Top">
|
<TextBlock x:Name="Message" Margin="90,20,10,0" TextWrapping="Wrap" TextAlignment="Left" VerticalAlignment="Top">
|
||||||
|
|
||||||
<Run FontWeight="Bold" FontSize="14" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="Fahrzeuganzahl > 1:"/><LineBreak/>
|
<Run FontWeight="Bold" FontSize="14" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="Fahrzeuganzahl > 1:"/><LineBreak/>
|
||||||
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="Hierfür wird eine Genehmigung vom Objektschutzbeauftragten benötigt"/><LineBreak/>
|
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="Hierfür wird eine Genehmigung vom Objektschutzbeauftragten benötigt"/><LineBreak/>
|
||||||
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="Das erste Fahrzeug ist freigegeben, alle weiteren werden nach Genehmigung automatisch eingetragen"/><LineBreak/>
|
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="Das erste Fahrzeug ist freigegeben, alle weiteren werden nach Genehmigung automatisch eingetragen"/><LineBreak/>
|
||||||
@ -21,6 +22,8 @@
|
|||||||
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" FontWeight="Bold" FontSize="14" Text="Möchten Sie sicher mehr als ein Fahrzeug eintragen?"/><LineBreak/>
|
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" FontWeight="Bold" FontSize="14" Text="Möchten Sie sicher mehr als ein Fahrzeug eintragen?"/><LineBreak/>
|
||||||
<LineBreak/>
|
<LineBreak/>
|
||||||
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" FontWeight="Bold" FontSize="14" Text="Ja:"/><LineBreak/>
|
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" FontWeight="Bold" FontSize="14" Text="Ja:"/><LineBreak/>
|
||||||
|
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" - Für diese Option "/><Run FontWeight="Bold" TextDecorations="Underline" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="muss eine gültige Email zur Benachrichtigung angegeben werden (Ihre oder Vertreter)"/><LineBreak/>
|
||||||
|
<LineBreak/>
|
||||||
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" - "/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="{Binding bereitsGenehmigt}"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="{Binding OldFzgAnzahl}"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="{Binding FzgAnzahlText}"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" direkt eingetragen"/><LineBreak/>
|
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" - "/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="{Binding bereitsGenehmigt}"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="{Binding OldFzgAnzahl}"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="{Binding FzgAnzahlText}"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" direkt eingetragen"/><LineBreak/>
|
||||||
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" - Eine Anfrage zur Genehmigung der zusätzlichen Fahrzeuge wird an den Objektschutzbeauftragten geschickt"/><LineBreak/>
|
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" - Eine Anfrage zur Genehmigung der zusätzlichen Fahrzeuge wird an den Objektschutzbeauftragten geschickt"/><LineBreak/>
|
||||||
<LineBreak/>
|
<LineBreak/>
|
||||||
@ -28,7 +31,6 @@
|
|||||||
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" und Sie werden per Email informiert"/><LineBreak/>
|
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" und Sie werden per Email informiert"/><LineBreak/>
|
||||||
<LineBreak/>
|
<LineBreak/>
|
||||||
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" - Bei "/><Run FontWeight="Bold" Foreground="Red" Text="Ablehnung"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" bleibt die Anzahl auf "/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="{Binding OldFzgAnzahl}"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" und Sie werden per Email informiert"/><LineBreak/>
|
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" - Bei "/><Run FontWeight="Bold" Foreground="Red" Text="Ablehnung"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" bleibt die Anzahl auf "/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="{Binding OldFzgAnzahl}"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" und Sie werden per Email informiert"/><LineBreak/>
|
||||||
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" - Für diese Option "/><Run FontWeight="Bold" TextDecorations="Underline" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="muss eine gültige Email angegeben werden"/><LineBreak/>
|
|
||||||
<LineBreak/>
|
<LineBreak/>
|
||||||
<Run FontWeight="Bold" FontSize="14" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="Nein:"/><LineBreak/>
|
<Run FontWeight="Bold" FontSize="14" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="Nein:"/><LineBreak/>
|
||||||
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" - Die Fahrzeuganzahl wird auf "/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="{Binding OldFzgAnzahl}"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" reduziert und eingetragen"/><LineBreak/>
|
<Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" - Die Fahrzeuganzahl wird auf "/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text="{Binding OldFzgAnzahl}"/><Run Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" Text=" reduziert und eingetragen"/><LineBreak/>
|
||||||
@ -37,7 +39,7 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Image x:Name="Image" HorizontalAlignment="Left" Height="44" Margin="26,34,0,95" VerticalAlignment="Top" Width="44"/>
|
<Image x:Name="Image" HorizontalAlignment="Left" Height="44" Margin="26,34,0,95" VerticalAlignment="Top" Width="44"/>
|
||||||
|
|
||||||
<TextBox x:Name="tbTextBox" TextAlignment="Center" mah:TextBoxHelper.Watermark="Watermark" HorizontalAlignment="Left" MinWidth="300" MaxWidth="350" Height="30" VerticalAlignment="Bottom" Margin="20,0,20,10" TextChanged="tbTextBox_TextChanged"/>
|
<TextBox x:Name="tbTextBox" TextAlignment="Center" mah:TextBoxHelper.Watermark="Email Adresse zur Benachrichtigung" HorizontalAlignment="Left" MinWidth="300" MaxWidth="350" Height="30" VerticalAlignment="Bottom" Margin="20,0,20,10" TextChanged="tbTextBox_TextChanged"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</mah:MetroWindow>
|
</mah:MetroWindow>
|
||||||
|
|||||||
@ -285,6 +285,12 @@
|
|||||||
<Compile Include="KartenTausch.xaml.cs">
|
<Compile Include="KartenTausch.xaml.cs">
|
||||||
<DependentUpon>KartenTausch.xaml</DependentUpon>
|
<DependentUpon>KartenTausch.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="LeihausweisAusgeben.xaml.cs">
|
||||||
|
<DependentUpon>LeihausweisAusgeben.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="LeihausweisBeantragen.xaml.cs">
|
||||||
|
<DependentUpon>LeihausweisBeantragen.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Log.cs" />
|
<Compile Include="Log.cs" />
|
||||||
<Compile Include="ManageDeliveries.xaml.cs">
|
<Compile Include="ManageDeliveries.xaml.cs">
|
||||||
<DependentUpon>ManageDeliveries.xaml</DependentUpon>
|
<DependentUpon>ManageDeliveries.xaml</DependentUpon>
|
||||||
@ -312,6 +318,9 @@
|
|||||||
<Compile Include="ParkausweisDisclaimer.xaml.cs">
|
<Compile Include="ParkausweisDisclaimer.xaml.cs">
|
||||||
<DependentUpon>ParkausweisDisclaimer.xaml</DependentUpon>
|
<DependentUpon>ParkausweisDisclaimer.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="ParkMultiplePrint.xaml.cs">
|
||||||
|
<DependentUpon>ParkMultiplePrint.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="PrintParkausweis.xaml.cs">
|
<Compile Include="PrintParkausweis.xaml.cs">
|
||||||
<DependentUpon>PrintParkausweis.xaml</DependentUpon>
|
<DependentUpon>PrintParkausweis.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -443,6 +452,14 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="LeihausweisAusgeben.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="LeihausweisBeantragen.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="ManageDeliveries.xaml">
|
<Page Include="ManageDeliveries.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@ -487,6 +504,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="ParkMultiplePrint.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="PrintParkausweis.xaml">
|
<Page Include="PrintParkausweis.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
245
ZKuP/signoPad.cs
245
ZKuP/signoPad.cs
@ -1167,7 +1167,7 @@ namespace ZKuP
|
|||||||
|
|
||||||
|
|
||||||
if (Rueckgebender != "")
|
if (Rueckgebender != "")
|
||||||
_stPad.DisplaySetTextInRect(10, 10, _stPad.DisplayWidth - 20, _stPad.DisplayHeight - 60, signotec.STPadLibNet.TextAlignment.Left, $"Ich bestätige hiermit dass ich alle an die Firma/Besucher ausgegebenen Karten vollständig zurückgebe\n\nBenutzer: {Rueckgebender}");
|
_stPad.DisplaySetTextInRect(10, 10, _stPad.DisplayWidth - 20, _stPad.DisplayHeight - 60, signotec.STPadLibNet.TextAlignment.Left, $"Ich bestätige hiermit dass ich alle an die Firma/Besucher ausgegebenen Karten vollständig zurückgeben\n\nBenutzer: {Rueckgebender}");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string Rueckgeber = "";
|
string Rueckgeber = "";
|
||||||
@ -1179,7 +1179,7 @@ namespace ZKuP
|
|||||||
Rueckgeber = messageBox.Result;
|
Rueckgeber = messageBox.Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
_stPad.DisplaySetTextInRect(10, 10, _stPad.DisplayWidth - 20, _stPad.DisplayHeight - 60, signotec.STPadLibNet.TextAlignment.Left, $"Ich bestätige hiermit dass ich alle an die Firma/Besucher ausgegebenen Karten vollständig zurückgebe\n\nBenutzer: {Rueckgeber}");
|
_stPad.DisplaySetTextInRect(10, 10, _stPad.DisplayWidth - 20, _stPad.DisplayHeight - 60, signotec.STPadLibNet.TextAlignment.Left, $"Ich bestätige hiermit dass ich alle an die Firma/Besucher ausgegebenen Karten vollständig zurückgeben\n\nBenutzer: {Rueckgeber}");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -1338,6 +1338,247 @@ namespace ZKuP
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool ShowDisclaimerLostCard(string Name = "", string Firma_Abteilung = "", bool showDisclaimer = true)
|
||||||
|
{
|
||||||
|
SignatureConfirmed = false;
|
||||||
|
// display disclaimer and two buttons "Cancel" and "Confirm"
|
||||||
|
if (!GetDevices())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//_stPad.DeviceOpen(_signPads.Length - 1, true);
|
||||||
|
_stPad.DeviceOpen(0, true);
|
||||||
|
|
||||||
|
_stPad.DisplaySetStandbyImage(Helper.LoadBitmapFromResource("Resources/db-logo.png"));
|
||||||
|
// clear all hot spots
|
||||||
|
ClearHotSpots();
|
||||||
|
|
||||||
|
// clear signature window
|
||||||
|
_stPad.SensorClearSignRect();
|
||||||
|
|
||||||
|
|
||||||
|
// erase LCD and background buffer
|
||||||
|
_stPad.DisplayErase();
|
||||||
|
|
||||||
|
var nCapabilities = _stPad.DeviceGetCapabilities(0);
|
||||||
|
if (nCapabilities != null && nCapabilities.HasBacklight)
|
||||||
|
_stPad.DisplaySetBacklight(BacklightMode.On);
|
||||||
|
|
||||||
|
// set font
|
||||||
|
float fontSize = 0;
|
||||||
|
switch (_signPads[0].PadModel)
|
||||||
|
{
|
||||||
|
case PadModel.Sigma:
|
||||||
|
case PadModel.Zeta:
|
||||||
|
fontSize = 20;
|
||||||
|
break;
|
||||||
|
case PadModel.Omega:
|
||||||
|
fontSize = 40;
|
||||||
|
break;
|
||||||
|
case PadModel.Gamma:
|
||||||
|
fontSize = 45;
|
||||||
|
break;
|
||||||
|
case PadModel.Delta:
|
||||||
|
case PadModel.Alpha:
|
||||||
|
fontSize = 60;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_stPad.DisplaySetFont(new System.Drawing.Font("Arial", fontSize));
|
||||||
|
|
||||||
|
switch (_signPads[0].PadModel)
|
||||||
|
{
|
||||||
|
case PadModel.Sigma:
|
||||||
|
case PadModel.Zeta:
|
||||||
|
// do all the following drawing operations in the background buffer
|
||||||
|
_stPad.DisplaySetTarget(DisplayTarget.BackgroundBuffer);
|
||||||
|
|
||||||
|
// load button bitmaps and set hot spots
|
||||||
|
// "Cancel" button
|
||||||
|
System.Drawing.Bitmap button = Helper.LoadBitmapFromResource("Resources/Cancel BW.png");
|
||||||
|
int x = 20;
|
||||||
|
int y = _stPad.DisplayHeight - button.Height - 7;
|
||||||
|
_stPad.DisplaySetImage(x, y, button);
|
||||||
|
_buttonCancelId = _stPad.SensorAddHotSpot(x, y, button.Width, button.Height);
|
||||||
|
|
||||||
|
// "Confirm" button
|
||||||
|
button = Helper.LoadBitmapFromResource("Resources/OK BW.png");
|
||||||
|
x = _stPad.DisplayWidth - button.Width - 20;
|
||||||
|
_stPad.DisplaySetImage(x, y, button);
|
||||||
|
_buttonConfirmId = _stPad.SensorAddHotSpot(x, y, button.Width, button.Height);
|
||||||
|
|
||||||
|
|
||||||
|
if (Name != "")
|
||||||
|
_stPad.DisplaySetTextInRect(10, 10, _stPad.DisplayWidth - 20, _stPad.DisplayHeight - 60, signotec.STPadLibNet.TextAlignment.Left, $"Ich bestätige hiermit dass ich {Name} bin und die Gastkarte offiziell erhalten darf/habe\nSobald ich meinen neuen Ausweis erhalten habe, werde ich die Gastkarte zurückbringen\n\nAbteilung: {Firma_Abteilung}");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string Rueckgeber = "";
|
||||||
|
//MessageBox.Show("Rückgebende Person muss angegeben werden", "Fehlende Daten", MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||||
|
XMessageBoxWithReturn messageBox = new XMessageBoxWithReturn("Fehlende Daten", "Rückgebende Person muss angegeben werden", System.Windows.MessageBoxImage.Exclamation, false, "Rückgebender", "Rückgebender muss angegeben werden!");
|
||||||
|
|
||||||
|
if (messageBox.ShowDialog() == true)
|
||||||
|
{
|
||||||
|
Rueckgeber = messageBox.Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
_stPad.DisplaySetTextInRect(10, 10, _stPad.DisplayWidth - 20, _stPad.DisplayHeight - 60, signotec.STPadLibNet.TextAlignment.Left, $"Ich bestätige hiermit dass ich {Name} bin und die Gastkarte offiziell erhalten darf/habe\nSobald ich meinen neuen Ausweis erhalten habe, werde ich die Gastkarte zurückbringen\n\nAbteilung: {Firma_Abteilung}");
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case PadModel.Omega:
|
||||||
|
case PadModel.Gamma:
|
||||||
|
case PadModel.Delta:
|
||||||
|
if (_signPads[0].FastConnection)
|
||||||
|
// fast connection: do all drawing operations in the overlay buffer
|
||||||
|
_storeIdOverlay = _stPad.DisplaySetTarget(DisplayTarget.OverlayBuffer);
|
||||||
|
else
|
||||||
|
// do all the following drawing operations in the permanent memory
|
||||||
|
_storeIdOverlay = _stPad.DisplaySetTarget(_storeIdOverlay);
|
||||||
|
|
||||||
|
// load button bitmaps and set hot spots for toolbar
|
||||||
|
// "Cancel" button
|
||||||
|
button = Helper.LoadBitmapFromResource("Resources/Cancel RGB.png");
|
||||||
|
switch (_signPads[0].PadModel)
|
||||||
|
{
|
||||||
|
case PadModel.Omega:
|
||||||
|
x = 24;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
x = 45;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
y = _stPad.DisplayHeight - button.Height - 14;
|
||||||
|
_stPad.DisplaySetImage(x, y, button);
|
||||||
|
_buttonCancelId = _stPad.SensorAddHotSpot(x, y, button.Width, button.Height);
|
||||||
|
|
||||||
|
// "Confirm" button
|
||||||
|
button = Helper.LoadBitmapFromResource("Resources/OK RGB.png");
|
||||||
|
switch (_signPads[0].PadModel)
|
||||||
|
{
|
||||||
|
case PadModel.Omega:
|
||||||
|
x = 234;
|
||||||
|
break;
|
||||||
|
case PadModel.Gamma:
|
||||||
|
x = 315;
|
||||||
|
break;
|
||||||
|
case PadModel.Delta:
|
||||||
|
x = 555;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_stPad.DisplaySetImage(x, y, button);
|
||||||
|
_buttonConfirmId = _stPad.SensorAddHotSpot(x, y, button.Width, button.Height);
|
||||||
|
|
||||||
|
// Scroll buttons
|
||||||
|
button = Helper.LoadBitmapFromResource("Resources/Scroll RGB.png");
|
||||||
|
switch (_signPads[0].PadModel)
|
||||||
|
{
|
||||||
|
case PadModel.Omega:
|
||||||
|
x = 444;
|
||||||
|
break;
|
||||||
|
case PadModel.Gamma:
|
||||||
|
x = 585;
|
||||||
|
break;
|
||||||
|
case PadModel.Delta:
|
||||||
|
x = 1065;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_stPad.DisplaySetImage(x, y, button);
|
||||||
|
_stPad.SensorAddScrollHotSpot(x, y, 66, 66, ScrollOption.ScrollDown);
|
||||||
|
x += 104;
|
||||||
|
_stPad.SensorAddScrollHotSpot(x, y, 66, 66, ScrollOption.ScrollUp);
|
||||||
|
|
||||||
|
if (!_signPads[0].FastConnection)
|
||||||
|
{
|
||||||
|
// do all the following drawing operations in the overlay buffer
|
||||||
|
_stPad.DisplaySetTarget(DisplayTarget.OverlayBuffer);
|
||||||
|
|
||||||
|
// copy stored image to overlay buffer
|
||||||
|
_stPad.DisplaySetImageFromStore(_storeIdOverlay);
|
||||||
|
}
|
||||||
|
|
||||||
|
// do all the following drawing operations in the background buffer
|
||||||
|
_stPad.DisplaySetTarget(DisplayTarget.BackgroundBuffer);
|
||||||
|
|
||||||
|
// draw disclaimer
|
||||||
|
x = 10;
|
||||||
|
y = 10;
|
||||||
|
int size = _stPad.DisplaySetTextInRect(x, y, _stPad.DisplayWidth - 20, _stPad.DisplayHeight - 80, signotec.STPadLibNet.TextAlignment.Left, _disclaimer);
|
||||||
|
|
||||||
|
// use font size of the disclaimer text
|
||||||
|
if (size != (int)fontSize)
|
||||||
|
_stPad.DisplaySetFont(new System.Drawing.Font("Arial", size, System.Drawing.FontStyle.Regular));
|
||||||
|
|
||||||
|
// set scroll text
|
||||||
|
y = _stPad.DisplayHeight - 80;
|
||||||
|
_stPad.DisplaySetTextInRect(x, y, _stPad.DisplayWidth - 20, 100, signotec.STPadLibNet.TextAlignment.Left, "Congratulations! If you can read this text you have found the scroll buttons!");
|
||||||
|
if (_signPads[0].PadModel == PadModel.Delta)
|
||||||
|
{
|
||||||
|
y += _stPad.DisplayHeight;
|
||||||
|
_stPad.DisplaySetTextInRect(x, y, _stPad.DisplayWidth - 20, 200, 0, "Doesn't the Delta have an impressive large image buffer?");
|
||||||
|
const int x2 = 320;
|
||||||
|
while ((y + _stPad.DisplayHeight) < _stPad.DisplayTargetHeight)
|
||||||
|
{
|
||||||
|
y += _stPad.DisplayHeight;
|
||||||
|
_stPad.DisplaySetTextInRect(x, y, _stPad.DisplayWidth - 20, 200, 0, String.Format("You've reached line {0} of {1}!", y, _stPad.DisplayTargetHeight));
|
||||||
|
|
||||||
|
if ((y + _stPad.DisplayHeight) < _stPad.DisplayTargetHeight)
|
||||||
|
{
|
||||||
|
y += _stPad.DisplayHeight;
|
||||||
|
_stPad.DisplaySetTextInRect(x2, y, _stPad.DisplayWidth - 2 * x2, 200, signotec.STPadLibNet.TextAlignment.CenterCenteredVertically, "Click me, I'm a scrollable button!");
|
||||||
|
_stPad.SensorAddScrollHotSpot(x2, y, _stPad.DisplayWidth - 2 * x2, 200, ScrollOption.Scrollable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// set end text
|
||||||
|
switch (_signPads[0].PadModel)
|
||||||
|
{
|
||||||
|
case PadModel.Omega:
|
||||||
|
y = _stPad.DisplayTargetHeight - 120;
|
||||||
|
break;
|
||||||
|
case PadModel.Gamma:
|
||||||
|
y = _stPad.DisplayTargetHeight - 140;
|
||||||
|
break;
|
||||||
|
case PadModel.Delta:
|
||||||
|
y = _stPad.DisplayTargetHeight - 160;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_stPad.DisplaySetTextInRect(x, y, _stPad.DisplayWidth - 20, 60, signotec.STPadLibNet.TextAlignment.Left, "You have scrolled to the end of this text!");
|
||||||
|
|
||||||
|
// set overlay rect
|
||||||
|
y = _stPad.DisplayHeight - 80;
|
||||||
|
_stPad.DisplaySetOverlayRect(0, y, _stPad.DisplayWidth, 80);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// do all drawing operations on the LCD
|
||||||
|
_stPad.DisplaySetTarget(DisplayTarget.ForegroundBuffer);
|
||||||
|
|
||||||
|
// draw buffered image
|
||||||
|
_stPad.DisplaySetImageFromStore(DisplayTarget.BackgroundBuffer);
|
||||||
|
|
||||||
|
// set complete buffer for scrolling
|
||||||
|
_stPad.SensorSetScrollArea(0, 0, 0, 0);
|
||||||
|
|
||||||
|
if (_signPads[0].SupportsPenScrolling)
|
||||||
|
// enable pen scrolling
|
||||||
|
_stPad.SensorSetPenScrollingEnabled(true);
|
||||||
|
|
||||||
|
//ButtonRetry.IsEnabled = false;
|
||||||
|
}
|
||||||
|
catch (STPadException exc)
|
||||||
|
{
|
||||||
|
Log.WriteLog(exc.ToString());
|
||||||
|
MessageBox.Show(exc.Message);
|
||||||
|
//throw;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
//this.Cursor = Cursors.Arrow;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user