try catch init
This commit is contained in:
+26
-12
@@ -37,7 +37,32 @@ namespace SafeBagDE70
|
|||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CDMSTATE = new CDMSTATE();
|
||||||
|
DeviceStatus = new DeviceStatus
|
||||||
|
{
|
||||||
|
Device = Environment.MachineName,
|
||||||
|
TenantId = AppData.TenantId,
|
||||||
|
Status = 0,
|
||||||
|
CDMStatus = 0,
|
||||||
|
PrinterStatus = 0,
|
||||||
|
SensorStatus = 0,
|
||||||
|
Notes = "",
|
||||||
|
OtherError = 0,
|
||||||
|
};
|
||||||
|
InitUsers();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Fatal(ex, "AppInit");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void InitUsers()
|
||||||
|
{
|
||||||
customerAccounts = new List<CustomerAccount>();
|
customerAccounts = new List<CustomerAccount>();
|
||||||
using (var context = new CDMDbContext())
|
using (var context = new CDMDbContext())
|
||||||
{
|
{
|
||||||
@@ -55,19 +80,8 @@ namespace SafeBagDE70
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
CurrentCustomerAccount = customerAccounts[0];
|
CurrentCustomerAccount = customerAccounts[0];
|
||||||
CDMSTATE=new CDMSTATE();
|
|
||||||
DeviceStatus = new DeviceStatus
|
|
||||||
{
|
|
||||||
Device = Environment.MachineName,
|
|
||||||
TenantId = AppData.TenantId,
|
|
||||||
Status = 0,
|
|
||||||
CDMStatus = 0,
|
|
||||||
PrinterStatus = 0,
|
|
||||||
SensorStatus = 0,
|
|
||||||
Notes = "",
|
|
||||||
OtherError = 0,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CDMSTATE? CDMSTATE = null;
|
public static CDMSTATE? CDMSTATE = null;
|
||||||
private static DateTime CutOffTime = new DateTime(1, 1, 1, 12, 0, 0); // 12:00 noon as cut-off time
|
private static DateTime CutOffTime = new DateTime(1, 1, 1, 12, 0, 0); // 12:00 noon as cut-off time
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user