public void MarkStringToDoubleS() { ValidationResult <double> vrmark; if (!(vrmark = StudentExam.ValidateMark(this.MarkTextS)).IsSuccess) { MessageBox.Show(vrmark.AllErrors); } if (CurrentStudentExamSEVM != null) { if (!(vrmark = StudentExam.ValidateMark(this.MarkTextS, CurrentStudentExamSEVM.Id)).IsSuccess) { MessageBox.Show(vrmark.AllErrors); } } if (!vrmark.IsSuccess) { CurrentStudentSEVM = null; CurrentExamS = null; DniS = ""; NameS = ""; MarkTextS = ""; HasCheatedSEVM = false; } else { if (CurrentStudentExamSEVM == null) { MarkSEVM = vrmark.ValidatedResult; } else { examToUpdate = CurrentStudentExamSEVM.Clone(); examToUpdate.Mark = vrmark.ValidatedResult; } } }
public void MarkStringToDouble() { StudentExam studentExam = new StudentExam(); var markVR = studentExam.ValidateMark(MarkTextSEVM); if (!markVR.IsSuccess) { ErrorsList = markVR.Errors.Select(x => new ErrorMessage() { Message = x }).ToList(); CurrentStudentSEVM = null; CurrentExamSEVM = null; DniSEVM = ""; NameSEVM = ""; MarkTextSEVM = ""; HasCheatedSEVM = false; } else { MarkSEVM = markVR.ValidatedResult; } }