- Sep 19, 2000
- 10,283
- 134
- 106
Ok, so I am working with this database and have come to a crossroad which I would like some advice on.
This Database deals with employee charged expenses to the company and timesheets. So here is my quandary.
What if an Admin wants to delete an employee? Since the employeeID is linked to all the timesheets and expenses that they have done, the only way to delete an employee is to delete all that data associated with that employee. As you could imagine, that could be a bad thing if the company ever wants to look at former transactions/timesheet entries.
So here is what I'm thinking. Don't delete the employee, just disable them (IE flip a bit in one of the columns to say "This employee is no longer active" and hide the employee from management panels. Is this a good idea? Should I not even provide the ability to delete an employee? Or should I give them the option with a strict warning "Hey stupid, this can really mess things up."?
The second part, is there an easy way with linq to find and delete all foreign key references to a database element? (without going to each table and explicitly saying "Delete all elements that have this key associated with it")
This Database deals with employee charged expenses to the company and timesheets. So here is my quandary.
What if an Admin wants to delete an employee? Since the employeeID is linked to all the timesheets and expenses that they have done, the only way to delete an employee is to delete all that data associated with that employee. As you could imagine, that could be a bad thing if the company ever wants to look at former transactions/timesheet entries.
So here is what I'm thinking. Don't delete the employee, just disable them (IE flip a bit in one of the columns to say "This employee is no longer active" and hide the employee from management panels. Is this a good idea? Should I not even provide the ability to delete an employee? Or should I give them the option with a strict warning "Hey stupid, this can really mess things up."?
The second part, is there an easy way with linq to find and delete all foreign key references to a database element? (without going to each table and explicitly saying "Delete all elements that have this key associated with it")