Method to delete the effective date in a document that is in the preliminary state

I have a document in preliminary state that has an effective date and I need to delete it (preliminary documents should not have an effective date until it is released). 

Please give me a C# server method that will delete the effective date in this Preliminary document.  It is a controlled document.  I do not know how to write in C# but I do know how to copy your method into a new method, create the document action and add it to the document item type.

Your help is greatly appreciated.