Role Permission

This commit is contained in:
Mohaimen Hasan 2026-11-16 18:27:28 +06:00
parent 8b452c2bbd
commit 17ffe30ae8
5 changed files with 13 additions and 9 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -1,4 +1,4 @@
<app-loading-panel></app-loading-panel>
<kendo-grid [kendoGridBinding]="gridView"
class="rl-grid"
kendoGridSelectBy="id"

View File

@ -9,6 +9,7 @@ import { HRMNotificationService } from '../../../app.notification.service';
import { UntilityHandlerService } from '../../../utility.hanldler.service';
import { ApiService } from '../../../app.api.service';
import { EnumAuthStatus, EnumExtension, EnumRoleType } from '../../../_models/enums';
import { loadingPanelService } from '../../../hrm-loding panel/loding.panel.service';
import { ButtonModule } from '@progress/kendo-angular-buttons';
import { DropDownListModule } from '@progress/kendo-angular-dropdowns';
@ -39,9 +40,10 @@ export class RolePermissionListComponent implements OnInit {
selectedRole: Role;
viewMode: number =1; //1 new, 2 edit ,3 approve
constructor(public useService: AuthService,public apiService: ApiService,
public router: Router, public utilityService: UntilityHandlerService, public apiservice: ApiService) {
public router: Router, public utilityService: UntilityHandlerService, public apiservice: ApiService,
public loadingPanel: loadingPanelService) {
this.setSelectableSettings();
this.utilityService.ShowLoadingPanel = true;
this.loadingPanel.ShowLoadingPanel = true;
this.apiservice.selectedMenuName="Role Entry"
this.allData = this.allData.bind(this);
}
@ -64,10 +66,10 @@ export class RolePermissionListComponent implements OnInit {
(err: any) => {
//ON ERROR
console.log(err);
this.utilityService.ShowLoadingPanel = false;
this.loadingPanel.ShowLoadingPanel = false;
},
() => {
this.utilityService.ShowLoadingPanel = false;
this.loadingPanel.ShowLoadingPanel = false;
}
);

View File

@ -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)