I have employee data capture application. .net and t-sql.
It has number of lookup(metadata) tables which used to populate drop downs in the UI. ex: "Departments". Every lookup table has active flag. Sometimes this flag set to false. This means I should not load those inactive “Departments” in the drop down. This perfectly works for ADD NEW EMPLOYEE scenario. But in EDIT EMPLOYEE scenario, if one lookup record (Department-HR) happens to be inactive but associated with the EMPLOYEE for some reson, I have a problem that the Department-HR is missing in the drop down to select.
I know question looks silly. I can pass EmployeeId and load Active + all associated departments to EmployeeId, but I want to know a smarter and cleaner way to handle the situation.