Example #1
0
 public StudentController()
 {
     ListStudents.Add("Amit");
     ListStudents.Add("Vinay");
     ListStudents.Add("Mohan");
     ListStudents.Add("Sundar");
     ListStudents.Add("Raj");
     ListStudents.Add("Satya");
     ListStudents.Add("Krishna");
 }
        static void addmenu()
        {
            string FirstName, LastName, Sex, CountryOfBirth;
            int    StudentNumber, YearOfBirth;

            Console.BackgroundColor = ConsoleColor.Blue;
            Console.WriteLine("\n Enter the Student information below. \n");
            Console.ResetColor();
            Console.WriteLine("Student's First Name :  "); FirstName = Console.ReadLine();
            Console.WriteLine("Student's Last Name :  "); LastName   = Console.ReadLine();
            Console.WriteLine("Student's Sex :  "); Sex = Console.ReadLine();
            Console.WriteLine("Student's Country of Birth :  "); CountryOfBirth = Console.ReadLine();
            Console.WriteLine("studentNumber"); StudentNumber             = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Student's Year of birth :  "); YearOfBirth = Convert.ToInt32(Console.ReadLine());

            listStudents.Add(new Students(StudentNumber, FirstName, LastName, Sex, CountryOfBirth, YearOfBirth));
        }