diff Agendas/trunk/src/Agendas.Blog/Impl/RealizarReunionPostWriter.cs @ 65:ebce59b45b50

Agregado de version inicial del publicador para el blog
author ROWIES@ardejorxp.inworx.corp
date Tue, 17 May 2011 18:04:56 -0300
parents
children c7264bfc4b71
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Agendas/trunk/src/Agendas.Blog/Impl/RealizarReunionPostWriter.cs	Tue May 17 18:04:56 2011 -0300
@@ -0,0 +1,50 @@
+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
+    }
+  }
+}
\ No newline at end of file