1 2 3 4 5 6 7 8 9 10 11 12 13
|
IF EXISTS(SELECT affaireNum FROM AffaireServices WHERE serviceChar='SAMPP' AND affaireNum=@Numero_affaire)
BEGIN
DECLARE @TMP_PREAVIS VARCHAR(255)
SET @TMP_PREAVIS = @Preavis_select_Serv01
IF (@TMP_PREAVIS == 'Veuillez choisir')
BEGIN
@TMP_PREAVIS = ''
END
UPDATE AffaireServices SET recuLe2=@Date_recu_Service01b, aConsulte=@Service01,renvoyeLe=@Date_renvoyer_Service01,envoyeLe=@Date_envoyer_Service01, recuLe=@Date_recu_Service01,preavis=@TMP_PREAVIS WHERE serviceChar='SAMPP' AND affaireNum=@Numero_affaire
END
ELSE
INSERT INTO AffaireServices (recuLe2,renvoyeLe,envoyeLe,recuLe,serviceChar,affaireNum,nom,aConsulte,preavis,serviceId) VALUES (@Date_recu_Service01b,@Date_renvoyer_Service01,@Date_envoyer_Service01,@Date_recu_Service01,'SAMPP',@Numero_affaire,'SAMPP - Service des affaires militaires et de la protection de la population',@Service01,@Preavis_select_Serv01,1) |
Partager