# HG changeset patch # User juanjose.montesdeocaarbos # Date 1312592543 10800 # Node ID 557c386fcecc70db5d1cfc08978e6bcc4cd71ce2 # Parent c1062de9684593489d3a1fe7edd00ddd56a23ea2 Ticket 153: UI de Publicar. diff -r c1062de96845 -r 557c386fcecc Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.Designer.cs --- a/Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.Designer.cs Fri Aug 05 21:54:43 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.Designer.cs Fri Aug 05 22:02:23 2011 -0300 @@ -61,6 +61,24 @@ } /// + /// Busca una cadena traducida similar a Duración. + /// + public static string DuracionReal { + get { + return ResourceManager.GetString("DuracionReal", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Tiempo que duró la presentación.. + /// + public static string DuracionRealDescription { + get { + return ResourceManager.GetString("DuracionRealDescription", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Correo electrónico. /// public static string EMail { @@ -97,6 +115,24 @@ } /// + /// Busca una cadena traducida similar a Nro. de Orden. + /// + public static string NroOrden { + get { + return ResourceManager.GetString("NroOrden", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Un número consecutivo que identifica al evento en el tiempo.. + /// + public static string NroOrdenDescription { + get { + return ResourceManager.GetString("NroOrdenDescription", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Seleccione el ponente o responsable del evento. /// public static string PonenteDescription { @@ -194,5 +230,23 @@ return ResourceManager.GetString("UrlInvitacionUrl", resourceCulture); } } + + /// + /// Busca una cadena traducida similar a Url de la Wiki. + /// + public static string UrlWiki { + get { + return ResourceManager.GetString("UrlWiki", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a La url donde se publica la presentación.. + /// + public static string UrlWikiDescription { + get { + return ResourceManager.GetString("UrlWikiDescription", resourceCulture); + } + } } } diff -r c1062de96845 -r 557c386fcecc Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.resx --- a/Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.resx Fri Aug 05 21:54:43 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.resx Fri Aug 05 22:02:23 2011 -0300 @@ -117,6 +117,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Duración + + + Tiempo que duró la presentación. + Correo electrónico @@ -129,6 +135,12 @@ Nombre de la persona que identifica a esta persona entre todas + + Nro. de Orden + + + Un número consecutivo que identifica al evento en el tiempo. + Seleccione el ponente o responsable del evento @@ -162,4 +174,10 @@ la url ingresada no es válida + + Url de la Wiki + + + La url donde se publica la presentación. + \ No newline at end of file diff -r c1062de96845 -r 557c386fcecc Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj --- a/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Fri Aug 05 21:54:43 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Fri Aug 05 22:02:23 2011 -0300 @@ -220,6 +220,7 @@ + diff -r c1062de96845 -r 557c386fcecc Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs --- a/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Fri Aug 05 21:54:43 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Fri Aug 05 22:02:23 2011 -0300 @@ -77,10 +77,36 @@ public ActionResult Publicar(string id) { var agenda = AgendaFactory.GetAgenda(); - agenda.Publicar(new Guid(id), 0, string.Empty); + var evento = agenda.GetEvento(new Guid(id)); + + var model = new EventoPublicarModel + { + Id = id, + Titulo = evento.Titulo, + NroOrden = 0, //TODO: Obtener el último y sumarle uno. + UrlWiki = evento.UrlWiki, + DuracionReal = new TimeSpan(0, 0, 0) + }; + return View(model); + } - this.AddNotification("Evento publicado"); - return RedirectToAction("Index"); + [HttpPost] + [Authorize] + public ActionResult Publicar(EventoPublicarModel model) + { + if (ModelState.IsValid) + { + var agenda = AgendaFactory.GetAgenda(); + + var r = agenda.Publicar(new Guid(model.Id), model.NroOrden, model.UrlWiki); + if (r.Succeful) + { + this.AddNotification(string.Format("Evento publicado {0}", model.Titulo)); + return RedirectToAction("Index"); + } + ModelState.AddModelError("error", r.ToString()); + } + return View(model); } [Authorize] diff -r c1062de96845 -r 557c386fcecc Agendas/trunk/src/Agendas.Web/Models/EventoModel.cs --- a/Agendas/trunk/src/Agendas.Web/Models/EventoModel.cs Fri Aug 05 21:54:43 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Models/EventoModel.cs Fri Aug 05 22:02:23 2011 -0300 @@ -65,6 +65,29 @@ public string UrlInvitacion { get; set; } } + public class EventoPublicarModel + { + [HiddenInput(DisplayValue = false)] + public string Id { get; set; } + + [Required] + [HiddenInput] + public string Titulo { get; set; } + + [Required] + [UIHint("NroOrden")] + [Range(1, short.MaxValue)] + public short NroOrden { get; set; } + + [Required] + [Url] + public string UrlWiki { get; set; } + + [Required] + [UIHint("DuracionReal")] + public TimeSpan DuracionReal { get; set; } + } + public class EventoDto { public string Id { get; set; } diff -r c1062de96845 -r 557c386fcecc Agendas/trunk/src/Agendas.Web/Views/Evento/Publicar.cshtml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Web/Views/Evento/Publicar.cshtml Fri Aug 05 22:02:23 2011 -0300 @@ -0,0 +1,28 @@ +@model AltNetHispano.Agendas.Web.Models.EventoPublicarModel +

Agenda

+

+ Modifique los datos que desea corregir y presione guardar +

+ + + + + + +@using (Html.BeginForm()) +{ + @Html.ValidationSummary(true, "Los datos ingresados no son validos, por favor verifíquelos") +
+
+ Datos del evento: + @Html.EditorForModel() +

+ +

+
+
+} \ No newline at end of file