annotate 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
rev   line source
101
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
1 using AltNetHispano.Agendas.Domain.Exceptions;
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
2
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
3 namespace AltNetHispano.Agendas.Domain
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
4 {
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
5 public class EventoPropuestoState : EventoState
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
6 {
103
23325dddddcc Persistencia del estado de los eventos
jorge.rowies
parents: 101
diff changeset
7 public const string Descripcion = "Propuesto";
101
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
8
103
23325dddddcc Persistencia del estado de los eventos
jorge.rowies
parents: 101
diff changeset
9 public override void Promover(Evento evento, Accion accion)
101
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
10 {
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
11 switch (accion)
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
12 {
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
13 case Accion.Agendar:
103
23325dddddcc Persistencia del estado de los eventos
jorge.rowies
parents: 101
diff changeset
14 evento.SetEstado(new EventoAgendadoState());
23325dddddcc Persistencia del estado de los eventos
jorge.rowies
parents: 101
diff changeset
15 evento.AddTrack(new Track(evento, Accion.Agendar));
101
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
16 break;
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
17 default:
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
18 throw new AccionNoSoportadaException(this.GetType(), accion);
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
19 }
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
20 }
103
23325dddddcc Persistencia del estado de los eventos
jorge.rowies
parents: 101
diff changeset
21
23325dddddcc Persistencia del estado de los eventos
jorge.rowies
parents: 101
diff changeset
22 public override string GetDescripcion()
23325dddddcc Persistencia del estado de los eventos
jorge.rowies
parents: 101
diff changeset
23 {
23325dddddcc Persistencia del estado de los eventos
jorge.rowies
parents: 101
diff changeset
24 return Descripcion;
23325dddddcc Persistencia del estado de los eventos
jorge.rowies
parents: 101
diff changeset
25 }
101
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
26 }
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
27 }