Mercurial > altnet-hispano
comparison Agendas/trunk/src/Agendas.Domain/EventoPropuestoState.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 EventoPropuestoState : EventoState | 5 public class EventoPropuestoState : EventoState |
6 { | 6 { |
7 private readonly Evento _evento; | 7 public const string Descripcion = "Propuesto"; |
8 | 8 |
9 public EventoPropuestoState(Evento evento) | 9 public override void Promover(Evento evento, Accion accion) |
10 { | |
11 _evento = evento; | |
12 _evento.AddTrack(new Track(_evento, Accion.Proponer)); | |
13 } | |
14 | |
15 public override void Promover(Accion accion) | |
16 { | 10 { |
17 switch (accion) | 11 switch (accion) |
18 { | 12 { |
19 case Accion.Agendar: | 13 case Accion.Agendar: |
20 _evento.Estado = new EventoAgendadoState(_evento); | 14 evento.SetEstado(new EventoAgendadoState()); |
15 evento.AddTrack(new Track(evento, Accion.Agendar)); | |
21 break; | 16 break; |
22 default: | 17 default: |
23 throw new AccionNoSoportadaException(this.GetType(), accion); | 18 throw new AccionNoSoportadaException(this.GetType(), accion); |
24 } | 19 } |
25 } | 20 } |
21 | |
22 public override string GetDescripcion() | |
23 { | |
24 return Descripcion; | |
25 } | |
26 } | 26 } |
27 } | 27 } |