Exemple #1
0
        public Item(string error)
        {
            PostNumber post = new PostNumber(0000, "ErrorTwon");

            _adress = new Adress("error", ref post);
            _person = new Person("error", "Error", "", "", _adress);
        }
Exemple #2
0
        public static List <PostItem> GetAllAdressesInPostNumber(PostNumber post)
        {
            List <PostItem> retunlist = new List <PostItem>();

            foreach (var variable in _postList)
            {
                if (variable.PostNumber == post)
                {
                    retunlist.Add(variable);
                }
            }

            return(retunlist);
        }
Exemple #3
0
        static void Main(string[] args)
        {
            var     Aarhus  = new PostNumber(8000, "Århus C");
            IAdress street  = new Adress("The Street", ref Aarhus);
            IAdress street2 = new Adress("The Street2", ref Aarhus);


            Person jasper   = new Person("Jasper", "", "Anderson", "Friend", street);
            Person jonathan = new Person("Jonathan", "", "Anderson", "Friend", street);
            Person john     = new Person("john", "", "Jepserson", "Friend", street2);


            jasper.Print();
            jonathan.Print();


            JoinPersonAdress.printList();

            JoinPersonAdress.CorrectAdress("The Street", "Street 5");

            jasper.AddAlternativeAdress(ref street2, "GirlFriend");

            jasper.Print();
            jonathan.Print();


            Console.WriteLine("\nwho lives at the Street 5:");
            var livesHere = JoinPersonAdress.GetAllAdresseOccupant(street);

            foreach (var VARIABLE in livesHere)
            {
                Console.WriteLine(VARIABLE.Person.Fornavn.ToString());
            }


            Console.WriteLine("\nwhat adresse are in postNumber 8000");
            var postlive = JoinPostNumberList.GetAllAdressesInPostNumber(Aarhus);

            foreach (var VARIABLE in postlive)
            {
                Console.WriteLine(VARIABLE.Adress.VejNavnOgNummer);
            }


            JoinPostNumberList.printList();

            Console.Read();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            using (var db = new BloggingContext())
            {
                // IPostNumberList postNumberList;
                var Aarhus   = new PostNumber(8000, "Århus C");
                var Aabenraa = new PostNumber(6200, "Aabenraa");
                //postNumberList.City = Aarhus;


                IAdress street  = new Adress("The Street", ref Aabenraa);
                IAdress street1 = new Adress("The Street1", ref Aabenraa);
                IAdress street2 = new Adress("The Street2", ref Aarhus);
                IAdress street3 = new Adress("The Street3", ref Aarhus);

                Person Jens     = new Person("Jens", "", "Jaltesen", "Friend", street);
                Person Jarl     = new Person("Jarl", "", "Jensen", "Friend", street1);
                Person jasper   = new Person("Jasper", "", "Anderson", "Friend", street2);
                Person jonathan = new Person("Jonathan", "", "Anderson", "Friend", street2);
                Person john     = new Person("john", "", "Jepserson", "Friend", street3);
            }
        }
Exemple #5
0
        private void SetpostNumer(ref PostNumber value)
        {
            var adressRef = this;

            JoinPostNumberList.AddEntry(new PostItem(ref adressRef, ref value));
        }
Exemple #6
0
 public Adress(string vejNavn, ref PostNumber post)
 {
     VejNavnOgNummer = vejNavn;
     SetpostNumer(ref post);
 }
Exemple #7
0
 public PostItem(ref Adress adress, ref PostNumber post)
 {
     _adress     = adress;
     _postNumber = post;
 }