public int AddStudent(Student s)
        {
            //Insert the student and update the index
            arr_student.Insert(student_index++,s);

            return 0;
        }
 private void btnPrevious_Click(object sender, RoutedEventArgs e)
 {
     if (studentList.Count != 0)
     {
         if (studentList.Count == 1)
         {
             currentStudent = studentList[0];
         }
         else if (studentList.IndexOf(currentStudent) == 0)
         {
             currentStudent = studentList[studentList.Count - 1];
         }
         else
         {
             currentStudent = studentList[studentList.IndexOf(currentStudent) - 1];
         }
         txtFirstName.Text = currentStudent.FirstName;
         txtLastName.Text = currentStudent.LastName;
         txtCity.Text = currentStudent.City;
     }
     else
     {
         txtFirstName.Clear();
         txtLastName.Clear();
         txtCity.Clear();
     }
 }
 private void btnCreateStudent_Click(object sender, RoutedEventArgs e)
 {
     Student student = new Student(txtFirstName.Text, txtLastName.Text, txtCity.Text);
     students.Add(student);
     MessageBox.Show("Student Add Successfully ");
     txtFirstName.Clear();
     txtLastName.Clear();
     txtCity.Clear();
 }
        //to store the student's information that user enter
        private void btnCreateStudent_Click(object sender, RoutedEventArgs e)
        {
            Student s = new Student();
            EnterStudentInformation(s);

            course.AddStudent(s);

            CleanTxt();
            TestBtnIsEnabled();
        }
        void add(string first, string last, string city)
        {

            Student student = new Student();
            student.FirstName = first;
            student.LastName = last;
            student.City = city;
            studentCollections.Add(student);
            
        }
 private void btnCreateStudent_Click(object sender, RoutedEventArgs e)
 {
     //slist = new List<Student>();
     
         Student sa = new Student(txtFirstName.Text, txtLastName.Text, txtCity.Text);
         slist.Add(sa);
         txtFirstName.Text = "";
         txtLastName.Text = "";
         txtCity.Text = "";
     
 }
        private void btnCreateStudent_Click(object sender, RoutedEventArgs e)
        {
            Student student = new Student();
            student.FirstName = txtFirstName.Text;
            student.LastName = txtLastName.Text;
            student.City = txtCity.Text;
            studentList.Add(student);

            txtFirstName.Clear();
            txtLastName.Clear();
            txtCity.Clear();
        }
Esempio n. 8
0
        private void btnCreateStudent_Click(object sender, RoutedEventArgs e)
        {
            // Create and add the new student to the list.
            Student student = new Student();
            student.FirstName = txtFirstName.Text;
            student.LastName = txtLastName.Text;
            student.City = txtCity.Text;
            StudentListObject.Add(student);

            // Clear the contents of the text boxes.
            txtFirstName.Clear();
            txtLastName.Clear();
            txtCity.Clear();

            // Update previous and next button
            updateButtons();
        }
        private void btnCreateStudent_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(txtFirstName.Text) && !string.IsNullOrEmpty(txtLastName.Text) &&
                !string.IsNullOrEmpty(txtCity.Text))
            {
                Student student1 = new Student();
                student1.FirstName = txtFirstName.Text;
                student1.LastName = txtLastName.Text;
                student1.City = txtCity.Text;

                studentList.Add(student1);

                txtFirstName.Clear();
                txtLastName.Clear();
                txtCity.Clear();
            }
        }
Esempio n. 10
0
        public void clickOnBtn_CreateStudent(object sender, RoutedEventArgs rea)
        {
            // Instanciate a student Student
            Student student = new Student("","","");
            // Add that student to the list of student
            students.Add(student);
            // assign values to Student fields
            this.students[i].First = txtFirstName.Text;
            this.students[i].Last = txtLastName.Text;
            // DateTime to string object to display the birthdate
            this.students[i].Birthdate = new DateTime(1982, 3, 6).ToString("dd/mm/yyyy");
            this.students[i].Birthdate = txtBirthdate.Text;

            // clear the contents of the control instead of assigning the Text property an empty string.
            txtFirstName.Clear();
            txtLastName.Clear();
            txtBirthdate.Clear();
            // next field of the list students
            i++;
        }
Esempio n. 11
0
        private void btnCreateStudent_Click(object sender, RoutedEventArgs e)
        {
            Student student = new Student();

            // set student information
            student.FirstName = txtFirstName.Text;
            student.LastName = txtLastName.Text;
            student.City = txtCity.Text;

            // add student to list
            Students.Add(student);

            // clear text boxes
            txtFirstName.Clear();
            txtLastName.Clear();
            txtCity.Clear();

            // reset list location
            currentStudent = 0;
        }
 //store information from user
 private void EnterStudentInformation(Student s)
 {
     s.FirstName = "" + txtFirstName.Text;
     s.LastName = "" + txtLastName.Text;
     s.City = "" + txtCity.Text;
 }
Esempio n. 13
0
 private void PopulateStudentText(Student student)
 {
     txtFirstName.Text = student.FirstName;
     txtLastName.Text = student.LastName;
     txtCity.Text = student.City;
 }
Esempio n. 14
0
 // Show student info in the app window.
 private void showStudentInfo(Student s)
 {
     txtFirstName.Text = s.FirstName;
     txtLastName.Text = s.LastName;
     txtCity.Text = s.City;
 }