Mercurial > altnet-hispano
comparison Agendas/trunk/src/Agendas.Domain/Services/PersonaService.cs @ 157:f17252543cbf
Agregando la url del blog a los datos de la persona
author | Nelo@Guinea.neluz.int |
---|---|
date | Thu, 04 Aug 2011 18:45:18 -0300 |
parents | 5a1f7233aa5a |
children | 33e57fd1a6c9 |
comparison
equal
deleted
inserted
replaced
156:6e554de521aa | 157:f17252543cbf |
---|---|
61 public Persona GetById(Guid id) | 61 public Persona GetById(Guid id) |
62 { | 62 { |
63 return _personaRepository.Get(id); | 63 return _personaRepository.Get(id); |
64 } | 64 } |
65 | 65 |
66 public Resultado Add(string nombre, string twitter, string mail) | 66 public Resultado Add(string nombre, string twitter, string mail, string blog) |
67 { | 67 { |
68 var persona = new Persona(nombre) {Twitter = twitter, Mail = mail}; | 68 var persona = new Persona(nombre) {Twitter = twitter, Mail = mail, Blog = blog}; |
69 _personaRepository.Save(persona); | 69 _personaRepository.Save(persona); |
70 | 70 |
71 return new Resultado(true); | 71 return new Resultado(true); |
72 } | 72 } |
73 | 73 |
74 public Resultado Update(Guid id, string nombre, string twitter, string mail) | 74 public Resultado Update(Guid id, string nombre, string twitter, string mail, string blog) |
75 { | 75 { |
76 var persona = _personaRepository.Get(id); | 76 var persona = _personaRepository.Get(id); |
77 if (persona == null) | 77 if (persona == null) |
78 return new Resultado(false) | 78 return new Resultado(false) |
79 {Message = string.Format("No se pudo encontrar la persona cuyo Id sea {0}", id)}; | 79 {Message = string.Format("No se pudo encontrar la persona cuyo Id sea {0}", id)}; |
80 | 80 |
81 persona.Nombre = nombre; | 81 persona.Nombre = nombre; |
82 persona.Twitter = twitter; | 82 persona.Twitter = twitter; |
83 persona.Mail = mail; | 83 persona.Mail = mail; |
84 persona.Blog = blog; | |
85 | |
86 //TODO: ¿que hacemos con la cuenta de twitter asociada? | |
84 | 87 |
85 return new Resultado(true); | 88 return new Resultado(true); |
86 } | 89 } |
87 } | 90 } |
88 } | 91 } |