Пример #1
0
        public void UpdateStudentTest()
        {
            //Creating a Student
            Student student = CreateStudent();

            Assert.AreNotEqual(0, student.RollNumber);

            //Updating a Student
            student.Name        = "Ramya";
            student.Modified_By = 1;
            mStudentDataService.UpdateStudent(student);

            //Getting Student Details
            Student expected = mStudentDataService.GetStudentByRollNumber(student.RollNumber);

            Assert.AreEqual(expected.Name, student.Name);
        }
        private void UpdateStudent()
        {
            StudentDataService ds = new StudentDataService();
            Student            studentMetUpdates = SelectedStudent;

            if (!String.IsNullOrWhiteSpace(Achternaam))
            {
                studentMetUpdates.Achternaam = Achternaam;
            }
            if (!String.IsNullOrWhiteSpace(Voornaam))
            {
                studentMetUpdates.Voornaam = Voornaam;
            }
            if (!String.IsNullOrWhiteSpace(Geslacht))
            {
                studentMetUpdates.Geslacht = Geslacht;
            }
            if (!String.IsNullOrWhiteSpace(Klas))
            {
                studentMetUpdates.Klas = Klas;
            }
            if (!String.IsNullOrWhiteSpace(TelefoonNummer))
            {
                studentMetUpdates.TelefoonNummer = TelefoonNummer;
            }
            if (!String.IsNullOrWhiteSpace(EmailAdres))
            {
                studentMetUpdates.EmailAdres = EmailAdres;
            }
            ds.UpdateStudent(studentMetUpdates);
            Messenger.Default.Send <UpdateFinishedMessage>(new UpdateFinishedMessage("Completed"));
            Achternaam     = string.Empty;
            Voornaam       = string.Empty;
            Geslacht       = string.Empty;
            Klas           = string.Empty;
            TelefoonNummer = string.Empty;
            EmailAdres     = string.Empty;
        }
 //Created by Prasana on 18.07.2013
 /// <summary>
 /// Updates the student.
 /// </summary>
 /// <param name="student">The student.</param>
 public void UpdateStudent(Student student)
 {
     studentDataService.UpdateStudent(student);
 }