Пример #1
0
        static void Main(string[] args)
        {
            // FoldLako fl = new FoldLako();
            // Hibásnak jelzi.

            // Ember em = new Ember();
            // Szintén.

            Hallgato h = new Hallgato(); // OK
            Oktato   o = new Oktato();   // OK

            // Lényegében:
            // abstract >> ne lehessen példányt létrehozni belőle
            // sealed >> ne lehessen származtatni belőle
        }
        static void Main(string[] args)
        {
            ServiceClient client = new ServiceClient();

            using (TerembeosztoEntitasok context = new TerembeosztoEntitasok())
            {
                Hallgato h = client.GetHallgato();
                h.Nev    = "Gipsz Jakab";
                h.Neptun = "ABC123";

                context.SaveChanges();
            }



            Console.WriteLine();
            Console.WriteLine("Press <ENTER> to terminate client.");
            Console.ReadLine();
        }
Пример #3
0
        public static Hallgato[] HallgatokBeolvasasa(string eleresiUt)
        {
            StreamReader sr = new StreamReader(eleresiUt);

            int hallgatokSzama = int.Parse(sr.ReadLine()); // Beolvasom a sorok számát a fájban.

            Hallgato[] hallgatok = new Hallgato[hallgatokSzama];

            for (int i = 0; i < hallgatok.Length; i++)
            {
                string nev             = sr.ReadLine();
                string neptunazonosito = sr.ReadLine();
                int    eletkor         = int.Parse(sr.ReadLine());

                hallgatok[i] = new Hallgato(nev, neptunazonosito, eletkor);
            }
            sr.Close();

            return(hallgatok);
        }