示例#1
0
        public void LoadStudents()
        {
            RegistrationServiceClient registrationService = new RegistrationServiceClient();
            RegisteredStudents= new List<string>(registrationService.GetEnrolledStudents(GlobalClass.currentsy));
            StudentServiceClient studentService = new StudentServiceClient();
            string message = String.Empty;
            try
            {
                var students = studentService.GetAllStudents();
                studentList = new List<StudentServiceRef.Student>(students);
                gvStudent.DataSource = students;
                gvStudent.Refresh();

                if (gvStudent.RowCount != 0)
                    gvStudent.Rows[0].IsSelected = true;
            }
            catch (Exception ex)
            {
                message = "Error Loading Student List";
                MessageBox.Show(ex.ToString());
            }
        }