feat: admin login audit in SQLite; Settings Admin Card ID from DB; Scanner dashboard UI
Backend / data - Add AdminLoginRecords table (Username, EmployeeId, LoginTimeUtc); record on each admin login - Add IAdminAuditService (RecordLoginAsync, GetLastLogin); AdminAuditService implementation - Settings: Admin Card ID always prefilled from last admin login in DB (AdminLoginRecords.EmployeeId), fallback "ADMIN" - Wire AdminAuditService in App.xaml.cs; inject into AdminLoginViewModel and SettingsViewModel UI - Scanner Dashboard: two-panel layout (left: employee card with photo, name, department, employee ID, order; right: order placement + stats) - Employee section: larger fonts and spacing, circular profile image, sample data and asset (emppic.jpeg) - Menu bar: Site / Settings / Logout in WrapPanel for responsive layout; consistent button sizing - Dashboard and card responsive (ScrollViewer, MinWidth 0, card MinWidth 360 / MaxWidth 1150) - Scanner status: activity-based only (connected when input received; no hardware detection)pull/1/head
parent
7bc5ffc77e
commit
90380bf4fb
|
|
@ -31,6 +31,7 @@ public partial class App : Application
|
|||
var configService = new ConfigService();
|
||||
var rfidService = new RfidService(dbFactory, configService);
|
||||
var syncService = new SyncService(dbFactory, configService);
|
||||
var adminAuditService = new AdminAuditService(dbFactory);
|
||||
var session = new AppSession();
|
||||
var authenticationUrl = "https://portal.utopiaindustries.pk/uind/rest/auth/user/";
|
||||
var authService = new AuthService(authenticationUrl);
|
||||
|
|
@ -39,11 +40,11 @@ public partial class App : Application
|
|||
NavigationService navigationService = null!;
|
||||
navigationService = new NavigationService(
|
||||
session,
|
||||
() => new AdminLoginViewModel(authService, session, navigationService, configService),
|
||||
() => new AdminLoginViewModel(authService, session, navigationService, configService, adminAuditService),
|
||||
() => new ScannerDashboardViewModel(rfidService, navigationService, session, configService),
|
||||
() => new MainDashboardViewModel(navigationService, rfidService, configService, session),
|
||||
() => new AdminSettingsAuthViewModel(authService, session, navigationService, configService),
|
||||
() => new SettingsViewModel(configService, navigationService));
|
||||
() => new SettingsViewModel(configService, navigationService, adminAuditService));
|
||||
|
||||
var mainViewModel = new MainViewModel(navigationService);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace UtopiaCanteenSystem.Converters
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a string URI (e.g. pack:// or file path) to an ImageSource for Image controls.
|
||||
/// </summary>
|
||||
public class StringToImageSourceConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var path = value?.ToString();
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
return null;
|
||||
|
||||
try
|
||||
{
|
||||
var uri = new Uri(path, UriKind.RelativeOrAbsolute);
|
||||
return new BitmapImage(uri);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
|
@ -9,9 +9,10 @@ namespace UtopiaCanteenSystem.Converters
|
|||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(value?.ToString())
|
||||
? Visibility.Collapsed
|
||||
: Visibility.Visible;
|
||||
var visible = !string.IsNullOrWhiteSpace(value?.ToString());
|
||||
if (string.Equals(parameter?.ToString(), "Invert", StringComparison.OrdinalIgnoreCase))
|
||||
visible = !visible;
|
||||
return visible ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ public class AppDbContext : DbContext
|
|||
|
||||
public DbSet<Labour> Labour { get; set; }
|
||||
public DbSet<ScanRecord> ScanRecords { get; set; }
|
||||
public DbSet<AdminLoginRecord> AdminLoginRecords { get; set; }
|
||||
|
||||
public AppDbContext() { }
|
||||
|
||||
|
|
@ -44,6 +45,12 @@ public class AppDbContext : DbContext
|
|||
e.HasIndex(x => x.IsSynced);
|
||||
e.HasIndex(x => x.ScanTime);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<AdminLoginRecord>(e =>
|
||||
{
|
||||
e.HasKey(x => x.Id);
|
||||
e.HasIndex(x => x.LoginTimeUtc);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -53,6 +60,7 @@ public class AppDbContext : DbContext
|
|||
{
|
||||
Database.EnsureCreated();
|
||||
UpgradeScanRecordsSchemaIfNeeded();
|
||||
EnsureAdminLoginTableExists();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -95,4 +103,30 @@ public class AppDbContext : DbContext
|
|||
// Ignore; existing DB may already have columns or be incompatible
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lightweight creation of AdminLoginRecords table for existing databases.
|
||||
/// </summary>
|
||||
private void EnsureAdminLoginTableExists()
|
||||
{
|
||||
try
|
||||
{
|
||||
var conn = Database.GetDbConnection();
|
||||
if (conn.State != ConnectionState.Open)
|
||||
conn.Open();
|
||||
|
||||
using var cmd = conn.CreateCommand();
|
||||
cmd.CommandText =
|
||||
"CREATE TABLE IF NOT EXISTS AdminLoginRecords (" +
|
||||
"Id INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
"Username TEXT NOT NULL, " +
|
||||
"EmployeeId TEXT NOT NULL, " +
|
||||
"LoginTimeUtc TEXT NOT NULL)";
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore; table may already exist or DB may be read-only.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,12 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="Utopia Canteen System"
|
||||
Icon="pack://siteoforigin:,,,/assets/favicon.ico"
|
||||
MinHeight="600" MinWidth="800"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
SizeToContent="WidthAndHeight">
|
||||
MinHeight="400" MinWidth="480"
|
||||
Width="900" Height="700"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
<ContentControl Content="{Binding CurrentViewModel}" />
|
||||
<ContentControl Content="{Binding CurrentViewModel}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
namespace UtopiaCanteenSystem.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Audit record of an admin login on this kiosk/device.
|
||||
/// Passwords are NEVER stored here – only identity and timestamps.
|
||||
/// </summary>
|
||||
public class AdminLoginRecord
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Username { get; set; } = string.Empty;
|
||||
public string EmployeeId { get; set; } = string.Empty;
|
||||
public DateTime LoginTimeUtc { get; set; }
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using UtopiaCanteenSystem.Data;
|
||||
using UtopiaCanteenSystem.Models;
|
||||
|
||||
namespace UtopiaCanteenSystem.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Persists simple admin login audit records to the local SQLite database.
|
||||
/// </summary>
|
||||
public class AdminAuditService : IAdminAuditService
|
||||
{
|
||||
private readonly DbContextFactory _dbFactory;
|
||||
|
||||
public AdminAuditService(DbContextFactory dbFactory)
|
||||
{
|
||||
_dbFactory = dbFactory;
|
||||
}
|
||||
|
||||
public async Task RecordLoginAsync(string username, string employeeId)
|
||||
{
|
||||
try
|
||||
{
|
||||
await using var db = _dbFactory.CreateDbContext();
|
||||
var record = new AdminLoginRecord
|
||||
{
|
||||
Username = username ?? string.Empty,
|
||||
EmployeeId = employeeId ?? string.Empty,
|
||||
LoginTimeUtc = DateTime.UtcNow
|
||||
};
|
||||
db.AdminLoginRecords.Add(record);
|
||||
await db.SaveChangesAsync().ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Audit failures should never block login; ignore errors.
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the most recent admin login record for this kiosk, or null if none exist.
|
||||
/// </summary>
|
||||
public AdminLoginRecord? GetLastLogin()
|
||||
{
|
||||
try
|
||||
{
|
||||
using var db = _dbFactory.CreateDbContext();
|
||||
return db.AdminLoginRecords
|
||||
.OrderByDescending(x => x.LoginTimeUtc)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
using System.Threading.Tasks;
|
||||
using UtopiaCanteenSystem.Models;
|
||||
|
||||
namespace UtopiaCanteenSystem.Services;
|
||||
|
||||
public interface IAdminAuditService
|
||||
{
|
||||
Task RecordLoginAsync(string username, string employeeId);
|
||||
AdminLoginRecord? GetLastLogin();
|
||||
}
|
||||
|
||||
|
|
@ -10,6 +10,7 @@ public partial class AdminLoginViewModel : ObservableObject
|
|||
private readonly AppSession _session;
|
||||
private readonly INavigationService _navigation;
|
||||
private readonly IConfigService _config;
|
||||
private readonly IAdminAuditService _adminAudit;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _username = string.Empty;
|
||||
|
|
@ -27,12 +28,18 @@ public partial class AdminLoginViewModel : ObservableObject
|
|||
[ObservableProperty]
|
||||
private bool _rememberCredentials;
|
||||
|
||||
public AdminLoginViewModel(IAuthService authService, AppSession session, INavigationService navigation, IConfigService config)
|
||||
public AdminLoginViewModel(
|
||||
IAuthService authService,
|
||||
AppSession session,
|
||||
INavigationService navigation,
|
||||
IConfigService config,
|
||||
IAdminAuditService adminAudit)
|
||||
{
|
||||
_authService = authService;
|
||||
_session = session;
|
||||
_navigation = navigation;
|
||||
_config = config;
|
||||
_adminAudit = adminAudit;
|
||||
|
||||
RememberCredentials = _config.GetRememberAdminCredentials();
|
||||
if (RememberCredentials)
|
||||
|
|
@ -76,6 +83,9 @@ public partial class AdminLoginViewModel : ObservableObject
|
|||
|
||||
_session.SetAdminAuthenticated(user, result.EmployeeId);
|
||||
|
||||
// Persist who logged in (for audit / reporting).
|
||||
await _adminAudit.RecordLoginAsync(user, result.EmployeeId).ConfigureAwait(false);
|
||||
|
||||
// Persist credentials only if user opted in.
|
||||
_config.SetRememberAdminCredentials(RememberCredentials);
|
||||
if (RememberCredentials)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ public partial class ScannerDashboardViewModel : ObservableObject
|
|||
private readonly INavigationService _navigation;
|
||||
private readonly AppSession _session;
|
||||
private readonly IConfigService _configService;
|
||||
private readonly DispatcherTimer _scannerStatusTimer;
|
||||
private DateTime? _lastScanActivityUtc;
|
||||
private readonly Dispatcher _uiDispatcher;
|
||||
|
||||
private readonly DebounceTimer _debounceTimer;
|
||||
|
|
@ -31,9 +33,6 @@ public partial class ScannerDashboardViewModel : ObservableObject
|
|||
private string _cooldownBlockedCardId = string.Empty;
|
||||
private bool _suppressCooldownRewrite;
|
||||
|
||||
private readonly DispatcherTimer _scannerStatusTimer;
|
||||
private DateTime? _lastScanActivityUtc;
|
||||
|
||||
private readonly DispatcherTimer _clockTimer;
|
||||
|
||||
private readonly object _submitLock = new();
|
||||
|
|
@ -103,7 +102,29 @@ public partial class ScannerDashboardViewModel : ObservableObject
|
|||
/// <summary>Display string for current site (e.g. "SITE : 1").</summary>
|
||||
public string CurrentSiteDisplay => string.IsNullOrWhiteSpace(SiteNumber) ? "SITE : 1" : $"SITE : {SiteNumber.Trim()}";
|
||||
|
||||
public ScannerDashboardViewModel(IRfidService rfidService, INavigationService navigation, AppSession session, IConfigService configService)
|
||||
// --- Left panel: Employee information (sample data for display; replace with real lookup when available) ---
|
||||
[ObservableProperty]
|
||||
private string _employeeName = "Syed Mustufa Ahmed Naqvi";
|
||||
|
||||
[ObservableProperty]
|
||||
private string _employeeDepartment = "Technology";
|
||||
|
||||
[ObservableProperty]
|
||||
private string _employeeId = "15399";
|
||||
|
||||
/// <summary>Item selected by the employee for the order (e.g. Chicken Biryani).</summary>
|
||||
[ObservableProperty]
|
||||
private string _employeeOrderItem = "Chicken Biryani";
|
||||
|
||||
/// <summary>Optional profile image path; null = show placeholder.</summary>
|
||||
[ObservableProperty]
|
||||
private string? _employeeProfileImagePath = "pack://siteoforigin:,,,/assets/emp-pic/emppic.jpeg";
|
||||
|
||||
public ScannerDashboardViewModel(
|
||||
IRfidService rfidService,
|
||||
INavigationService navigation,
|
||||
AppSession session,
|
||||
IConfigService configService)
|
||||
{
|
||||
_rfidService = rfidService;
|
||||
_navigation = navigation;
|
||||
|
|
@ -135,7 +156,7 @@ public partial class ScannerDashboardViewModel : ObservableObject
|
|||
_cooldownTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(CooldownTickSeconds) };
|
||||
_cooldownTimer.Tick += (_, _) => UpdateCooldownMessage();
|
||||
|
||||
// Activity-based scanner status.
|
||||
// Activity-based scanner status (keyboard-wedge style scanners).
|
||||
_scannerStatusTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
|
||||
_scannerStatusTimer.Tick += (_, _) => UpdateScannerStatusFromActivity();
|
||||
_scannerStatusTimer.Start();
|
||||
|
|
@ -217,17 +238,17 @@ public partial class ScannerDashboardViewModel : ObservableObject
|
|||
}
|
||||
}
|
||||
|
||||
// Clear any previous message once a new scan starts (outside cooldown).
|
||||
if (!string.IsNullOrWhiteSpace(value) && !string.IsNullOrEmpty(Message))
|
||||
Message = string.Empty;
|
||||
|
||||
// Any incoming characters means activity.
|
||||
// Any incoming characters means activity from the scanner keyboard wedge.
|
||||
if (!string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
_lastScanActivityUtc = DateTime.UtcNow;
|
||||
ScannerStatus = "Connected";
|
||||
}
|
||||
|
||||
// Clear any previous message once a new scan starts (outside cooldown).
|
||||
if (!string.IsNullOrWhiteSpace(value) && !string.IsNullOrEmpty(Message))
|
||||
Message = string.Empty;
|
||||
|
||||
// Don't auto-submit while cooldown is active or while we're processing.
|
||||
if (!_isCooldownActive && !IsProcessing)
|
||||
RestartDebounceTimer();
|
||||
|
|
@ -246,6 +267,23 @@ public partial class ScannerDashboardViewModel : ObservableObject
|
|||
ScannerStatus = "Disconnected";
|
||||
}
|
||||
|
||||
private void UpdateScannerStatusFromActivity()
|
||||
{
|
||||
if (_lastScanActivityUtc is null)
|
||||
{
|
||||
if (!string.Equals(ScannerStatus, "Disconnected", StringComparison.Ordinal))
|
||||
ScannerStatus = "Disconnected";
|
||||
return;
|
||||
}
|
||||
|
||||
var inactiveFor = DateTime.UtcNow - _lastScanActivityUtc.Value;
|
||||
if (inactiveFor > ScannerInactivityTimeout &&
|
||||
!string.Equals(ScannerStatus, "Disconnected", StringComparison.Ordinal))
|
||||
{
|
||||
ScannerStatus = "Disconnected";
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void Logout()
|
||||
{
|
||||
|
|
@ -430,22 +468,6 @@ public partial class ScannerDashboardViewModel : ObservableObject
|
|||
IsSuccess = false;
|
||||
}
|
||||
|
||||
private void UpdateScannerStatusFromActivity()
|
||||
{
|
||||
if (_lastScanActivityUtc is null)
|
||||
{
|
||||
if (!string.Equals(ScannerStatus, "Disconnected", StringComparison.Ordinal))
|
||||
ScannerStatus = "Disconnected";
|
||||
return;
|
||||
}
|
||||
|
||||
if (DateTime.UtcNow - _lastScanActivityUtc.Value > ScannerInactivityTimeout)
|
||||
{
|
||||
if (!string.Equals(ScannerStatus, "Disconnected", StringComparison.Ordinal))
|
||||
ScannerStatus = "Disconnected";
|
||||
}
|
||||
}
|
||||
|
||||
~ScannerDashboardViewModel()
|
||||
{
|
||||
_scannerStatusTimer.Stop();
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public partial class SettingsViewModel : ObservableObject
|
|||
{
|
||||
private readonly IConfigService _configService;
|
||||
private readonly INavigationService _navigation;
|
||||
private readonly IAdminAuditService _adminAudit;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _syncApiEndpoint = string.Empty;
|
||||
|
|
@ -30,10 +31,11 @@ public partial class SettingsViewModel : ObservableObject
|
|||
[ObservableProperty]
|
||||
private bool _isSaving;
|
||||
|
||||
public SettingsViewModel(IConfigService configService, INavigationService navigation)
|
||||
public SettingsViewModel(IConfigService configService, INavigationService navigation, IAdminAuditService adminAudit)
|
||||
{
|
||||
_configService = configService;
|
||||
_navigation = navigation;
|
||||
_adminAudit = adminAudit;
|
||||
LoadFromConfig();
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +44,13 @@ public partial class SettingsViewModel : ObservableObject
|
|||
{
|
||||
SyncApiEndpoint = _configService.GetSyncApiEndpoint();
|
||||
ScanTimeoutSeconds = _configService.GetScanTimeoutSeconds().ToString();
|
||||
AdminCardId = _configService.GetAdminCardId();
|
||||
|
||||
// Always prefer the latest admin login from the database.
|
||||
var last = _adminAudit.GetLastLogin();
|
||||
if (last != null && !string.IsNullOrWhiteSpace(last.EmployeeId))
|
||||
AdminCardId = last.EmployeeId;
|
||||
else
|
||||
AdminCardId = "ADMIN";
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
|
|
|
|||
|
|
@ -51,17 +51,20 @@
|
|||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Background="#F0F2F5">
|
||||
<Viewbox Stretch="Uniform"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
MaxWidth="650"
|
||||
MaxHeight="900">
|
||||
<Grid Background="#F0F2F5" MinHeight="0" MinWidth="0">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="16"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid MinHeight="{Binding ViewportHeight, RelativeSource={RelativeSource AncestorType=ScrollViewer}}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<Border HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Padding="40"
|
||||
MinWidth="450"
|
||||
Width="{Binding ViewportWidth, RelativeSource={RelativeSource AncestorType=ScrollViewer}}"
|
||||
MaxWidth="560"
|
||||
MinWidth="280"
|
||||
Padding="24"
|
||||
Background="White"
|
||||
CornerRadius="12">
|
||||
<Border.Effect>
|
||||
|
|
@ -81,8 +84,8 @@
|
|||
<Grid HorizontalAlignment="Center" Margin="0,0,0,12">
|
||||
<Image x:Name="LogoImage"
|
||||
Source="pack://siteoforigin:,,,/assets/logo4.png"
|
||||
Height="190"
|
||||
MaxWidth="520"
|
||||
Height="140"
|
||||
MaxWidth="400"
|
||||
Stretch="Uniform"
|
||||
HorizontalAlignment="Center"
|
||||
ImageFailed="LogoImage_OnImageFailed"/>
|
||||
|
|
@ -172,7 +175,8 @@
|
|||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
|
|
|
|||
|
|
@ -76,17 +76,20 @@
|
|||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Background="#F0F2F5">
|
||||
<Viewbox Stretch="Uniform"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
MaxWidth="700"
|
||||
MaxHeight="900">
|
||||
<Grid Background="#F0F2F5" MinHeight="0" MinWidth="0">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="16"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid MinHeight="{Binding ViewportHeight, RelativeSource={RelativeSource AncestorType=ScrollViewer}}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<Border HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Padding="40"
|
||||
MinWidth="520"
|
||||
Width="{Binding ViewportWidth, RelativeSource={RelativeSource AncestorType=ScrollViewer}}"
|
||||
MaxWidth="620"
|
||||
MinWidth="280"
|
||||
Padding="24"
|
||||
Background="White"
|
||||
CornerRadius="12">
|
||||
<Border.Effect>
|
||||
|
|
@ -147,9 +150,9 @@
|
|||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*" MinWidth="0"/>
|
||||
<ColumnDefinition Width="16"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*" MinWidth="0"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Grid.Column="0"
|
||||
|
|
@ -200,7 +203,8 @@
|
|||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@
|
|||
xmlns:local="clr-namespace:UtopiaCanteenSystem.Converters">
|
||||
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVisibility"/>
|
||||
<local:StringToVisibilityConverter x:Key="StringToVisibility"/>
|
||||
<local:StringToImageSourceConverter x:Key="StringToImageSource"/>
|
||||
|
||||
<SolidColorBrush x:Key="AccentBrush" Color="#5BA3A0"/>
|
||||
<SolidColorBrush x:Key="AccentBorderBrush" Color="#995BA3A0"/>
|
||||
|
|
@ -18,10 +20,10 @@
|
|||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Background" Value="{StaticResource AccentBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="FontSize" Value="18"/>
|
||||
<Setter Property="FontSize" Value="20"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
<Setter Property="Padding" Value="24,12"/>
|
||||
<Setter Property="MinHeight" Value="50"/>
|
||||
<Setter Property="Padding" Value="28,14"/>
|
||||
<Setter Property="MinHeight" Value="56"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
|
|
@ -144,7 +146,7 @@
|
|||
|
||||
<Style x:Key="StatusTextStyle" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{StaticResource MutedTextBrush}"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="FontSize" Value="15"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ScannerStatus}" Value="Connected">
|
||||
|
|
@ -172,7 +174,7 @@
|
|||
<Setter Property="BorderBrush" Value="#86efac"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="8"/>
|
||||
<Setter Property="Padding" Value="14"/>
|
||||
<Setter Property="Padding" Value="18"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsSuccess}" Value="False">
|
||||
<Setter Property="Background" Value="#fee2e2"/>
|
||||
|
|
@ -182,15 +184,21 @@
|
|||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Background="#F0F2F5">
|
||||
<Grid Background="#F0F2F5" MinHeight="0" MinWidth="0">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="40">
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
Padding="16"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid MinHeight="{Binding ViewportHeight, RelativeSource={RelativeSource AncestorType=ScrollViewer}}"
|
||||
MinWidth="0"
|
||||
HorizontalAlignment="Stretch">
|
||||
<Border HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Width="{Binding RelativeSource={RelativeSource AncestorType=ScrollViewer}, Path=ViewportWidth}"
|
||||
MaxWidth="900"
|
||||
Padding="40"
|
||||
VerticalAlignment="Center"
|
||||
MinWidth="360"
|
||||
Width="{Binding ViewportWidth, RelativeSource={RelativeSource AncestorType=ScrollViewer}}"
|
||||
MaxWidth="1150"
|
||||
Padding="20"
|
||||
Background="White"
|
||||
CornerRadius="12">
|
||||
<Border.Effect>
|
||||
|
|
@ -200,7 +208,72 @@
|
|||
Color="#000000"/>
|
||||
</Border.Effect>
|
||||
|
||||
<Grid>
|
||||
<Grid MinWidth="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" MinWidth="0" MaxWidth="480"/>
|
||||
<ColumnDefinition Width="16"/>
|
||||
<ColumnDefinition Width="*" MinWidth="0"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Left Panel: Employee Information (larger text and profile to use space) -->
|
||||
<Border Grid.Column="0"
|
||||
MinWidth="0"
|
||||
Background="#f4f4f4"
|
||||
BorderBrush="#e2e8f0"
|
||||
BorderThickness="1"
|
||||
CornerRadius="10"
|
||||
Padding="24">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<StackPanel>
|
||||
<!-- Top row: circular profile image (left) + name (right) -->
|
||||
<Grid Margin="0,0,0,24">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*" MinWidth="0"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Profile image (circular); set EmployeeProfileImagePath to show photo -->
|
||||
<Grid Grid.Column="0" Width="110" Height="110" Margin="0,0,18,0">
|
||||
<Ellipse Fill="#e2e8f0"/>
|
||||
<Image Source="{Binding EmployeeProfileImagePath, Converter={StaticResource StringToImageSource}}"
|
||||
Stretch="UniformToFill"
|
||||
Visibility="{Binding EmployeeProfileImagePath, Converter={StaticResource StringToVisibility}}">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="55,55" RadiusX="55" RadiusY="55"/>
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Text="—"
|
||||
FontSize="32"
|
||||
Foreground="{StaticResource MutedTextBrush}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding EmployeeProfileImagePath, Converter={StaticResource StringToVisibility}, ConverterParameter=Invert}"/>
|
||||
</Grid>
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center" MinWidth="0">
|
||||
<TextBlock Text="Name" FontSize="15" Foreground="{StaticResource MutedTextBrush}" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="{Binding EmployeeName}" FontSize="22" FontWeight="Bold" Foreground="{StaticResource TitleTextBrush}" TextTrimming="CharacterEllipsis" TextWrapping="Wrap"/>
|
||||
<TextBlock Text="{Binding EmployeeDepartment}" FontSize="16" Foreground="{StaticResource MutedTextBrush}" Margin="0,6,0,0" TextTrimming="CharacterEllipsis"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<TextBlock Text="Department:" FontSize="15" Foreground="{StaticResource MutedTextBrush}" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="{Binding EmployeeDepartment}" FontSize="19" FontWeight="SemiBold" Foreground="{StaticResource TitleTextBrush}" Margin="0,0,0,18" TextTrimming="CharacterEllipsis"/>
|
||||
<TextBlock Text="Employee ID:" FontSize="15" Foreground="{StaticResource MutedTextBrush}" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="{Binding EmployeeId}" FontSize="19" FontWeight="SemiBold" Foreground="{StaticResource TitleTextBrush}" Margin="0,0,0,18" TextTrimming="CharacterEllipsis"/>
|
||||
<TextBlock Text="Order" FontSize="15" Foreground="{StaticResource MutedTextBrush}" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="{Binding EmployeeOrderItem}" FontSize="19" FontWeight="SemiBold" Foreground="{StaticResource TitleTextBrush}" TextTrimming="CharacterEllipsis" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
|
||||
<!-- Divider between panels -->
|
||||
<Border Grid.Column="1" Width="1" Background="#e2e8f0" HorizontalAlignment="Center" MinWidth="0"/>
|
||||
|
||||
<!-- Right Panel: Order placement + statistics -->
|
||||
<Border Grid.Column="2"
|
||||
MinWidth="0"
|
||||
Background="White"
|
||||
CornerRadius="10"
|
||||
Padding="16">
|
||||
<Grid MinWidth="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
|
|
@ -212,12 +285,12 @@
|
|||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Menu button (top-right, prominent) -->
|
||||
<!-- Menu button (top-right) -->
|
||||
<ToggleButton x:Name="MenuToggleButton"
|
||||
Grid.Row="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Margin="0,0,0,8"
|
||||
Margin="0,0,0,12"
|
||||
IsChecked="{Binding IsMenuOpen, Mode=TwoWay}"
|
||||
Unchecked="MenuToggleButton_Unchecked"
|
||||
Background="#f4f7f7"
|
||||
|
|
@ -259,68 +332,73 @@
|
|||
</ToggleButton.Style>
|
||||
</ToggleButton>
|
||||
|
||||
<!-- Inline menu panel (opens inside dashboard) -->
|
||||
<!-- Inline menu panel (responsive: wraps; Settings/Logout with consistent sizing) -->
|
||||
<Border x:Name="MenuPanel"
|
||||
Grid.Row="1"
|
||||
MinWidth="0"
|
||||
Background="#f8fafc"
|
||||
BorderBrush="#e2e8f0"
|
||||
BorderThickness="1"
|
||||
CornerRadius="8"
|
||||
Padding="16"
|
||||
Padding="14"
|
||||
Margin="0,0,0,12"
|
||||
Visibility="{Binding IsMenuOpen, Converter={StaticResource BoolToVisibility}}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
|
||||
<WrapPanel Orientation="Horizontal"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,2">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,20,0">
|
||||
<TextBlock Text="SITE :" VerticalAlignment="Center" FontSize="14" FontWeight="SemiBold" Foreground="{StaticResource TitleTextBrush}" Margin="0,0,8,0"/>
|
||||
<TextBox x:Name="SiteNumberTextBox"
|
||||
Text="{Binding SiteNumber, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="80"
|
||||
Width="72"
|
||||
MinWidth="56"
|
||||
FontSize="14"
|
||||
Padding="8,6"
|
||||
Padding="8,8"
|
||||
MinHeight="40"
|
||||
VerticalContentAlignment="Center"
|
||||
PreviewTextInput="SiteNumberTextBox_PreviewTextInput"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">
|
||||
<Button Content="Settings"
|
||||
Command="{Binding OpenSettingsCommand}"
|
||||
Style="{StaticResource SecondaryButtonStyle}"
|
||||
Margin="0,0,12,0"
|
||||
Margin="0,0,10,0"
|
||||
MinWidth="100"
|
||||
MinHeight="44"
|
||||
Padding="16,10"
|
||||
FontSize="14"
|
||||
Focusable="False"
|
||||
IsTabStop="False"/>
|
||||
<Button Command="{Binding LogoutCommand}"
|
||||
Style="{StaticResource LogoutLinkButtonStyle}"
|
||||
MinWidth="100"
|
||||
MinHeight="44"
|
||||
Padding="16,10"
|
||||
Focusable="False"
|
||||
IsTabStop="False">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<TextBlock Text="⎋" FontSize="14" Margin="0,0,8,0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Logout" FontSize="14" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Logout" FontSize="14" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Top section -->
|
||||
<StackPanel Grid.Row="2" HorizontalAlignment="Center">
|
||||
<!-- Logo + instruction -->
|
||||
<StackPanel Grid.Row="2" HorizontalAlignment="Center" MinWidth="0">
|
||||
<Image Source="pack://siteoforigin:,,,/assets/logo4.png"
|
||||
Height="180"
|
||||
MaxWidth="480"
|
||||
Height="100"
|
||||
MaxWidth="320"
|
||||
Stretch="Uniform"
|
||||
Margin="0,0,0,16"/>
|
||||
Margin="0,0,0,8"/>
|
||||
<TextBlock Text="Tap card to place order"
|
||||
FontSize="16"
|
||||
Foreground="{StaticResource MutedTextBrush}"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,8,0,0"/>
|
||||
TextAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Order input -->
|
||||
<StackPanel Grid.Row="3" Margin="0,24,0,0">
|
||||
<!-- Scan box + Place Order button -->
|
||||
<StackPanel Grid.Row="3" Margin="0,16,0,0" MinWidth="0">
|
||||
<Border MinHeight="50"
|
||||
CornerRadius="8"
|
||||
BorderBrush="{StaticResource AccentBorderBrush}"
|
||||
|
|
@ -347,16 +425,15 @@
|
|||
Visibility="{Binding IsWatermarkVisible, Converter={StaticResource BoolToVisibility}}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Button Content="PLACE ORDER"
|
||||
Command="{Binding ScanCommand}"
|
||||
Margin="0,16,0,0"
|
||||
Margin="0,12,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource RoundedButtonStyle}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Status row + timestamp -->
|
||||
<StackPanel Grid.Row="4" Margin="0,18,0,0" HorizontalAlignment="Center">
|
||||
<!-- Scanner status + timestamp -->
|
||||
<StackPanel Grid.Row="4" Margin="0,14,0,0" HorizontalAlignment="Center">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<TextBlock Style="{StaticResource StatusIconStyle}" Margin="0,0,8,0"/>
|
||||
<TextBlock Text="{Binding ScannerStatusDisplay}" Style="{StaticResource StatusTextStyle}"/>
|
||||
|
|
@ -364,27 +441,24 @@
|
|||
<TextBlock Text="{Binding CurrentTime}"
|
||||
FontSize="14"
|
||||
Foreground="{StaticResource MutedTextBrush}"
|
||||
Margin="0,10,0,0"
|
||||
Margin="0,6,0,0"
|
||||
HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Divider -->
|
||||
<Border Grid.Row="5"
|
||||
Height="1"
|
||||
Background="#e2e8f0"
|
||||
Margin="0,24,0,24"/>
|
||||
<Border Grid.Row="5" Height="1" Background="#e2e8f0" Margin="0,14,0,14"/>
|
||||
|
||||
<!-- Cooldown alert: ask customer to rescan after countdown -->
|
||||
<!-- Cooldown alert -->
|
||||
<Border Grid.Row="6"
|
||||
Background="#fef2f2"
|
||||
BorderBrush="#fca5a5"
|
||||
BorderThickness="2"
|
||||
CornerRadius="8"
|
||||
Padding="20"
|
||||
Margin="0,0,0,16"
|
||||
Padding="14"
|
||||
Margin="0,0,0,12"
|
||||
Visibility="{Binding ShowCooldownAlert, Converter={StaticResource BoolToVisibility}}">
|
||||
<TextBlock Text="{Binding CooldownAlertMessage}"
|
||||
FontSize="20"
|
||||
FontSize="18"
|
||||
FontWeight="Bold"
|
||||
Foreground="{StaticResource ErrorTextBrush}"
|
||||
TextWrapping="Wrap"
|
||||
|
|
@ -392,69 +466,46 @@
|
|||
HorizontalAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<!-- Dashboard section -->
|
||||
<Grid Grid.Row="7">
|
||||
<!-- Statistics -->
|
||||
<Grid Grid.Row="7" MinWidth="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Margin="0,0,0,16">
|
||||
<Grid Grid.Row="0" Margin="0,0,0,12">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*" MinWidth="0"/>
|
||||
<ColumnDefinition Width="*" MinWidth="0"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Grid.Column="0" Background="#f4f7f7" CornerRadius="8" Padding="24" Margin="0,0,8,0">
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBlock Text="{Binding TodaysScans}"
|
||||
FontSize="56"
|
||||
FontWeight="Bold"
|
||||
Foreground="{StaticResource TitleTextBrush}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="Today's Customer"
|
||||
FontSize="16"
|
||||
Foreground="{StaticResource MutedTextBrush}"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,6,0,0"/>
|
||||
<Border Grid.Column="0" Background="#f4f7f7" CornerRadius="8" Padding="16" Margin="0,0,6,0">
|
||||
<StackPanel HorizontalAlignment="Center" MinWidth="0">
|
||||
<TextBlock Text="{Binding TodaysScans}" FontSize="40" FontWeight="Bold" Foreground="{StaticResource TitleTextBrush}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="Today's Customer" FontSize="14" Foreground="{StaticResource MutedTextBrush}" HorizontalAlignment="Center" Margin="0,4,0,0" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Grid.Column="1" Background="#f4f7f7" CornerRadius="8" Padding="24" Margin="8,0,0,0">
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBlock Text="{Binding TotalOrders}"
|
||||
FontSize="56"
|
||||
FontWeight="Bold"
|
||||
Foreground="{StaticResource TitleTextBrush}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="Total Orders"
|
||||
FontSize="16"
|
||||
Foreground="{StaticResource MutedTextBrush}"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,6,0,0"/>
|
||||
<Border Grid.Column="1" Background="#f4f7f7" CornerRadius="8" Padding="16" Margin="6,0,0,0">
|
||||
<StackPanel HorizontalAlignment="Center" MinWidth="0">
|
||||
<TextBlock Text="{Binding TotalOrders}" FontSize="40" FontWeight="Bold" Foreground="{StaticResource TitleTextBrush}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="Total Orders" FontSize="14" Foreground="{StaticResource MutedTextBrush}" HorizontalAlignment="Center" Margin="0,4,0,0" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<Border Grid.Row="1" BorderBrush="#e2e8f0" BorderThickness="1" CornerRadius="8" Padding="16" Margin="0,0,0,16">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="1" BorderBrush="#e2e8f0" BorderThickness="1" CornerRadius="8" Padding="12" Margin="0,0,0,12">
|
||||
<Grid MinWidth="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*" MinWidth="0"/>
|
||||
<ColumnDefinition Width="*" MinWidth="0"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Margin="0,0,12,12">
|
||||
<StackPanel Grid.Column="0" Margin="0,0,8,0">
|
||||
<TextBlock Text="LAST CARD" FontSize="12" Foreground="{StaticResource MutedTextBrush}" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding LastCardId}" FontSize="20" FontWeight="SemiBold" Foreground="{StaticResource TitleTextBrush}" />
|
||||
<TextBlock Text="{Binding LastCardId}" FontSize="16" FontWeight="SemiBold" Foreground="{StaticResource TitleTextBrush}" TextTrimming="CharacterEllipsis" Margin="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="1" Margin="12,0,0,12">
|
||||
<StackPanel Grid.Column="1" Margin="8,0,0,0">
|
||||
<TextBlock Text="LAST ORDER TIME" FontSize="12" Foreground="{StaticResource MutedTextBrush}" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding LastScanTimeDisplay}" FontSize="20" FontWeight="SemiBold" Foreground="{StaticResource TitleTextBrush}" />
|
||||
<TextBlock Text="{Binding LastScanTimeDisplay}" FontSize="16" FontWeight="SemiBold" Foreground="{StaticResource TitleTextBrush}" TextTrimming="CharacterEllipsis" Margin="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
|
@ -462,11 +513,7 @@
|
|||
<Border Grid.Row="2"
|
||||
Style="{StaticResource StatusBorderStyle}"
|
||||
Visibility="{Binding Message, Converter={StaticResource StringToVisibility}}">
|
||||
|
||||
<TextBlock Text="{Binding Message}"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{StaticResource SuccessTextBrush}">
|
||||
<TextBlock Text="{Binding Message}" FontSize="16" FontWeight="SemiBold" TextWrapping="Wrap">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{StaticResource SuccessTextBrush}"/>
|
||||
|
|
@ -482,6 +529,9 @@
|
|||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<UserControl x:Class="UtopiaCanteenSystem.Views.SettingsView"
|
||||
<UserControl x:Class="UtopiaCanteenSystem.Views.SettingsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<UserControl.Resources>
|
||||
|
|
@ -167,13 +167,19 @@
|
|||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Background="{StaticResource AppBackground}">
|
||||
<Grid Background="{StaticResource AppBackground}" MinHeight="0" MinWidth="0">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="40">
|
||||
Padding="16"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid MinHeight="{Binding ViewportHeight, RelativeSource={RelativeSource AncestorType=ScrollViewer}}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<StackPanel HorizontalAlignment="Center"
|
||||
Width="{Binding RelativeSource={RelativeSource AncestorType=ScrollViewer}, Path=ViewportWidth}"
|
||||
MaxWidth="1200">
|
||||
VerticalAlignment="Center"
|
||||
Width="{Binding ViewportWidth, RelativeSource={RelativeSource AncestorType=ScrollViewer}}"
|
||||
MaxWidth="1200"
|
||||
MinWidth="280">
|
||||
<!-- Title section -->
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,24">
|
||||
<Border Width="48" Height="48" Background="#eef2f2" CornerRadius="24" Margin="0,0,16,0">
|
||||
|
|
@ -209,7 +215,7 @@
|
|||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Card header -->
|
||||
<StackPanel Grid.Row="0" Margin="32,24,32,16">
|
||||
<StackPanel Grid.Row="0" Margin="24,20,24,12">
|
||||
<TextBlock Text="Configuration"
|
||||
FontSize="24"
|
||||
FontWeight="Bold"
|
||||
|
|
@ -221,7 +227,7 @@
|
|||
</StackPanel>
|
||||
|
||||
<!-- Form fields -->
|
||||
<StackPanel Grid.Row="1" Margin="32,0,32,0">
|
||||
<StackPanel Grid.Row="1" Margin="24,0,24,0">
|
||||
<TextBlock Text="Scan Timeout (seconds)" FontSize="16" Foreground="{StaticResource PrimaryText}" FontWeight="SemiBold" />
|
||||
<TextBox Text="{Binding ScanTimeoutSeconds, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource ModernTextBoxStyle}" Margin="0,8,0,8" />
|
||||
|
|
@ -230,7 +236,7 @@
|
|||
Foreground="{StaticResource MutedText}"
|
||||
Margin="0,0,0,20" />
|
||||
|
||||
<TextBlock Text="Admin Card ID" FontSize="16" Foreground="{StaticResource PrimaryText}" FontWeight="SemiBold" />
|
||||
<TextBlock Text="Admin Employee ID" FontSize="16" Foreground="{StaticResource PrimaryText}" FontWeight="SemiBold" />
|
||||
<TextBox Text="{Binding AdminCardId, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource ModernTextBoxStyle}" Margin="0,8,0,8" />
|
||||
<TextBlock Text="Card ID with admin access to settings."
|
||||
|
|
@ -318,10 +324,10 @@
|
|||
</StackPanel>
|
||||
|
||||
<!-- Button row -->
|
||||
<Border Grid.Row="2" BorderBrush="{StaticResource BorderBrush}" BorderThickness="0,1,0,0" Padding="32,24" Background="#f9fbfb">
|
||||
<Border Grid.Row="2" BorderBrush="{StaticResource BorderBrush}" BorderThickness="0,1,0,0" Padding="24,20" Background="#f9fbfb">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" MinWidth="0"/>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<WrapPanel Grid.Column="1" HorizontalAlignment="Right">
|
||||
|
|
@ -340,6 +346,7 @@
|
|||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 151 KiB |
Loading…
Reference in New Issue