Add project files.

This commit is contained in:
Admin
2024-09-02 10:03:23 +07:00
parent 42def0d4aa
commit 6219298497
361 changed files with 58423 additions and 0 deletions
@@ -0,0 +1,29 @@
<UserControl x:Class="SafeBagDE70.Admin.AdminConfigurationUC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SafeBagDE70.Admin"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<StackPanel Grid.Row="1" Grid.Column="0" Background="LightGray" VerticalAlignment="Top">
<Button
Content="Thiết lập bộ đếm"
x:Name="btnResetCounter"
HorizontalAlignment="Stretch"
Height="40"
Margin="10"
Click="btnResetCounter_Click"/>
<Button
Content="Mở ngăn phụ"
x:Name="btnOpenEscrow"
HorizontalAlignment="Stretch"
Height="40"
Margin="10"
Click="btnOpenEscrow_Click"/>
<hc:HighlightTextBlock x:Name="lblStatus" FontSize="20" FontWeight="Bold" Foreground="Green" Text=""/>
</StackPanel>
</Grid>
</UserControl>
@@ -0,0 +1,65 @@
using SafeBagDE70.Model;
using System;
using System.Collections.Generic;
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;
using System.Windows.Threading;
namespace SafeBagDE70
{
/// <summary>
/// Interaction logic for QRCodeWindow.xaml
/// </summary>
public partial class PinCodeWindow : HandyControl.Controls.Window
{
private DispatcherTimer timer;
int countTimer = 0;
public string QRCodeContent = null;
public PinCodeWindow()
{
InitializeComponent();
this.KeyDown += QRCodeWindow_KeyDown;
this.Loaded += QRCodeWindow_Loaded;
}
private void QRCodeWindow_Loaded(object sender, RoutedEventArgs e)
{
Keyboard.Focus(this);
timer = new DispatcherTimer();
// Set the timer interval to 1 second
timer.Interval = TimeSpan.FromMilliseconds(100);
// Define the event handler that's called each time the timer elapses
timer.Tick += Timer_Tick;
// Start the timer
timer.Start();
}
private void Timer_Tick(object sender, EventArgs e)
{
countTimer++;
if (QRCodeContent!=null && countTimer == 5)
{
// DialogResult = true;
// this.Close();
//finish
}
}
private void QRCodeWindow_KeyDown(object sender, KeyEventArgs e)
{
QRCodeContent += KeyModel.GetCharFromKey(e.Key);
countTimer = 0;
}
}
}
@@ -0,0 +1,51 @@
using DE70_CMDv2;
using SafeBagDE70.Model;
using Serilog;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SafeBagDE70
{
public static class AppData
{
public static string CDMPort = "COM4";
public static string SensorPort = "COM3";
public static Version? CurrentVersion = null;
public static List<CustomerAccount>? customerAccounts = null;
public static CustomerAccount? CurrentCustomerAccount{get;set;}
public static CCmdRsp? cCmdRsp=null;
public static bool IsAuthenticated = false;
public static bool IsInTransaction = false;
public static int WDTCount = 0;
public static ObservableCollection<string> logCollection = new ObservableCollection<string>();
public static void Init()
{
customerAccounts = new List<CustomerAccount>{
new CustomerAccount{Name="NGUYỄN ĐÌNH THUẬN",CustomerId="HUE_0000000001",QRCode="HUE_0000000001",PINCode="H0001" },
new CustomerAccount{Name="HOÀNG VĂN HIỆP",CustomerId="HUE_0000000002",QRCode="HUE_0000000002",PINCode="H0002" },
new CustomerAccount{Name="PHẠM NGỌC HƯNG",CustomerId="HUE_0000000003",QRCode="HUE_0000000003",PINCode="H0003" },
new CustomerAccount{Name="AMHUE-ESTELLETEST",CustomerId="00DZAMHUE0004",QRCode="00DZAMHUE0004",PINCode="H0004" },
new CustomerAccount{Name="AMHUE-ECCOTEST",CustomerId="00DZAMHUE0005",QRCode="00DZAMHUE0005",PINCode="H0005" },
new CustomerAccount{Name="AMHUE-ALDOTEST",CustomerId="00DZAMHUE0006",QRCode="00DZAMHUE0006",PINCode="H0006" },
new CustomerAccount{Name="AMHUE-MLBTEST",CustomerId="00DZAMHUE0007",QRCode="00DZAMHUE0007",PINCode="H0007" },
new CustomerAccount{Name="AMHUE-PEDROTEST",CustomerId="00DZAMHUE0008",QRCode="00DZAMHUE0008",PINCode="H0008" }
};
CurrentCustomerAccount = customerAccounts[0];
}
}
public class CustomerAccount
{
public string? Name { get; set; }
public string? CustomerId { get; set; }
public string? QRCode { get; set; }
public string? PINCode { get; set; }
}
}