private void ValidarFichajeDeNuevoJugador(JugadorBaseVM vm) { if (Context.Jugadores.Any(x => x.DNI == vm.DNI)) { ModelState.AddModelError("", "Ya hay un jugador fichado con el mismo DNI."); } }
public ImagenesJugadoresDiskPersistenceTest() { _paths = new AppPathsForTest(); _imagenesJugadoresDiskPersistence = new ImagenesJugadoresDiskPersistence(_paths); _imagePath = $"{_paths.ImagenesJugadoresAbsolute}/{DNI}.jpg"; _jugadorBaseVm = new JugadorBaseVM { Foto = Constantes.puntoRojoBase64ConUriDataJpg, DNI = DNI }; }
public void GuardarFotoWebCam(JugadorBaseVM vm) { var foto = ImagenUtility.ConvertirABitMapYATamanio240X240YEspejar(vm.Foto); var imagePath = $"{Paths.ImagenesJugadoresAbsolute}/{vm.DNI}.jpg"; if (File.Exists(imagePath)) { File.Delete(imagePath); } Directory.CreateDirectory(Paths.ImagenesJugadoresAbsolute); foto.Save(imagePath); }