if you want to get all records if pass null and any id then check department id.
here if pass null initally you will get all data. other wise based on departmentid you will get the data
WHERE
(H.DisplayName LIKE '%' + @search + '%'
OR H.User_ID LIKE '%' + @search + '%'
OR H.EmpNo LIKE '%' + @search + '%'
)
AND H.IsActive = 1
AND UAE.RoleCode IN ('SuperAdmin', 'DepartmentAdmin', 'Approver')
AND (@departmentID IS NULL OR UAE.Department_ID = @departmentID)
No comments:
Post a Comment