view Agendas/trunk/src/Agendas.Blog/Impl/PublicarReunionPostWriter.cs @ 120:c3573defd18f

Agregado de Fecha, Usuario y Successful en TrackLog Modificacion de publicador de blog para usar TrackLog Agregado de TrackLog en el test de crud de eventos Fix en publicador de twitter para que no twitee si ya se encuentra en TrackLog pero con Successful en true
author Jorge@Jorge-PC
date Fri, 24 Jun 2011 21:18:21 -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;
    }
  }
}