docAndRole
This commit is contained in:
parent
ea37bf27f3
commit
93b7ac325f
BIN
Documents/testing-template_Karpov.docx
Normal file
BIN
Documents/testing-template_Karpov.docx
Normal file
Binary file not shown.
@ -7,7 +7,7 @@
|
|||||||
x:CompileBindings="False"
|
x:CompileBindings="False"
|
||||||
Title="FunctionWindow">
|
Title="FunctionWindow">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Orientation="Horizontal" >
|
<StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Orientation="Horizontal">
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||||
<Image Source="{Binding Image}" Width="100" Height="100" Margin="5" HorizontalAlignment="Center"/>
|
<Image Source="{Binding Image}" Width="100" Height="100" Margin="5" HorizontalAlignment="Center"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@ -21,8 +21,10 @@
|
|||||||
<Run Text="{Binding Role}"/>
|
<Run Text="{Binding Role}"/>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Button Content="Назад" Click="Back_Button" Margin="5"/>
|
<Button Content="Назад" Click="Back_Button" Margin="5"/>
|
||||||
<Button Content="Создать заказ" Click="Next_Function_Button" Margin="5"/>
|
<Button Content="Создать заказ" Click="Next_Function_Button" Margin="5"
|
||||||
<Button Content="История входа" Click="History_Button" Margin="5" IsVisible="{Binding IsRole2}"/>
|
IsVisible="{Binding ShowCreateOrderButton}"/>
|
||||||
|
<Button Content="История входа" Click="History_Button" Margin="5"
|
||||||
|
IsVisible="{Binding ShowHistoryButton}"/>
|
||||||
<TextBlock x:Name="SessionTimer" FontSize="16" Foreground="Red" HorizontalAlignment="Center" Margin="10"/>
|
<TextBlock x:Name="SessionTimer" FontSize="16" Foreground="Red" HorizontalAlignment="Center" Margin="10"/>
|
||||||
<TextBlock Text="" HorizontalAlignment="Center" Margin="10" x:Name="WarningBlock"/>
|
<TextBlock Text="" HorizontalAlignment="Center" Margin="10" x:Name="WarningBlock"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
@ -8,17 +8,15 @@ using Avalonia.Markup.Xaml;
|
|||||||
using Avalonia.Media.Imaging;
|
using Avalonia.Media.Imaging;
|
||||||
using demo_hard.Model;
|
using demo_hard.Model;
|
||||||
|
|
||||||
|
|
||||||
namespace demo_hard;
|
namespace demo_hard;
|
||||||
|
|
||||||
public partial class FunctionWindow : Window
|
public partial class FunctionWindow : Window
|
||||||
{
|
{
|
||||||
private readonly TimeSpan sessionDuration = TimeSpan.FromMinutes(10);
|
private readonly TimeSpan sessionDuration = TimeSpan.FromMinutes(10);
|
||||||
private readonly TimeSpan warningTime = TimeSpan.FromMinutes(5);
|
private readonly TimeSpan warningTime = TimeSpan.FromMinutes(5);
|
||||||
//private readonly TimeSpan lockoutDuration = TimeSpan.FromMinutes(1);
|
|
||||||
|
|
||||||
private DateTime sessionStartTime;
|
private DateTime sessionStartTime;
|
||||||
private bool warningShow = false;
|
private bool warningShow = false;
|
||||||
|
|
||||||
public FunctionWindow(Employee user)
|
public FunctionWindow(Employee user)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -30,13 +28,13 @@ public partial class FunctionWindow : Window
|
|||||||
Login = user.Login,
|
Login = user.Login,
|
||||||
Password = user.Password,
|
Password = user.Password,
|
||||||
Role = user.Role,
|
Role = user.Role,
|
||||||
Photo = user.Photo
|
Photo = user.Photo,
|
||||||
|
ShowHistoryButton = user.Role == 3,
|
||||||
|
ShowCreateOrderButton = user.Role != 3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
sessionStartTime = DateTime.Now;
|
sessionStartTime = DateTime.Now;
|
||||||
StartSessionTimer();
|
StartSessionTimer();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FunctionWindow()
|
public FunctionWindow()
|
||||||
@ -69,7 +67,7 @@ public partial class FunctionWindow : Window
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void EndSession()
|
private void EndSession()
|
||||||
{
|
{
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
@ -83,13 +81,17 @@ public partial class FunctionWindow : Window
|
|||||||
{
|
{
|
||||||
new SallerWindow().ShowDialog(this);
|
new SallerWindow().ShowDialog(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void History_Button(object? sender, RoutedEventArgs e)
|
||||||
|
|
||||||
|
|
||||||
public class ImageEmployee: Employee
|
|
||||||
{
|
{
|
||||||
public bool IsRole2 => Role == 2;
|
new HistoryWindow().ShowDialog(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ImageEmployee : Employee
|
||||||
|
{
|
||||||
|
public bool ShowHistoryButton { get; set; }
|
||||||
|
public bool ShowCreateOrderButton { get; set; }
|
||||||
|
|
||||||
Bitmap? Image
|
Bitmap? Image
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -107,9 +109,4 @@ public partial class FunctionWindow : Window
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
private void History_Button(object? sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
new HistoryWindow().ShowDialog(this);
|
|
||||||
}
|
|
||||||
}
|
|
@ -203,7 +203,7 @@ public partial class SallerWindow : Window, INotifyPropertyChanged, IReactiveObj
|
|||||||
await _databaseContext.SaveChangesAsync();
|
await _databaseContext.SaveChangesAsync();
|
||||||
GenerateOrderPdfDocument(newOrder);
|
GenerateOrderPdfDocument(newOrder);
|
||||||
|
|
||||||
// Получаем максимальное время аренды из выбранных услуг
|
|
||||||
int maxRentTime = SelectedServices.Max(s => s.RentTime);
|
int maxRentTime = SelectedServices.Max(s => s.RentTime);
|
||||||
new BarcodeWindow(newOrder.OrderId, maxRentTime).Show();
|
new BarcodeWindow(newOrder.OrderId, maxRentTime).Show();
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("demo_hard")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("demo_hard")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cbe1e192f4be37b6c3c9b90d69bf9ee24aa29818")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ea37bf27f32e6687cc89505862404c85129bd324")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("demo_hard")]
|
[assembly: System.Reflection.AssemblyProductAttribute("demo_hard")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("demo_hard")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("demo_hard")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
@ -1 +1 @@
|
|||||||
072a4f3754d79ff9cd5f43f59910c627cb7a50cc81717c7fb6d437c2e7a535f3
|
b614a5bb202bbb84fbe66408acfbdcf181dc215f2aac414fa67259c823479be3
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user