- EndTransaction cho kết thúc tự động

This commit is contained in:
Nguyen Dinh Thuan
2024-09-21 06:30:31 +07:00
parent 8cb760e4a4
commit 20b5bb8cd1
4 changed files with 9 additions and 12 deletions
+6 -9
View File
@@ -270,7 +270,7 @@ namespace SafeBagDE70
private void EndSessionTimer_Tick(object? sender, EventArgs e) private void EndSessionTimer_Tick(object? sender, EventArgs e)
{ {
Log.Information("7. Timout starting"); Log.Information("7. Timeout starting");
mainWindow.ShowEndSessionScreen(); mainWindow.ShowEndSessionScreen();
StopTimers(); StopTimers();
DoStoreStart(); DoStoreStart();
@@ -284,7 +284,8 @@ namespace SafeBagDE70
{ {
EndSession(COUNTINGSTATE.AUTOEND,"Tự động kết thúc"); EndSession(COUNTINGSTATE.AUTOEND,"Tự động kết thúc");
}); });
Log.Information("7. Timout completed"); EndTransaction();
Log.Information("7. Timeout completed");
}); });
} }
@@ -1197,8 +1198,8 @@ namespace SafeBagDE70
//Remove sessions with store flag is false //Remove sessions with store flag is false
sessions.RemoveAll(item => !item.IsStored); sessions.RemoveAll(item => !item.IsStored);//Xóa các GD chưa lưu
UpdateListViewCountItems(); UpdateListViewCountItems(); //Cập nhật lại danh sách hiển thị
var totalQuantity = lvCountItems[10].Quantity; var totalQuantity = lvCountItems[10].Quantity;
var totalValue = lvCountItems[10].Value; var totalValue = lvCountItems[10].Value;
@@ -1209,8 +1210,6 @@ namespace SafeBagDE70
serialPortDE70.DiscardInBuffer(); serialPortDE70.DiscardInBuffer();
serialPortDE70.DiscardOutBuffer(); serialPortDE70.DiscardOutBuffer();
if (double.Parse(totalValue) > 0) if (double.Parse(totalValue) > 0)
{ {
var data2Send = new CountingData2Send var data2Send = new CountingData2Send
@@ -1224,7 +1223,7 @@ namespace SafeBagDE70
CountingState= (int)_CountingState CountingState= (int)_CountingState
}; };
SyncData(data2Send); SyncData(data2Send);//Lưu CSDL và đồng bộ
//Reset all and ready to next session //Reset all and ready to next session
if (printerFlag == true) if (printerFlag == true)
@@ -1235,7 +1234,6 @@ namespace SafeBagDE70
} }
String strNotify = $"BẠN VỪA THỰC HIỆN NỘP TIỀN VÀO MÁY CDM:\r\n" String strNotify = $"BẠN VỪA THỰC HIỆN NỘP TIỀN VÀO MÁY CDM:\r\n"
+ $"SỐ LƯỢNG TỜ: {totalQuantity}\r\n" + $"SỐ LƯỢNG TỜ: {totalQuantity}\r\n"
+ $"SỐ TIỀN: {totalValue} VND\r\n"; + $"SỐ TIỀN: {totalValue} VND\r\n";
@@ -1255,7 +1253,6 @@ namespace SafeBagDE70
}); });
ResetSessions(); ResetSessions();
StartWelcomeTimer(); StartWelcomeTimer();
} }
else if(strMessage!=null) else if(strMessage!=null)
{ {
+1 -1
View File
@@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
namespace SafeBagDE70.Model namespace SafeBagDE70.old
{ {
public class KeyModel public class KeyModel
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
using SafeBagDE70.Model; using SafeBagDE70.old;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
+1 -1
View File
@@ -1,4 +1,4 @@
using SafeBagDE70.Model; using SafeBagDE70.old;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;