public void Edit(StudentExtendedProxy oldExtendedProxy, StudentExtendedProxy newExtendedProxy)
        {
            var foundStudent = ModelDatabase.GetStudent(oldExtendedProxy);

            foundStudent.FirstName             = newExtendedProxy.FirstName;
            foundStudent.SecondName            = newExtendedProxy.SecondName;
            foundStudent.ThirdName             = newExtendedProxy.ThirdName;
            foundStudent.DateOfBirth           = newExtendedProxy.DateOfBirth;
            foundStudent.PreviousEducationName = newExtendedProxy.PreviousEducationName;
            foundStudent.PreviousEducationYear = newExtendedProxy.PreviousEducationYear;
            foundStudent.EnrollmentName        = newExtendedProxy.EnrollmentName;
            foundStudent.EnrollmentYear        = newExtendedProxy.EnrollmentYear;
            foundStudent.ExpulsionName         = newExtendedProxy.ExpulsionName;
            foundStudent.ExpulsionYear         = newExtendedProxy.ExpulsionYear;
            foundStudent.ExpulsionOrderDate    = newExtendedProxy.ExpulsionOrderDate;
            foundStudent.ExpulsionOrderNumber  = newExtendedProxy.ExpulsionOrderNumber;
            foundStudent.DiplomaTopic          = newExtendedProxy.DiplomaTopic;
            foundStudent.DiplomaAssessment     = (int)newExtendedProxy.DiplomaAssessment;
            foundStudent.ProtectionDate        = newExtendedProxy.ProtectionDate;
            foundStudent.ProtocolNumber        = newExtendedProxy.ProtocolNumber;
            foundStudent.RegistrationNumber    = newExtendedProxy.RegistrationNumber;
            foundStudent.RegistrationDate      = newExtendedProxy.RegistrationDate;
            foundStudent.AssessmentByDisciplines.ForEach(assessmentByDiscipline =>
                                                         assessmentByDiscipline.Assessment = (int)newExtendedProxy.AssessmentByDisciplines.First(a =>
                                                                                                                                                 a.NameOfDiscipline == assessmentByDiscipline.Discipline.DisciplineName)
                                                                                             .Assessment);

            ModelDatabase.SaveChanges();
        }
 public StudentExtendedProxy GetExtendedProxy(StudentBasedProxy basedProxy)
 {
     return(modelDatabase.GetStudent(basedProxy).ToExtendedProxy());
 }
 public void Delete(StudentBasedProxy basedProxy)
 {
     DeleteStudent(ModelDatabase.GetStudent(basedProxy));
     ModelDatabase.SaveChanges();
 }