view Agendas/trunk/src/Agendas.Blog/Impl/PublicarReunionPostWriter.cs @ 302:11dddcc9a862 tip

Historico de Eventos, no muestra bien la Url del Patrocinador.
author juanjose.montesdeocaarbos
date Tue, 14 Aug 2012 21:54:30 -0300
parents 80c22175c9b5
children
line wrap: on
line source

using System;
using System.Globalization;
using Agendas.Blog.Exceptions;
using Agendas.Blog.Properties;
using AltNetHispano.Agendas.Domain;

namespace Agendas.Blog.Impl
{
  public class PublicarReunionPostWriter : PostWriter
  {
    public PublicarReunionPostWriter(IPostWriterWebService postWriterWebService) : base(postWriterWebService)
    {
    }

    protected override string GetTitle(Track track)
    {
      string resourceName = getTitleResourceName(track);

      return string.Format(CultureInfo.InvariantCulture, resourceName,
                           track.Evento.NumeroOrden, //# de VAN en el historial
                           track.Evento.Titulo //Titulo del evento

        );
    }

    private string getTitleResourceName(Track track)
    {
      string resourceName;
      if (track.Evento.Tipo == TipoEvento.Van)
        resourceName = Resources.VAN_Publicar_Title;
      else if (track.Evento.Tipo == TipoEvento.Cafe)
        resourceName = Resources.Cafe_Publicar_Title;
      else
        throw new TipoEventoNoSoportadoException(track.Evento.Tipo.ToString());

      return resourceName;
    }

    protected override string GetBody(Track track)
    {
      string resourceName = getBodyResourceName(track);

      return string.Format(CultureInfo.InvariantCulture, resourceName,
													 track.Evento.UrlWiki, //Url al video publicado en la wiki
                           GetNombreUsuario(track) //Usuario que postea en el blog
        );
    }

    private string getBodyResourceName(Track track)
    {
      string resourceName;
      if (track.Evento.Tipo == TipoEvento.Van)
        resourceName = Resources.VAN_Publicar_Body;
      else if (track.Evento.Tipo == TipoEvento.Cafe)
        resourceName = Resources.Cafe_Publicar_Body;
      else
        throw new TipoEventoNoSoportadoException(track.Evento.Tipo.ToString());

      return resourceName;
    }
  }
}