Prod Bonus Attn grid modified #20

Merged
chapal merged 2 commits from dev_mashfiq into devqc 2024-12-17 14:13:00 +06:00
3 changed files with 45 additions and 30 deletions
Showing only changes of commit 710f5ba9c4 - Show all commits

View File

@ -26,11 +26,12 @@
<kendo-dropdownlist <kendo-dropdownlist
style="width:100%" style="width:100%"
[data]="users" [data]="users"
[defaultItem]="{ userName: 'Select User', userID: null }" [defaultItem]="{ userName: 'Select User', id: null }"
[textField]="'userName'" [textField]="'userName'"
[valueField]="'userID'" [valueField]="'id'"
[(ngModel)]="selectedUser" [(ngModel)]="selectedUser"
(valueChange)="onUserChange($event)" (valueChange)="onUserChange($event)"
[disabled]="!(_selectedPayroll != null && _selectedRoleType != null) "
> >
</kendo-dropdownlist> </kendo-dropdownlist>
</div> </div>
@ -48,6 +49,7 @@
[valueField]="'id'" [valueField]="'id'"
[valuePrimitive]="true" [valuePrimitive]="true"
(valueChange)="onPayrollChange($event)" (valueChange)="onPayrollChange($event)"
[disabled]="!_selectedRoleType"
> >
</kendo-dropdownlist> </kendo-dropdownlist>
</div> </div>
@ -59,10 +61,11 @@
<kendo-dropdownlist class="form-control form-control-sm input-sm" <kendo-dropdownlist class="form-control form-control-sm input-sm"
style="width:100%" style="width:100%"
[data]="permissionTypes" [data]="permissionTypes"
[defaultItem]="{ name: 'Select Permission Type', id: null }" [defaultItem]="{ name: 'Select Permission Type', value: null }"
[textField]="'name'" [textField]="'name'"
[valueField]="'id'" [valueField]="'value'"
(selectionChange)="EventPermissionType($event)" (selectionChange)="EventPermissionType($event)"
[disabled]="!_selectedPayroll"
> >
</kendo-dropdownlist> </kendo-dropdownlist>
</div> </div>

View File

@ -52,6 +52,7 @@ export class DataPermssionComponent implements OnInit {
public isLocation: boolean = false; public isLocation: boolean = false;
onUserTypeChange(_selectedRoleType: any): void { onUserTypeChange(_selectedRoleType: any): void {
if (this._selectedRoleType.value != null) {
this.utilityHandlerService.ShowLoadingPanel = true; this.utilityHandlerService.ShowLoadingPanel = true;
this.userService.GetUsers(this._selectedRoleType.value).subscribe( this.userService.GetUsers(this._selectedRoleType.value).subscribe(
(x) => { (x) => {
@ -66,6 +67,11 @@ export class DataPermssionComponent implements OnInit {
this.utilityHandlerService.ShowLoadingPanel = false; this.utilityHandlerService.ShowLoadingPanel = false;
}); });
} }
else {
this.users = [];
this.selectedUser = undefined;
}
}
EventPermissionType(selectedPermissionType: any): void { EventPermissionType(selectedPermissionType: any): void {
this.isDepartment = false; this.isDepartment = false;
@ -80,12 +86,14 @@ export class DataPermssionComponent implements OnInit {
} }
onUserChange(selectedUserID: any): void { onUserChange(selectedUserID: any): void {
if(selectedUserID.id != null){
this._selectedUser = selectedUserID; this._selectedUser = selectedUserID;
this._userID = this._selectedUser.id; this._userID = this._selectedUser.id;
if (this._userID != undefined && this._selectedPayroll != undefined) if (this._userID != undefined && this._selectedPayroll != undefined)
this.loadGridView() this.loadGridView()
} }
}
onPayrollChange(selectedPayrollID: any): void { onPayrollChange(selectedPayrollID: any): void {
this._selectedPayroll = selectedPayrollID; this._selectedPayroll = selectedPayrollID;

View File

@ -89,7 +89,11 @@ namespace HRM.UI.Controllers
param = new object[2]; param = new object[2];
param[i] = EnumStatus.Active; param[i] = EnumStatus.Active;
if(cty.PayrollTypeID == null)
param[i + 1] = (int)CurrentUser.GetCurrentUser(HttpContext.User).PayrollTypeID; param[i + 1] = (int)CurrentUser.GetCurrentUser(HttpContext.User).PayrollTypeID;
else
param[i + 1] = (int)cty.PayrollTypeID;
paramtypes = new Type[2]; paramtypes = new Type[2];
paramtypes[i] = typeof(EnumStatus); paramtypes[i] = typeof(EnumStatus);