# HG changeset patch # User jorge.rowies # Date 1306258823 10800 # Node ID a300394dbabec2832ebefc188f0a1d80dcf5328b # Parent 926bd1cdb98f955b763a582d2a89913362f7d785 cambios minimos en el publicador del blog por la reestructuracion de estados de los eventos diff -r 926bd1cdb98f -r a300394dbabe Agendas/trunk/src/Agendas.Blog/Agendas.Blog.csproj --- a/Agendas/trunk/src/Agendas.Blog/Agendas.Blog.csproj Mon May 23 20:51:36 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/Agendas.Blog.csproj Tue May 24 14:40:23 2011 -0300 @@ -53,7 +53,7 @@ Resources.resx - + diff -r 926bd1cdb98f -r a300394dbabe Agendas/trunk/src/Agendas.Blog/Impl/AgendarReunionPostWriter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Impl/AgendarReunionPostWriter.cs Tue May 24 14:40:23 2011 -0300 @@ -0,0 +1,55 @@ +using System; +using System.Globalization; +using Agendas.Blog.Properties; +using AltNetHispano.Agendas.Domain; +using System.Linq; + +namespace Agendas.Blog.Impl +{ + public class AgendarReunionPostWriter : 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 + getUrlInvitacion(evento), //Url a la invitacion realizada por el ponente (por lo general es el 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 getUrlInvitacion(Evento evento) + { + if (!string.IsNullOrEmpty(evento.UrlInvitacion)) + { + return string.Format(CultureInfo.InvariantCulture, Resources.VAN_Realizacion_Body_UrlListaCorreo, + evento.UrlInvitacion); + } + + return string.Empty; + } + } +} \ No newline at end of file diff -r 926bd1cdb98f -r a300394dbabe Agendas/trunk/src/Agendas.Blog/Impl/PostWriterFactory.cs --- a/Agendas/trunk/src/Agendas.Blog/Impl/PostWriterFactory.cs Mon May 23 20:51:36 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/Impl/PostWriterFactory.cs Tue May 24 14:40:23 2011 -0300 @@ -8,9 +8,9 @@ { switch (accion) { + case Accion.Agendar: + return new AgendarReunionPostWriter(); case Accion.Publicar: - return new RealizarReunionPostWriter(); - case Accion.Agendar: return new PublicarReunionPostWriter(); default: return new NullObjectPostWriter(); diff -r 926bd1cdb98f -r a300394dbabe Agendas/trunk/src/Agendas.Blog/Impl/RealizarReunionPostWriter.cs --- a/Agendas/trunk/src/Agendas.Blog/Impl/RealizarReunionPostWriter.cs Mon May 23 20:51:36 2011 -0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -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 - getUrlInvitacion(evento), //Url a la invitacion realizada por el ponente (por lo general es el 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 getUrlInvitacion(Evento evento) - { - if (!string.IsNullOrEmpty(evento.UrlInvitacion)) - { - return string.Format(CultureInfo.InvariantCulture, Resources.VAN_Realizacion_Body_UrlListaCorreo, - evento.UrlInvitacion); - } - - return string.Empty; - } - } -} \ No newline at end of file