diff --git a/HRM.DA/DA/Users/RoleDA.cs b/HRM.DA/DA/Users/RoleDA.cs index 7f594cd..38223de 100644 --- a/HRM.DA/DA/Users/RoleDA.cs +++ b/HRM.DA/DA/Users/RoleDA.cs @@ -73,8 +73,8 @@ namespace HRM.DA //" WHERE RoleID = %n", item.Code, item.Name, item.ModifiedBy, item.ModifiedDate, item.Sequence, (int)item.RoleStatus, item.ApproveBy, item.ApproveDate, (int)item.RoleStatus, item.Description, item.ID); tc.ExecuteNonQuery( - "UPDATE Role SET Code=%s, name = %s, Sequence = %n, ApproveBy = %n,ApproveDate=%D,Status=%n , AUTHORIZEDBY=%n, AUTHORIZEDDATE=%D" + - " WHERE RoleID = %n", item.Code, item.Name, item.Sequence, item.ApproveBy, item.ApproveDate, + "UPDATE Role SET Code=%s, name = %s, Description = %s, ROLETYPE = %n, Sequence = %n, ApproveBy = %n,ApproveDate=%D,Status=%n , AUTHORIZEDBY=%n, AUTHORIZEDDATE=%D" + + " WHERE RoleID = %n", item.Code, item.Name, item.Description, (int)item.RoleType, item.Sequence, item.ApproveBy, item.ApproveDate, (int)item.RoleStatus, item.ModifiedBy, item.ModifiedDate, item.ID); } diff --git a/HRM.UI/ClientApp/src/app/authentication/role/role-permission-entry/role-permission-entry.component.ts b/HRM.UI/ClientApp/src/app/authentication/role/role-permission-entry/role-permission-entry.component.ts index 26c868d..5f72d19 100644 --- a/HRM.UI/ClientApp/src/app/authentication/role/role-permission-entry/role-permission-entry.component.ts +++ b/HRM.UI/ClientApp/src/app/authentication/role/role-permission-entry/role-permission-entry.component.ts @@ -121,7 +121,7 @@ export class RolePermissionEntryComponent implements OnInit { }, (err: any) => { //ON ERROR - this.loadingpanelService.ShowLoadingPanel = true; + this.loadingpanelService.ShowLoadingPanel = false; }, () => { @@ -378,7 +378,7 @@ export class RolePermissionEntryComponent implements OnInit { (err: any) => { //ON ERROR this.loadingpanelService.ShowLoadingPanel = false; - this.notificationService.showSuccess(err.error); + this.notificationService.showError(err.error); }, () => { this.loadingpanelService.ShowLoadingPanel = false; diff --git a/HRM.UI/ClientApp/src/app/authentication/role/role-permission-list/role-permission-list.component.html b/HRM.UI/ClientApp/src/app/authentication/role/role-permission-list/role-permission-list.component.html index 0e9d87b..27107dc 100644 --- a/HRM.UI/ClientApp/src/app/authentication/role/role-permission-list/role-permission-list.component.html +++ b/HRM.UI/ClientApp/src/app/authentication/role/role-permission-list/role-permission-list.component.html @@ -1,4 +1,4 @@ - + { //ON ERROR console.log(err); - this.utilityService.ShowLoadingPanel = false; + this.loadingPanel.ShowLoadingPanel = false; }, () => { - this.utilityService.ShowLoadingPanel = false; + this.loadingPanel.ShowLoadingPanel = false; } ); diff --git a/HRM.UI/Controllers/Auth/AuthController.cs b/HRM.UI/Controllers/Auth/AuthController.cs index 2f47b59..5af03ad 100644 --- a/HRM.UI/Controllers/Auth/AuthController.cs +++ b/HRM.UI/Controllers/Auth/AuthController.cs @@ -1309,6 +1309,8 @@ namespace HRM.UI.Controllers } role.CreatedBy = existingRole.CreatedBy; role.CreatedDate = existingRole.CreatedDate; + // The browser does not send Sequence either; keep the role's own value instead of 0. + role.Sequence = existingRole.Sequence; role.ApproveDate = null; role.ApproveBy = null; if (role.RoleStatus == EnumAuthStatus.Approved)