public string GetToString(Societe societe, DeclarationCnss declaration, Exercice exercice)
        {
            if (societe == null || declaration == null || exercice == null)
            {
                return(string.Empty);
            }
            string result = string.Empty;

            result += societe.NumeroEmployeur.PadLeft(8, '0');
            result += societe.CleEmployeur.PadLeft(2, '0');
            result += CodeExploitation.PadLeft(4, '0');
            result += declaration.Trimestre.ToString().PadLeft(1);
            result += exercice.Annee.PadLeft(4, '0');
            result += Page.ToString().PadLeft(3, '0');
            result += Ligne.ToString().PadLeft(2, '0');
            result += NumeroCnss.PadLeft(8, '0');
            result += CleCnss.PadLeft(2, '0');
            string identite = (Prenom.Trim() + " " + AutresNom.Trim() + " " + Nom.Trim() + " " + NomJeuneFille.Trim());

            result += Helper.StrTr(identite.PadRight(60)).ToUpper();
            result += Cin.PadLeft(8, '0');
            decimal total = Brut1 + Brut2 + Brut3;

            result += ((double)(total * 1000)).ToString("0").PadLeft(10, '0');
            result += string.Empty.PadLeft(10, '0');

            if (result.Length != 122)
            {
                throw new InvalidOperationException(
                          "Le nombre de caractère est invalide! Année [" + exercice + "] Trimestre " +
                          declaration.Trimestre);
            }

            return(result);
        }
Esempio n. 2
0
 public override string ToString()
 {
     return(IdBagage.ToString() + CodeIata + Compagnie + Ligne.ToString() + DateCreation.ToString());
     //return base.ToString();
 }