public DetalhesViewModel(InteresseMOD interesse, IEnumerable <string> racas) { Id = interesse.Id.ToString(); Raca = interesse.Raca; Especie = interesse.Especie; PortePequeno = interesse.Porte.Contains(AnimalPorte.Pequeno) ? true : false; PorteMedio = interesse.Porte.Contains(AnimalPorte.Médio) ? true : false; PorteGrande = interesse.Porte.Contains(AnimalPorte.Grande) ? true : false; Vacinado = interesse.EhVacinado; Castrado = interesse.EhCastrado; Vermifugo = interesse.TomouVermifugo; IdadeMin = interesse.IdadeMinimaEmAnos; IdadeMax = interesse.IdadeMaximaEmAnos; Racas = new SelectList(racas); }
public InteresseViewModel(InteresseMOD interesse) { Id = interesse.Id.ToString(); Especie = interesse.Especie.ToString(); Raca = interesse.Raca; IdadeMin = interesse.IdadeMinimaEmAnos.ToString(); IdadeMax = interesse.IdadeMaximaEmAnos.ToString(); PortePequeno = interesse.Porte.Contains(AnimalPorte.Pequeno) ? "Sim" : "Não"; PorteMedio = interesse.Porte.Contains(AnimalPorte.Médio) ? "Sim" : "Não"; PorteGrande = interesse.Porte.Contains(AnimalPorte.Grande) ? "Sim" : "Não"; Vacinado = interesse.EhVacinado ? "Sim" : "Não"; Castrado = interesse.EhCastrado ? "Sim" : "Não"; Vermifugo = interesse.TomouVermifugo ? "Sim" : "Não"; //interesse.Porte = adicionaPortes(); }
public InteresseMOD ConverterParaInteresse() { var interesse = new InteresseMOD(); interesse.Id = string.IsNullOrWhiteSpace(Id) ? ObjectId.GenerateNewId() : ObjectId.Parse(Id); interesse.Raca = Raca; interesse.Especie = Especie.Value; interesse.EhVacinado = Vacinado; interesse.EhCastrado = Castrado; interesse.TomouVermifugo = Vermifugo; interesse.Porte = AdicionarPortes(); interesse.IdadeMinimaEmAnos = IdadeMin; interesse.IdadeMaximaEmAnos = IdadeMax; return(interesse); }
public Task CadastrarInteresse(ObjectId userId, InteresseMOD interesse) { throw new NotImplementedException(); }
public ExclusaoViewModel(InteresseMOD interesse) { Id = interesse.Id.ToString(); Raca = interesse.Raca; }