I managed to modify the object using a custom binder. First I call base.BindModel and then I modify the properties before returning it.
public class BillingMethodModelBinder : DefaultModelBinder
{
public override object BindModel(ControllerContext cContext, ModelBindingContext bContext)
{
var newBillingMethod = (BillingMethod)base.BindModel(cContext, bContext);
var bType = newBillingMethod.BillingTypeValue;
if (bType == (int)BillingType.Monthly)
{
newBillingMethod.DayOfFirstFortnight = null;
newBillingMethod.DayOfSecondFortnight = null;
}
else
{
newBillingMethod.DayOfMonth = null;
}
return newBillingMethod;
}
}
And, of course, add the custom binder in global.asax's Application_Start():
ModelBinders.Binders.Add(typeof(BillingMethod), new BillingMethodModelBinder());
That worked great for me, I'll wait for a day or so before accepting this answer just in case someone comes with a better solution or points me to any problems I may encounter while using this method