Exemple de Modélisation d'une référence différente en fonction de champs d'un formulaire.

Code ci dessous nous ramène les élément constitutifs de la référence en fonction du champ "Doc_TypeDoc".
switch(doc.GetStringValue("Doc_TypeDoc"))
{
case "Procédure":
returnValue=doc.GetStringValue( "GED_TYPEAbbr" );
returnValue+="-"+doc.GetStringValue( "DomaineAbbr" );
break;
case "Spécification":
returnValue=doc.GetStringValue( "GED_TYPEAbbr" );
returnValue+=doc.GetStringValue("TypeApecifAbbr");
returnValue+=""+doc.GetStringValue("CategAbbr");
break;
case "Instruction":
returnValue=doc.GetStringValue( "GED_TYPEAbbr" );
returnValue+="-"+doc.GetStringValue("RefProcedure").Substring(4);
returnValue+="-";
break;
case "Mode Opératoire":
returnValue=doc.GetStringValue( "GED_TYPEAbbr" );
returnValue+="-";
returnValue+=System.DateTime.Parse(doc.GetStringValue("Doc_DateCreation")).Year.ToString().Substring(2);
break;
default:
returnValue=doc.GetStringValue( "Doc_Reference" );
doc.SetValues( "Reference", returnValue );
break;
}
