(() => agenda.Publicar(evento.Id, 1, " "));
+ }
+ }
}
\ No newline at end of file
diff -r 93aa103f75ec -r 56f62516c172 Agendas/trunk/src/Agendas.Tests/Workflows/Workflow.cs
--- a/Agendas/trunk/src/Agendas.Tests/Workflows/Workflow.cs Fri Aug 05 21:55:45 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Tests/Workflows/Workflow.cs Fri Aug 05 22:05:19 2011 -0300
@@ -36,7 +36,7 @@
public void Publicar(Guid eventoId)
{
- var resultado = _agenda.Publicar(eventoId, 0, string.Empty);
+ var resultado = _agenda.Publicar(eventoId, 1, "http://www.altnethispano.org/");
Assert.IsTrue(resultado.Succeful);
}
diff -r 93aa103f75ec -r 56f62516c172 Agendas/trunk/src/Agendas.Tests/Workflows/WorkflowTests.cs
--- a/Agendas/trunk/src/Agendas.Tests/Workflows/WorkflowTests.cs Fri Aug 05 21:55:45 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Tests/Workflows/WorkflowTests.cs Fri Aug 05 22:05:19 2011 -0300
@@ -170,6 +170,8 @@
[Test]
public void Proponer_agendar_confirmar_publicar()
{
+ const string urlWiki = "http://www.altnethispano.org/wiki/van-2010-10-21-mono-cecil.ashx";
+
_workflow.Proponer();
_workflow.Agendar();
diff -r 93aa103f75ec -r 56f62516c172 Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj
--- a/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Fri Aug 05 21:55:45 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Fri Aug 05 22:05:19 2011 -0300
@@ -220,6 +220,7 @@
+
diff -r 93aa103f75ec -r 56f62516c172 Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs
--- a/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Fri Aug 05 21:55:45 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Fri Aug 05 22:05:19 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 93aa103f75ec -r 56f62516c172 Agendas/trunk/src/Agendas.Web/Controllers/HistoricoController.cs
--- a/Agendas/trunk/src/Agendas.Web/Controllers/HistoricoController.cs Fri Aug 05 21:55:45 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Controllers/HistoricoController.cs Fri Aug 05 22:05:19 2011 -0300
@@ -24,7 +24,7 @@
Ponente = e.Ponente.Nombre,
Numero = e.NumeroOrden.ToString(),
Tipo = e.Tipo.ToString(),
- Duracion = "0:00"
+ Duracion = "0:00" //TODO: e.GetEvento()
}
};
return View(model);
diff -r 93aa103f75ec -r 56f62516c172 Agendas/trunk/src/Agendas.Web/Models/EventoModel.cs
--- a/Agendas/trunk/src/Agendas.Web/Models/EventoModel.cs Fri Aug 05 21:55:45 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Models/EventoModel.cs Fri Aug 05 22:05:19 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 93aa103f75ec -r 56f62516c172 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:05:19 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")
+
+
+
+}
\ No newline at end of file