Exemplo n.º 1
0
        public Dto_CountryListNode createCountryListTwo()
        {
            List <int> Code = new List <int>()
            {
                1, 2, 3, 4
            };

            List <string> CountryName = new List <string>()
            {
                "Japón", "Israel", "Arabia Saudita", "Corea del Sur"
            };

            List <int> NumberHospitals = new List <int>()
            {
                1000, 800, 400, 1400
            };

            List <string> ProvenanceList = new List <string>()
            {
                "List Two", "List Two", "List Two", "List Two"
            };

            Dao_CountryList     obj_dao_Country = new Dao_CountryList();
            Dto_CountryListNode countryListNode = obj_dao_Country.createCountryList(Code, CountryName, NumberHospitals, ProvenanceList);

            return(countryListNode);
        }
Exemplo n.º 2
0
        public Dto_CountryListNode createCountryListOne()
        {
            List <int> Code = new List <int>()
            {
                1, 2, 3, 4, 5, 6
            };

            List <string> CountryName = new List <string>()
            {
                "Estados Unidos", "Rusia", "China", "Alemania", "Reino Unido", "Francia"
            };

            List <int> NumberHospitals = new List <int>()
            {
                1200, 500, 900, 1500, 475, 1010
            };

            List <string> ProvenanceList = new List <string>()
            {
                "List One", "List One", "List One", "List One", "List One", "List One"
            };

            Dao_CountryList     obj_dao_Country = new Dao_CountryList();
            Dto_CountryListNode countryListNode = obj_dao_Country.createCountryList(Code, CountryName, NumberHospitals, ProvenanceList);

            return(countryListNode);
        }
Exemplo n.º 3
0
        public Dto_CountryListNode createCountryListNode(List <Dto_CountryList> Country)
        {
            for (int i = 0; i < Country.Count; i++)
            {
                countryListNode = AddCountry(Country[i]);
            }

            return(countryListNode);
        }
Exemplo n.º 4
0
        public Dto_CountryListNode junctionOfNodes(Dto_CountryListNode countryListNodeOne, Dto_CountryListNode countryListNodeTwo)
        {
            Dto_CountryListNode Head = countryListNodeTwo;
            int countCountryList     = 1;

            countryListNodeTwo = countryListNodeOne;

            Dto_CountryListNode last = countryListNodeTwo;

            while (last.Next != null)
            {
                last = last.Next;
            }
            last.Next = Head;

            Dto_CountryListNode count = countryListNodeTwo;

            while (count.Next != null)
            {
                countCountryList++;
                count = count.Next;
            }

            Dto_CountryListNode last_print = countryListNodeTwo;

            for (int i = 0; i < countCountryList; i++)
            {
                Console.WriteLine("Code: " + last_print.countryList.code);
                Console.WriteLine("Country Name: " + last_print.countryList.country_name);
                Console.WriteLine("Number Of Hospitals: " + last_print.countryList.number_of_hospitals);
                Console.WriteLine("Provenance List: " + last_print.countryList.provenance_list);
                Console.WriteLine("\n");
                last_print = last_print.Next;
            }

            //Dto_CountryListNode last_print = countryListNodeTwo;
            //while (last_print.Next != null)
            //{
            //    Console.WriteLine("Code: " + last_print.countryList.code);
            //    Console.WriteLine("Country Name: " + last_print.countryList.country_name);
            //    Console.WriteLine("Number Of Hospitals: " + last_print.countryList.number_of_hospitals);
            //    Console.WriteLine("Provenance List: " + last_print.countryList.provenance_list);
            //    Console.WriteLine("\n");
            //    last_print = last_print.Next;
            //}

            //Console.WriteLine("Code: " + last_print.countryList.code);
            //Console.WriteLine("Country Name: " + last_print.countryList.country_name);
            //Console.WriteLine("Number Of Hospitals: " + last_print.countryList.number_of_hospitals);
            //Console.WriteLine("Provenance List: " + last_print.countryList.provenance_list);

            return(countryListNodeTwo);
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            //Creación de Nodos de CountryListOne
            CreateCountryListOne createCountryListOne = new CreateCountryListOne();
            Dto_CountryListNode  countryListNodeOne   = createCountryListOne.createCountryListOne();

            //Creación de Nodos de CountryListTwo
            CreateCountryListTwo createCountryListTwo = new CreateCountryListTwo();
            Dto_CountryListNode  countryListNodeTwo   = createCountryListTwo.createCountryListTwo();

            //Unir nodo 1 antes del nodo 2
            LogicFirstExam      logicFirstExam        = new LogicFirstExam();
            Dto_CountryListNode countryListJoinedNode = logicFirstExam.junctionOfNodes(countryListNodeOne, countryListNodeTwo);
        }
Exemplo n.º 6
0
        public Dto_CountryListNode createCountryList(List <int> Code, List <string> CountryName, List <int> NumberHospitals, List <string> ProvenanceList)
        {
            List <Dto_CountryList> country = new List <Dto_CountryList>();

            for (int i = 0; i < CountryName.Count; i++)
            {
                country.Add(new Dto_CountryList()
                {
                    code                = Code[i],
                    country_name        = CountryName[i],
                    number_of_hospitals = NumberHospitals[i],
                    provenance_list     = ProvenanceList[i],
                });
            }

            Dao_CountryListNode dao_CountryListNode = new Dao_CountryListNode();
            Dto_CountryListNode countryListNode     = dao_CountryListNode.createCountryListNode(country);

            return(countryListNode);
        }
Exemplo n.º 7
0
        public Dto_CountryListNode AddCountry(Dto_CountryList countryList)
        {
            Dto_CountryListNode countryListNode = new Dto_CountryListNode();

            countryListNode.countryList = countryList;

            if (Head == null)
            {
                Head = countryListNode;
            }
            else
            {
                Dto_CountryListNode last = Head;
                while (last.Next != null)
                {
                    last = last.Next;
                }
                last.Next = countryListNode;
            }

            return(Head);
        }