Ok, so your problem is that it always returns successfully? That doesn't sound like a problem to me.
Well, if you're never getting the message; "mise à jour etat facture échoué", and you're expecting to, then that is a problem, but without knowing what
ser
is or what
MiseAjourEtatFacture(REF_COMPTE_FACTURATION,STATUT)
should return with different cases, I can't tell you why it's not working.
I will say that you should never get an error log created though. Because, I would assume that
rt.CodeRetour = -1;
rt.msgRetour = "mise à jour etat facture échoué";
should never throw an error.
Also, I'm a little confused with what your CreateLog is. You create a new log and pass it the exception. Then, you pass it a file location. Is that a class you wrote yourself? Because if so, you seem to do it backwards. Generally, you create a log file on disk or open a log file on disk, and then you pass it the information to put into the log.
[You've dealt with this]
It looks like your problem is here:
ser.MiseAJourFacture(
if (ser.MiseAjourEtatFacture(REF_COMPTE_FACTURATION,STATUT).Equals(-1))
You have an icomplete statement. I don't know what the ser.MiseAJourFacture
is there for, but it's saying that the if is an invalid expression with regards to that because you didn't finish that statement.
If it's a method call that does some work to ser, then it could stand-alone, but it may not need to be there. if it does, try changing it to:
ser.MiseAJourFacture();
if (ser.MiseAjourEtatFacture(REF_COMPTE_FACTURATION,STATUT).Equals(-1))