Example #1
0
        //create collection client hardcor
        public static void CollectionClients(Dispather name)
        {
            Client cli  = new Client("Mishael", "Saha", 22, Gender.man, 15000);
            Client cli1 = new Client("Furst", "Mistik", 18, Gender.woman, 200);
            Client cli2 = new Client("Chelyadko", "Alexey", 27, Gender.man, 7000);
            Client cli3 = (Client)cli1.Clone();

            cli3.Age       = 22;
            cli3.FirstName = "Nivarov";
            cli3.Gender    = (int)Gender.man;


            name.AddClient(cli);
            name.AddClient(cli1);
            name.AddClient(cli2);
            name.AddClient(cli3);
        }
Example #2
0
        public static Client AddMyClient(Dispather disp, string firstname, string lastname)
        {
            int Age;
            int Summ;

            Console.WriteLine("Enter Age");
            int.TryParse(Console.ReadLine(), out Age);

            Console.WriteLine("Gender");
            Gender gender;

            Enum.TryParse(Console.ReadLine(), out gender);
            Console.WriteLine("Enter Summ");

            int.TryParse(Console.ReadLine(), out Summ);

            Client client = new Client(firstname, lastname, Age, gender, Summ);

            disp.AddClient(client);
            Console.WriteLine($"Hello {lastname},{firstname}");
            return(client);
        }