view Agendas/trunk/src/Agendas.Domain/EventoPropuestoState.cs @ 118:b74734a1a755

Manejo de eventos por estado
author Nelo@Kenia.neluz.int
date Wed, 22 Jun 2011 09:32:59 -0300
parents 53bcd338542b
children 6f1041301797
line wrap: on
line source

using System;
using AltNetHispano.Agendas.Domain.Exceptions;

namespace AltNetHispano.Agendas.Domain
{
  public class EventoPropuestoState : EventoState
  {
    private EventoPropuestoState()
    {
    }

    private static readonly EventoState _instance = new EventoPropuestoState();
    public static EventoState GetInstance()
    {
      return _instance;
    }

    private const string Descripcion = "Propuesto";

    public override void Promover(Evento evento, Accion accion)
    {
      switch (accion)
      {
        case Accion.Agendar:
          evento.SetEstado(EventoAgendadoState.GetInstance());
          evento.AddTrack(new Track(evento, Accion.Agendar));
          break;
        default:
          throw new AccionNoSoportadaException(this.GetType(), accion);
      }
    }

    public override string GetDescripcion()
    {
      return Descripcion;
    }

  	public override bool PuedePromover(Accion accion)
  	{
  		return accion == Accion.Agendar;
  	}
  }
}