Mercurial > altnet-hispano
comparison Agendas/trunk/src/Agendas.Domain/EventoNullState.cs @ 103:23325dddddcc
Persistencia del estado de los eventos
author | jorge.rowies |
---|---|
date | Sun, 05 Jun 2011 13:06:23 -0300 |
parents | 9bfdd5bf3ad2 |
children | c5034884c7d7 |
comparison
equal
deleted
inserted
replaced
102:92c5a12015f3 | 103:23325dddddcc |
---|---|
2 | 2 |
3 namespace AltNetHispano.Agendas.Domain | 3 namespace AltNetHispano.Agendas.Domain |
4 { | 4 { |
5 public class EventoNullState : EventoState | 5 public class EventoNullState : EventoState |
6 { | 6 { |
7 private readonly Evento _evento; | 7 public override void Promover(Evento evento, Accion accion) |
8 | |
9 public EventoNullState(Evento evento) | |
10 { | |
11 _evento = evento; | |
12 } | |
13 | |
14 public override void Promover(Accion accion) | |
15 { | 8 { |
16 switch (accion) | 9 switch (accion) |
17 { | 10 { |
18 case Accion.Proponer: | 11 case Accion.Proponer: |
19 _evento.Estado = new EventoPropuestoState(_evento); | 12 evento.SetEstado(new EventoPropuestoState()); |
13 evento.AddTrack(new Track(evento, Accion.Proponer)); | |
20 break; | 14 break; |
21 case Accion.Agendar: | 15 case Accion.Agendar: |
22 _evento.Estado = new EventoAgendadoState(_evento); | 16 evento.SetEstado(new EventoAgendadoState()); |
17 evento.AddTrack(new Track(evento, Accion.Agendar)); | |
23 break; | 18 break; |
24 default: | 19 default: |
25 throw new AccionNoSoportadaException(this.GetType(), accion); | 20 throw new AccionNoSoportadaException(this.GetType(), accion); |
26 } | 21 } |
27 } | 22 } |
23 | |
24 public override string GetDescripcion() | |
25 { | |
26 return "NullState"; | |
27 } | |
28 } | 28 } |
29 } | 29 } |