If you are submitting your main DOM... you would just call
XDocument.Submit() from code.
If you want to know what the result was you can do the following:
try
{
var sResult = XDocument.Submit();
if(<whatver_you_are_checking_for> == sResult)
{
<do_whatever_you_need_to_here>
}
}
catch(ex)
{
<something_went_wrong>
<look_at_ex.message_to_know_what_to_do>
}
Greg Collins [InfoPath MVP]