Esempio n. 1
0
        public static string CreateAspirant()
        {
            String     surname = null;
            int        year    = 0;
            int        number  = 0;
            String     thesis  = null;
            AsDatabase astbase = new AsDatabase();
            int        n       = 0;//counter aspirant
            string     choice  = "2";

            while (choice == "2")
            {
                Console.WriteLine("type surname");
                surname = Console.ReadLine();
                Console.WriteLine("type study year");
                year = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("type student number");
                number = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("type Thesis theme");
                thesis     = Console.ReadLine();
                astbase[n] = new Aspirant(surname, year, number, thesis);
                n          = n + 1;
                Console.WriteLine("For new student type - 1 \t  For new aspirant- 2 \t For Student information -3 \t For Aspirant information -4 \t Type -end- to exit ");
                choice = Console.ReadLine();
            }
            while (choice == "4")
            {
                Console.WriteLine("Enter index");
                int m = Convert.ToInt32(Console.ReadLine());
                astbase[m].Display();
                Console.WriteLine("For new student type - 1 \t Type - end - to exit \t For new aspirant- 2 \t For information -3 \t For Students information -4 \t Type -end- to exit ");
                choice = Console.ReadLine();
            }
            return(choice);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            SDatabase  stbase  = new SDatabase();
            AsDatabase astbase = new AsDatabase();

            string choice; link1:

            Console.WriteLine("For new student type - 1");
            Console.WriteLine("For new aspirant- 2 ");
            Console.WriteLine("For information about Students-3");
            Console.WriteLine("For information about Aspirants-4");
            Console.WriteLine("Type -end- to exit");
            choice = Console.ReadLine();

            switch (choice)
            {
            case "1":
                CreateStudent(); goto link1;
                break;

            case "2":
                CreateAspirant(); goto link1;
                break;

            case "3":
                CreateStudent(); goto link1;
                break;

            case "4":
                CreateAspirant(); goto link1;
                break;

            case "end":

                break;
            }



            Console.ReadKey();
        }