Beispiel #1
0
        static void Load(string type)
        {
            team.Clear();
            switch (type)
            {
            case "Xml": team.LoadXml(); break;

            case "Bin": team.LoadBinary(); break;

            case "Json": team.LoadJson(); break;

            case "Txt": team.LoadTxt(); break;
            }
            foreach (var item in team)
            {
                if (item.GetType() == typeof(Commercial))
                {
                    Console.WriteLine("Matricule : {0}, Nom : {1}, Prenom : {2}, Chiffre d'affaire : {3}, Commission : {4}", item.Matricule, item.Nom, item.Prenom, ((Commercial)item).ChiffreAffaire, ((Commercial)item).Commission);
                }
                else
                {
                    Console.WriteLine("Matricule : {0}, Nom : {1}, Prenom : {2}", item.Matricule, item.Nom, item.Prenom);
                }
            }
            Console.ReadLine();
        }