This commit is contained in:
thuannd88
2024-09-05 15:58:31 +07:00
parent acfa22a83a
commit 7e927dfcc9
10 changed files with 220 additions and 20 deletions
+25 -12
View File
@@ -29,20 +29,27 @@ namespace SafeBagDE70
public static ObservableCollection<string> logCollection = new ObservableCollection<string>();
public static ListView logListView = null;
public static int MaxLogCount = 500;
public static int MaxNotes = 300;
public static DeviceStatus? DeviceStatus = null;
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" }
};
customerAccounts = new List<CustomerAccount>();
using (var context = new CDMDbContext())
{
var customers = context.Customers;
foreach(var customer in customers)
{
var ca = new CustomerAccount
{
Name = customer.TenantName,
CustomerId = customer.AccountNumber,
QRCode = customer.AccountNumber,
PINCode = customer.PinCode
};
customerAccounts.Add(ca);
}
}
CurrentCustomerAccount = customerAccounts[0];
CDMSTATE=new CDMSTATE();
DeviceStatus = new DeviceStatus
@@ -107,9 +114,14 @@ namespace SafeBagDE70
AppData.CDMSTATE.IsRejectPocketFull = data[3] & 0x40;
AppData.CDMSTATE.IsNotesInRejectPocket = data[3] & 0x10;
AppData.CDMSTATE.IsNotesInHopper = data[3] & 0x01;
if (data[0] == 0x40 && data[1] == 0x07 && data[2] == 0x41)
AppData.CDMSTATE.IsError = 0;
else
AppData.CDMSTATE.IsError = 1;
AppData.CDMSTATE.RequestTime = DateTime.Now;
AppData.CDMSTATE.UpdateCDMStatus(cCmdRsp.recv_dat);
}
}
@@ -258,6 +270,7 @@ namespace SafeBagDE70
public int IsRejectPocketFull = 0;
public int IsNotesInRejectPocket = 0;
public int IsNotesInHopper = 0;
public int IsError = 0;
public RecvData? RecvDat = null;
public byte GetSR1()
{