comparison Agendas/trunk/src/Agendas.Domain/Agenda.cs @ 225:f23ee59ef1bd

Otros ponentes
author nelopauselli
date Mon, 26 Sep 2011 08:47:01 -0300
parents 8a8c35302b81
children e5959f3405e0
comparison
equal deleted inserted replaced
224:de6d206bd5c3 225:f23ee59ef1bd
91 91
92 return new EventoResultado(true,"Evento propuesto", warnings); 92 return new EventoResultado(true,"Evento propuesto", warnings);
93 } 93 }
94 94
95 public EventoResultado Agendar(string titulo, Guid ponenteId, DateTime? fechaInicio, DateTime? fechaTermino, string urlInvitacion, TipoEvento tipo) 95 public EventoResultado Agendar(string titulo, Guid ponenteId, DateTime? fechaInicio, DateTime? fechaTermino, string urlInvitacion, TipoEvento tipo)
96 {
97 return Agendar(titulo, ponenteId, fechaInicio, fechaTermino, urlInvitacion, tipo, null);
98 }
99
100 public EventoResultado Agendar(string titulo, Guid ponenteId, DateTime? fechaInicio, DateTime? fechaTermino, string urlInvitacion, TipoEvento tipo, IEnumerable<Guid> colaboradoresId)
96 { 101 {
97 if (!fechaInicio.HasValue) 102 if (!fechaInicio.HasValue)
98 return new EventoResultado(false, "Debe indicar la fecha", null); 103 return new EventoResultado(false, "Debe indicar la fecha", null);
99 if (!fechaTermino.HasValue) 104 if (!fechaTermino.HasValue)
100 return new EventoResultado(false, "Debe indicar la hora y duración", null); 105 return new EventoResultado(false, "Debe indicar la hora y duración", null);
123 if (evento == null) 128 if (evento == null)
124 evento = Evento.Agendar(titulo, persona, fechaInicio.Value, fechaTermino.Value, urlInvitacion, tipo); 129 evento = Evento.Agendar(titulo, persona, fechaInicio.Value, fechaTermino.Value, urlInvitacion, tipo);
125 else 130 else
126 evento.Agendar(persona, fechaInicio, fechaTermino, urlInvitacion); 131 evento.Agendar(persona, fechaInicio, fechaTermino, urlInvitacion);
127 132
128 Notify(evento); 133 var colaboradores = new List<Persona>();
134 if (colaboradoresId!=null)
135 {
136 foreach (var colaboradorId in colaboradoresId)
137 {
138 var colaborador = _personaRepository.Get(colaboradorId);
139 if (colaborador == null)
140 return new EventoResultado(false, string.Format("No se encontró el colaborador indicado ({0})", colaboradorId),
141 null);
142 colaboradores.Add(colaborador);
143 }
144 evento.ActualizarOtrosPonentes(colaboradores);
145 }
146
147 Notify(evento);
129 148
130 _eventosRepository.Save(evento); 149 _eventosRepository.Save(evento);
131 150
132 var warnings = evento.GetLogsNews().Where(l => !l.Successful); 151 var warnings = evento.GetLogsNews().Where(l => !l.Successful);
133 152