sendevent

This commit is contained in:
thuannd88
2024-09-06 17:20:09 +07:00
parent 8fb4e9ae92
commit bcfef9d82d
6 changed files with 280 additions and 36 deletions
+15 -1
View File
@@ -71,7 +71,7 @@ namespace SafeBagDE70
public static CDMSTATE? CDMSTATE = null;
private static DateTime CutOffTime = new DateTime(1, 1, 1, 12, 0, 0); // 12:00 noon as cut-off time
public static void GetNewTransactionCode()
public static void CreateNewTransactionCode()
{
DateTime transactionDateTime = DateTime.Now;
@@ -100,6 +100,13 @@ namespace SafeBagDE70
CurrentCustomerAccount.TransactionCode = transactionId;
CurrentCustomerAccount.TransactionTime = transactionDateTime;
}
public static string GetTransactionCode()
{
if (CurrentCustomerAccount != null)
return CurrentCustomerAccount.TransactionCode;
else
return "";
}
public static CDMSTATE? GetCDMState()
{
try
@@ -393,6 +400,7 @@ namespace SafeBagDE70
public int SensorStatus { get; set; }
public int OtherError { get; set; }
public string? Notes { get; set; }
public string? TransactionCode { get; set; }
public string Description { get; set; }
}
public enum DeviceStatusCode {
@@ -410,4 +418,10 @@ namespace SafeBagDE70
NORMAL = 0,
ERROR = 1
}
public enum CDMStatusCode
{
NORMAL = 0,
DISCONNECT_SERIALPORT=1,
}
}