예제 #1
0
        public void AddMenu()
        {
            adds = new Adds();
            Console.WriteLine("# AddMenu #");
            Console.WriteLine("Select number to function:\n 1.Add student 2.Add class: " +
                              "\n" + "  OR Other Number to MainMenu");
            int num = int.Parse(Console.ReadLine());

            switch (num)
            {
            case 1:
                Console.WriteLine("Please enter student id name sex classid:");
                int    sid   = int.Parse(Console.ReadLine());
                string sname = Console.ReadLine();
                string ssex  = Console.ReadLine();
                int    cid1  = int.Parse(Console.ReadLine());
                adds.Addstudent(sid, sname, ssex, cid1);
                break;

            case 2:
                Console.WriteLine("Please enter class id name grade:");
                int    cid2  = int.Parse(Console.ReadLine());
                string cname = Console.ReadLine();
                int    grade = int.Parse(Console.ReadLine());
                adds.Addclass(cid2, cname, grade);
                break;

            default:
                break;
            }
        }