view Agendas/trunk/src/Agendas.Blog/Impl/RealizarReunionPostWriter.cs @ 66:a61f3204c9f7

Merge
author jorge.rowies
date Tue, 17 May 2011 18:25:17 -0300
parents ebce59b45b50
children c7264bfc4b71
line wrap: on
line source

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

namespace Agendas.Blog.Impl
{
  public class RealizarReunionPostWriter : PostWriter
  {
    protected override string GetTitle(Evento evento)
    {
      return string.Format(CultureInfo.InvariantCulture, Resources.VAN_Realizacion_Title,
                           evento.Ponente.Nombre, //Nombre y apellido del ponente
                           evento.Titulo //Tema a tratar en la reunion
        );
    }

    protected override string GetBody(Evento evento)
    {
      var fecha = getFechaFormateada(evento.Fecha);
      return string.Format(CultureInfo.InvariantCulture, Resources.VAN_Realizacion_Body,
                           fecha, //Fecha y hora en GMT+0
                           evento.Ponente.Nombre, //Nombre y apellido del ponente
                           evento.Titulo, //Tema a tratar en la reunion
                           getUrlThreadListaCorreo(evento), //Url al thread en la lista de correo
                           GetNombreUsuario(evento) //Usuario que postea en el blog
        );
    }

    private string getFechaFormateada(DateTime? fecha)
    {
      if (fecha == null)
        throw new ArgumentNullException("fecha");

      var fechaCast = (DateTime)fecha;
      var culture = CultureInfo.CreateSpecificCulture("es-ES");
      var result = fechaCast.ToString("D", culture) + " a las " +
                     fechaCast.ToString("t", culture) + " UTC/GMT";

      return result;
    }

    private string getUrlThreadListaCorreo(Evento evento)
    {
      return string.Format(CultureInfo.InvariantCulture, Resources.VAN_Realizacion_Body_UrlListaCorreo,
                           string.Empty /*evento.UrlListaCorreo*/);//TODO
    }
  }
}