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.
@ -21,8 +21,10 @@
|
||||
<Run Text="{Binding Role}"/>
|
||||
</TextBlock>
|
||||
<Button Content="Назад" Click="Back_Button" Margin="5"/>
|
||||
<Button Content="Создать заказ" Click="Next_Function_Button" Margin="5"/>
|
||||
<Button Content="История входа" Click="History_Button" Margin="5" IsVisible="{Binding IsRole2}"/>
|
||||
<Button Content="Создать заказ" Click="Next_Function_Button" Margin="5"
|
||||
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 Text="" HorizontalAlignment="Center" Margin="10" x:Name="WarningBlock"/>
|
||||
</StackPanel>
|
||||
|
@ -8,17 +8,15 @@ using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Media.Imaging;
|
||||
using demo_hard.Model;
|
||||
|
||||
|
||||
namespace demo_hard;
|
||||
|
||||
public partial class FunctionWindow : Window
|
||||
{
|
||||
private readonly TimeSpan sessionDuration = TimeSpan.FromMinutes(10);
|
||||
private readonly TimeSpan warningTime = TimeSpan.FromMinutes(5);
|
||||
//private readonly TimeSpan lockoutDuration = TimeSpan.FromMinutes(1);
|
||||
|
||||
private DateTime sessionStartTime;
|
||||
private bool warningShow = false;
|
||||
|
||||
public FunctionWindow(Employee user)
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -30,13 +28,13 @@ public partial class FunctionWindow : Window
|
||||
Login = user.Login,
|
||||
Password = user.Password,
|
||||
Role = user.Role,
|
||||
Photo = user.Photo
|
||||
Photo = user.Photo,
|
||||
ShowHistoryButton = user.Role == 3,
|
||||
ShowCreateOrderButton = user.Role != 3
|
||||
};
|
||||
|
||||
|
||||
sessionStartTime = DateTime.Now;
|
||||
StartSessionTimer();
|
||||
|
||||
}
|
||||
|
||||
public FunctionWindow()
|
||||
@ -69,7 +67,7 @@ public partial class FunctionWindow : Window
|
||||
}
|
||||
}
|
||||
|
||||
private async void EndSession()
|
||||
private void EndSession()
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
@ -84,12 +82,16 @@ public partial class FunctionWindow : Window
|
||||
new SallerWindow().ShowDialog(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void History_Button(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
new HistoryWindow().ShowDialog(this);
|
||||
}
|
||||
|
||||
public class ImageEmployee : Employee
|
||||
{
|
||||
public bool IsRole2 => Role == 2;
|
||||
public bool ShowHistoryButton { get; set; }
|
||||
public bool ShowCreateOrderButton { get; set; }
|
||||
|
||||
Bitmap? Image
|
||||
{
|
||||
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();
|
||||
GenerateOrderPdfDocument(newOrder);
|
||||
|
||||
// Получаем максимальное время аренды из выбранных услуг
|
||||
|
||||
int maxRentTime = SelectedServices.Max(s => s.RentTime);
|
||||
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.AssemblyConfigurationAttribute("Debug")]
|
||||
[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.AssemblyTitleAttribute("demo_hard")]
|
||||
[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