I observed that you are using values for database action like:
1 for Add
2 for Edit
Instead of this we should use Constants/Enumerators. For example for Add we can create a Constants/Enumerators variable called dbAdd (DB_ADD) = 1
It is easier to read such variables and understand instead of values.
Just my thoughts....