public void AddFillingField(int nCodeTypeChamp, int nNumChamp, C2iExpression formule) { try { ETypeChampDonneeCumulee eType = (ETypeChampDonneeCumulee)nCodeTypeChamp; CChampDonneeCumulee champ = new CChampDonneeCumulee(); champ.TypeChamp = eType; champ.NumeroChamp = nNumChamp; CListeParametresFillChampDonneeCumulee lst = new CListeParametresFillChampDonneeCumulee(); lst.AddRange(ParametresFillChamps); bool bDone = false; foreach (CParametreFillChampDonneeCumulee p in lst) { if (p.Champ.Equals(champ)) { p.FormuleSource = formule; bDone = true; break; } } if (!bDone) { CParametreFillChampDonneeCumulee parametre = new CParametreFillChampDonneeCumulee(); parametre.Champ = champ; parametre.FormuleSource = formule; lst.Add(parametre); } ParametresFillChamps = lst; } catch { } }
//-------------------------------------------------- public int GetNbMaxFields(ETypeChampDonneeCumulee typeChamp) { switch (typeChamp) { case ETypeChampDonneeCumulee.Cle: return(10); case ETypeChampDonneeCumulee.Decimal: return(60); case ETypeChampDonneeCumulee.Date: return(40); case ETypeChampDonneeCumulee.Texte: return(40); } return(0); }
//-------------------------------------------- public CChampDonneeCumulee(ETypeChampDonneeCumulee typeChamp, int nNumero) { m_nNumeroChamp = nNumero; m_typeChamp = typeChamp; }