From d3fc7ba284d06cfd4d1363d59ab8bf74fcc5f67f Mon Sep 17 00:00:00 2001 From: thuannd88 Date: Sat, 21 Sep 2024 11:18:45 +0700 Subject: [PATCH] =?UTF-8?q?s=E1=BB=ADa=20l=E1=BB=97i=20b=C3=A1o=20k?= =?UTF-8?q?=E1=BA=BFt=20th=C3=BAc=20giao=20d=E1=BB=8Bch=20trong=20EndSessi?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UserControl/DepositSMUCv2.xaml.cs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/UserControl/DepositSMUCv2.xaml.cs b/UserControl/DepositSMUCv2.xaml.cs index 6115b91..b3ea9b1 100644 --- a/UserControl/DepositSMUCv2.xaml.cs +++ b/UserControl/DepositSMUCv2.xaml.cs @@ -284,7 +284,7 @@ namespace SafeBagDE70 { EndSession(COUNTINGSTATE.AUTOEND,"Tự động kết thúc"); }); - EndTransaction(); + Log.Information("7. Timeout completed"); }); } @@ -1065,12 +1065,16 @@ namespace SafeBagDE70 } else { - str = $"PHIÊN GIAO DỊCH KHÔNG HỢP LỆ (SỐ TIỀN GIAO DỊCH KHÔNG KHỚP), VUI LÒNG BÁO CÁO LẠI CHI NHÁNH" + - $"\r\n MÃ GD: {AppData.GetTransactionCode()} " + - $"\r\nMÁY: {Environment.MachineName}" + - $"\r\nMÃ NV: {AppData.CurrentCustomerAccount.CustomerId}"; Log.Information(str); - ShowError(str); + Dispatcher.Invoke(() => + { + str = $"PHIÊN GIAO DỊCH KHÔNG HỢP LỆ (SỐ TIỀN GIAO DỊCH KHÔNG KHỚP), VUI LÒNG BÁO CÁO LẠI CHI NHÁNH" + + $"\r\n MÃ GD: {AppData.GetTransactionCode()} " + + $"\r\nMÁY: {Environment.MachineName}" + + $"\r\nMÃ NV: {AppData.CurrentCustomerAccount.CustomerId}"; + ShowError(str); + }); + } Thread.Sleep(1000); } @@ -1254,7 +1258,7 @@ namespace SafeBagDE70 ResetSessions(); StartWelcomeTimer(); } - else if(strMessage!=null) + else if(strMessage!=null)//Không nộp tiền nhưng yêu cầu thông báo trước khi kết thúc { var strNotify = ""; if (AppData.CurrentCustomerAccount != null) @@ -1274,12 +1278,14 @@ namespace SafeBagDE70 ResetSessions(); StartWelcomeTimer(); } - else + else//Không nộp tiền và không có thông báo --> kết thúc luôn { mainWindow.ShowWelcomeScreen(); } if (AppData.CurrentCustomerAccount != null) AppData.CurrentCustomerAccount.TransactionCode = ""; + + AppData.IsInTransaction = false; //SendData2Server } catch (Exception ex) @@ -1642,6 +1648,7 @@ namespace SafeBagDE70 Log.Information("6. Exit Completed"); else Log.Information("6. Exit failed"); + AppData.IsInTransaction = false; } } }