Porchoman® is Back!

20 janvier 2008

Bonnes pratiques en SSII

Classé dans : Non classé — seb @ 16:20

Sous prétexte de respecter les délais, de réduire les couts et de satisfaire les petits caprices de certains clients, certaines SSII n'hésitent pas à cultiver la méthode du code "vite, moche, débile" en embauchant des gens totalement incompétents.
Ainsi je me suis retrouvé à maintenir des horreurs sans nom.

Exemple : un énorme extranet utilisé par un gros ministère ; le code ci-dessous (asp 3) était dupliqué sur une cinquantaine de fichier

 
<% Sub produit(t)
 
if oRS(t) > 0 then
			response.write "<small>" &amp; t &amp; "</small>
"
		end if
 
	end sub
 
sub tel(t)
	if len(t) &gt; 9 then
		response.write t
	end if
end sub
 
%&gt;
&lt;%set oConn = session("oConn")
 
set oRS = oConn.execute("SELECT * FROM [IntSociétés] WHERE [Numero_de_la_societe] = " &amp; request.queryString  )
 
if not oRS.EOF then
	oRS.MoveFirst
%&gt;
&lt;% end if %&gt;
 
 
 
 
bgcolor="#FFFFFF" style="vertical-align: top"&gt;
 
<strong><span style="color: #ffffff;">
</span>    face="Times New Roman" size="3"&gt;<strong>Nom</strong></strong>
<strong><span style="color: #ffffff;">
</span>    face="Times New Roman" size="3"&gt;<strong>Adresse</strong></strong>
<strong><span style="color: #ffffff;">
</span>    face="Times New Roman" size="3"&gt;<strong>Type
    de produit(s)</strong></strong>
 
    style="margin-left: 2px; margin-right: 2; margin-top: 2; margin-bottom: 2" valign="top"
    align="left"&gt;<span>&lt;% if oRS("Presence_HE") = "O" then
		response.write "<strong> " &amp; oRS("Nom_de_la_societe") &amp; "</strong>
 "
		response.write UCase(oRS("Pays1")) &amp; "
représentée par :
"
		response.write oRS("Nom_de_la_HE")
	else
		response.write "<strong> " &amp; oRS("Nom_de_la_societe") &amp; "</strong>
 "
		response.write UCase(oRS("Pays1"))
	end if%&gt;</span>
 
    style="margin-left: 2px; margin-right: 2; margin-top: 2; margin-bottom: 2" valign="top"
    align="left"&gt;<span style="margin-top: 0px">&lt;%=oRS("Adresse1")%&gt;
            &lt;% 	if not isnull(oRS("CPAdresse1")) then
		response.write oRS("CPAdresse1") &amp; "
"
	end if%&gt;&lt;%=oRS("CP1")%&gt;   &lt;%=oRS("Ville1")%&gt;
            Tél. : &lt;% tel(oRS("Tel1"))%&gt;
            Fax : &lt;% tel(oRS("Fax1"))%&gt;</span>
 
    style="margin-left: 2px; margin-right: 2; margin-top: 2; margin-bottom: 2" valign="top"
    align="center"&gt;
 
<span>
</span>    style="margin-top: 0px"&gt;&lt;% produit("PM") %&gt;
<dd> </dd>
 
bgcolor="#FFFFFF" style="vertical-align: top"&gt;
 
<strong><span style="font-family: Times New Roman; color: #330000; font-size: small;"><strong>N°
        Admission
        à la marque</strong></span></strong>
<strong><span style="font-family: Times New Roman; color: #330000; font-size: small;"><strong>Désignation</strong></span></strong>
<strong><span style="font-family: Times New Roman; color: #330000; font-size: small;"><strong>Matériau
        </strong></span></strong>
 
    &lt;% set oRS2 = oConn.execute("SELECT * FROM [IntPM] WHERE [Numero_de_la_societe] = " &amp; request.queryString )
	if not oRS2.EOF then
		oRS2.MoveFirst
		DO Until oRS2.EOF
%&gt;
 
    style="margin-left: 2px; margin-right: 2; margin-top: 2; margin-bottom: 2" valign="top"
    align="center"&gt;&lt;%=oRS2("PPM_N_Admission_Marque")%&gt; 
 
    style="margin-left: 2px; margin-right: 2; margin-top: 2; margin-bottom: 2" valign="top"
    align="left"&gt; &lt;%=oRS2("PPM_Nom_commercial")%&gt;
 
    style="margin-left: 2px; margin-right: 2; margin-top: 2; margin-bottom: 2" valign="top"
    align="left"&gt;&lt;%=oRS2("PPM_Materiau")%&gt; 
 
    &lt;% 		oRS2.Movenext
	Loop
	End if
%&gt;

Pas de commentaire »

Pas encore de commentaire.

Flux RSS des commentaires de cet article. URL de rétrolien

Laisser un commentaire