public Student[] GetEnrollStudents()
 {
     StudentDatabase sd = new StudentDatabase();
     List<string> students = new List<string>();
     students = sd.GetStudents();
     Student[] studentArray = new Student[students.Count];
     for (int i = 0; i < students.Count; i++)
     {
         Student s = new Student();
         s.Name = students[i];
         studentArray[i] = s;
     }
     return studentArray;
 }
Ejemplo n.º 2
0
        private void EnrollBtn_Click(object sender, RoutedEventArgs e)
        {
            if (studentNameTxt.Text == "")
                return;
            using (ChannelFactory<IStudentEnrollmentService> schoolServiceProxy =
            new ChannelFactory<IStudentEnrollmentService>("MyStudentEnrollmentServiceEndpoint"))
            {
                schoolServiceProxy.Open();
                IStudentEnrollmentService schoolEnrollmentService = schoolServiceProxy.CreateChannel();
                Student s = new Student();
                s.Name = studentNameTxt.Text;
                schoolEnrollmentService.EnrollStudent(s);
                schoolServiceProxy.Close();
            }

            studentNameTxt.Text = "";

        }
 public void EnrollStudent(Student student)
 {
     StudentDatabase sd = new StudentDatabase();
     sd.AddStudent(student.Name);
 }