Example #1
0
        public void Opretkunde()
        {
            bool UlovligInput = true;

            GetSetKundeNummer = KundeNummerIncrementer;
            Console.WriteLine("Angiv cpr-nummer");
            do
            {
                try
                {
                    GetSetCpr    = int.Parse(Console.ReadLine());
                    UlovligInput = false;
                }
                catch
                {
                    Console.WriteLine("Dit input var ikke et tal");
                }
            }while (UlovligInput);
            UlovligInput = true;
            Console.WriteLine("Angiv navn");
            GetSetNavn = Console.ReadLine();
            Console.WriteLine("Angiv email");
            GetSetEmail = Console.ReadLine();
            Console.WriteLine("Angiv adresse");
            GetSetAdresse = Console.ReadLine();
            Console.WriteLine("Angiv Telefonnr");
            do
            {
                try
                {
                    GetSetTelefonNr = int.Parse(Console.ReadLine());
                    UlovligInput    = false;
                }
                catch
                {
                    Console.WriteLine("Dit input var ikke et tal");
                }
            }while (UlovligInput);
            IndlånKonto DefaultKonto = new IndlånKonto();

            DefaultKonto.OpretKonto();
            IndlånKontoer.Add(DefaultKonto);
        }
Example #2
0
        public void OpretKonto()
        {
            Selector KundeVælg      = new Selector(kunder);
            int      kundeValg      = KundeVælg.VælgKunde();
            int      antalKontoer   = 0;
            int      kontoCounter   = 0;
            string   lånType        = string.Empty;
            bool     ulovligLånType = true;

            Console.WriteLine("Indtast antal kontoer du vil oprette");
            antalKontoer = int.Parse(Console.ReadLine());
            do
            {
                Console.WriteLine("Hvilken kontotype vil du oprette? Tast i for indlån og u for udlån");
                do
                {
                    lånType = Console.ReadLine();
                    if (lånType == "i" || lånType == "I" || lånType == "u" || lånType == "U")
                    {
                        ulovligLånType = false;
                    }
                }while (ulovligLånType);
                if (lånType == "i" || lånType == "I")
                {
                    IndlånKonto nyKonto = new IndlånKonto();
                    nyKonto.OpretKonto();
                    kunder[kundeValg - 1].GetSetIndlånKontoer.Add(nyKonto);
                }
                else
                {
                    UdlånKonto nyKonto = new UdlånKonto();
                    nyKonto.OpretKonto();
                    kunder[kundeValg - 1].GetSetUdlånKontoer.Add(nyKonto);
                }
                kontoCounter++;
            }while (kontoCounter < antalKontoer);
            Console.WriteLine("Kontoer er oprettet, tast enter for at fortsætte");
            Console.ReadLine();
        }