using DE70_CMDv2; using SafeBagDE70.Model; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SafeBagDE70 { public static class AppData { public static List? 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 void Init() { customerAccounts = new List{ 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" } }; CurrentCustomerAccount = customerAccounts[0]; } public static void LogAction(string strAction, string? strData) { if (strData != null) strData = "Data: " + strData; File.AppendAllText("log.txt", "\r\n" + DateTime.Now.ToString("yyyyMMddHHmmss: ") + "Action: " + strAction + " " + strData); } public static void LogException(string strAction, string? strData) { if (strData != null) strData = "Data: " + strData; File.AppendAllText("logException.txt", "\r\n" + DateTime.Now.ToString("yyyyMMddHHmmss: ") + "Action: " + strAction + " " + strData); } } public class CustomerAccount { public string? Name { get; set; } public string? CustomerId { get; set; } public string? QRCode { get; set; } public string? PINCode { get; set; } } }