From 6d2e2c0c56dfcc55a1e2c92e848592cad551209b Mon Sep 17 00:00:00 2001 From: Tuan Anh Nguyen Manh Date: Fri, 27 Aug 2021 22:52:16 +0700 Subject: [PATCH] Update cheque --- .../Areas/Admin/Controllers/ChequesController.cs | 2 +- Backend/Controllers/ChequesController.cs | 16 +++++++--------- Backend/Hubs/ChatHub.cs | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Backend/Areas/Admin/Controllers/ChequesController.cs b/Backend/Areas/Admin/Controllers/ChequesController.cs index 409de2a..5d046fd 100644 --- a/Backend/Areas/Admin/Controllers/ChequesController.cs +++ b/Backend/Areas/Admin/Controllers/ChequesController.cs @@ -641,7 +641,7 @@ private List CreateNotification(Cheques cheque, string message) Content = message, Status = (int) NotificationStatus.Unread, PkType = (int) NotificationType.Cheque, - PkId = cheque.ChequeBookId, + PkId = cheque.ChequeId, } }; diff --git a/Backend/Controllers/ChequesController.cs b/Backend/Controllers/ChequesController.cs index 5725046..d276e4d 100644 --- a/Backend/Controllers/ChequesController.cs +++ b/Backend/Controllers/ChequesController.cs @@ -54,15 +54,13 @@ public ActionResult Detail(int id) var account = accounts.Get(user.AccountId); var cheque = cheques.Get(id); - if (chequebooks.CheckDuplicate(x => x.ChequeBookId == cheque.ChequeBookId && x.AccountId == account.AccountId)) - { - var chequeDetail = new ChequesViewModel(cheque); - return View(chequeDetail); - } - else - { + if (!chequebooks.CheckDuplicate(x => + x.ChequeBookId == cheque.ChequeBookId && x.AccountId == account.AccountId)) return RedirectToAction("NotFound", "Error"); - } + + var chequeDetail = new ChequesViewModel(cheque); + return View(chequeDetail); + } public ActionResult GetData(int chequeBookId) @@ -450,7 +448,7 @@ private List CreateNotification(Cheques cheque, string message) Content = message, Status = (int) NotificationStatus.Unread, PkType = (int) NotificationType.Cheque, - PkId = cheque.ChequeBookId, + PkId = cheque.ChequeId, } }; diff --git a/Backend/Hubs/ChatHub.cs b/Backend/Hubs/ChatHub.cs index af8ab5e..b3e33ee 100644 --- a/Backend/Hubs/ChatHub.cs +++ b/Backend/Hubs/ChatHub.cs @@ -173,7 +173,7 @@ public string ReadNotification(int notificationId) return "/Transactions/TransactionsDetails/" + notification.PkId; case (int) NotificationType.Cheque: - return "/Cheques/?ChequeBookId=" + notification.PkId; + return "/Cheques/Detail/" + notification.PkId; } } catch (Exception ex)