1
Answer

error in the implementation of my method in my wcf project

aida athamnia

aida athamnia

14y
2.8k
1
Hi,
when i implement the method MiseAjourEtatFactureWCF(ref string REF_COMPTE_FACTURATION, ref int STATUT) in my wcf project this following error has appeared:

error:
Invalid expression term 'if'

code:
 public retour 
MiseAjourEtatFactureWCF(ref string REF_COMPTE_FACTURATION, ref int
STATUT)
{
Service1 ser = new
Service1();
retour rt = new
retour();
ser.MiseAJourFacture(
if
(ser.MiseAjourEtatFacture(REF_COMPTE_FACTURATION,STATUT).Equals(-1))
{
try
{
rt.CodeRetour = -1;
rt.msgRetour
= "mise à
jour etat facture échoué"
;
}
catch
(Exception e)
{
CreateLog log = new
CreateLog(e);

log.ErrorLog(@"C:\Documents and
Settings\Administrateur\Bureau\fichierLog.txt"
);
}

return rt;
}
else
{
rt.CodeRetour = 0;
rt.msgRetour =
"mise à jour
etat facture réussit"
;
return
rt;
}
}

knowing that the goal of this method is to return error an message and to create log file in the case of failed call of the method
MiseAjourEtatFacture(REF_COMPTE_FACTURATION,STATUT) and the succes message in the case of succeeded call of this method.


Please help me because i'm a beginner. :((((((((((





Answers (1)