What you describe is Pessimistic Concurrency. This is no easy task and I don't think anyone will be able to easily answer that. However there are some links you could check.
What is Pessimistic Concurrency[
^],
Introduction to Concurrency Control[
^],
Optimistic and Pessimistic Concurrency - A Simple Explanation[
^].
As you can read there are some implications with pessimistic concurrency, deadlock possibly being the most dangerous. There are probably various way to handle this. Some ORM's might be able to handle this for you, such as
Teleriks OpenAccess ORM[
^]. You could also use, for example, a service that keeps track of who locks what entity. But once again, there really is no easy way to do this.
I hope this is at least somewhat helpful, even though it does not really answer your question :)