Break it down into smaller methods. Each if and each else should be their own class. Study up on refactoring and design patterns.
>But how do you navigate in all this if else code
>
>E.g.
>
>Int32 SomeValue;
>
>If (!Int32.TryParse(SomeString, out SomeValue) || SomeValue = 0)
> {
> // First Error here
> }
> else
> { more code that may cause problems
> if ...
>
> }
>}
>
>In other words, it is very hard to keep track of all these if else and {}
>
>BTW, I usually create several UnitTests per method - for invalid parameters, for some unreal values, etc.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer