public void DelSubjectToListVM() { StudentSubject studentSubjectMVM = new StudentSubject(); if (CurrentStudentSubjectMVM == null) { studentSubjectMVM.Delete(); ErrorsList = studentSubjectMVM.CurrentValidation.Errors.Select(x => new ErrorMessage() { Message = x }).ToList(); } else { ErrorsList = new List <ErrorMessage>(); studentSubjectMVM = CurrentStudentSubjectMVM; studentSubjectMVM.Delete(); ErrorsList = studentSubjectMVM.CurrentValidation.Errors.Select(x => new ErrorMessage() { Message = x }).ToList(); SubjectsByStudentList = studentSubjectMVM.StudentBySubjects(studentSubjectMVM.StudentId); GetSubjectsToStudent(); } }
public void DelSubjectToListVM() //MEU OK Funciona { StudentSubject studentSubjectMVM = new StudentSubject(); studentSubjectMVM = CurrentStudentSubjectMVM; studentSubjectMVM.Delete(); SubjectsByStudentList = studentSubjectMVM.StudentBySubjects(studentSubjectMVM.StudentId); GetSubjectsToStudent(); }
private void DelSubjectToListVM() { StudentSubject studentSubjectMVM = new StudentSubject(); if (CurrentStudentSubject == null) { MessageBox.Show("Se tiene que seleccionar una asignatura del estudiante antes de eliminarla"); } else { MessageBox.Show("La assignatura del estudiante se ha eliminado correctamente"); studentSubjectMVM = CurrentStudentSubject; studentSubjectMVM.Delete(); SubjectsByStudentList = studentSubjectMVM.StudentBySubjects(studentSubjectMVM.StudentId); } }