Mercurial > altnet-hispano
changeset 25:e8d2be47a6b0
Cambios de nombre en Portal.Web (Agenda x Evento)
author | nelo@MTEySS.neluz.int |
---|---|
date | Tue, 15 Mar 2011 08:24:18 -0300 |
parents | 41b283d27e3e |
children | 71b02443450a |
files | Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Agendas/trunk/src/Agendas.Web/Controllers/AgendaController.cs Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Agendas/trunk/src/Agendas.Web/Models/AgendaModel.cs Agendas/trunk/src/Agendas.Web/Views/Agenda/Edit.cshtml Agendas/trunk/src/Agendas.Web/Views/Agenda/Index.cshtml Agendas/trunk/src/Agendas.Web/Views/Agenda/New.cshtml Agendas/trunk/src/Agendas.Web/Views/Evento/Edit.cshtml Agendas/trunk/src/Agendas.Web/Views/Evento/Index.cshtml Agendas/trunk/src/Agendas.Web/Views/Evento/New.cshtml Agendas/trunk/src/Agendas.Web/Views/Shared/_Layout.cshtml |
diffstat | 11 files changed, 204 insertions(+), 204 deletions(-) [+] |
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Tue Mar 15 07:49:53 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Tue Mar 15 08:24:18 2011 -0300 @@ -58,7 +58,7 @@ </ItemGroup> <ItemGroup> <Compile Include="Controllers\AccountController.cs" /> - <Compile Include="Controllers\AgendaController.cs" /> + <Compile Include="Controllers\EventoController.cs" /> <Compile Include="Controllers\HomeController.cs" /> <Compile Include="Global.asax.cs"> <DependentUpon>Global.asax</DependentUpon> @@ -128,10 +128,10 @@ <Folder Include="App_Data\" /> </ItemGroup> <ItemGroup> - <Content Include="Views\Agenda\Index.cshtml" /> + <Content Include="Views\Evento\Index.cshtml" /> </ItemGroup> <ItemGroup> - <Content Include="Views\Agenda\New.cshtml" /> + <Content Include="Views\Evento\New.cshtml" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Agendas.Domain\Agendas.Domain.csproj"> @@ -144,7 +144,7 @@ </ProjectReference> </ItemGroup> <ItemGroup> - <Content Include="Views\Agenda\Edit.cshtml" /> + <Content Include="Views\Evento\Edit.cshtml" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
--- a/Agendas/trunk/src/Agendas.Web/Controllers/AgendaController.cs Tue Mar 15 07:49:53 2011 -0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -using System; -using System.Linq; -using System.Web.Mvc; -using Agendas.Factories; -using Agendas.Web.Models; -using AltNetHispano.Agendas.Domain.Exceptions; - -namespace Agendas.Web.Controllers -{ - public class AgendaController : Controller - { - public ActionResult Index() - { - var model = GetIndexModel(); - return View(model); - } - - private static AgendaIndexModel GetIndexModel() - { - var agenda = AgendaFactory.GetAgenda(); - - return new AgendaIndexModel - { - ProximosEventos = from e in agenda.GetEventosPublicados() - select new EventoDto {Id = e.Id.ToString(), Titulo = e.Titulo} - }; - } - - [Authorize] - public ActionResult New() - { - return View(); - } - - [HttpPost] - [Authorize] - public ActionResult New(AgendaNewModel model) - { - if (ModelState.IsValid) - { - var agenda = AgendaFactory.GetAgenda(); - - try - { - agenda.Publicar(model.Titulo, model.Ponente, model.Fecha); - - return View("Index", GetIndexModel()); - } - catch (ValidationException ex) - { - ModelState.AddModelError("error", ex.ToString()); - } - } - return View(model); - } - - [Authorize] - public ActionResult Edit(string id) - { - var agenda = AgendaFactory.GetAgenda(); - var evento = agenda.GetEventoPublicado(new Guid(id)); - if (evento!=null) - { - var model = new AgendaEditModel - { - Id = id, - Titulo = evento.Titulo, - Ponente = evento.Ponente != null ? evento.Ponente.Nombre : string.Empty, - Fecha = evento.Fecha - }; - return View(model); - } - ModelState.AddModelError("error","No se encontró el evento que quiere modificar"); - return View(); - } - - [HttpPost] - [Authorize] - public ActionResult Edit(AgendaEditModel model) - { - if (ModelState.IsValid) - { - var agenda = AgendaFactory.GetAgenda(); - - try - { - agenda.ModificarEvento(new Guid(model.Id), model.Titulo, model.Ponente, model.Fecha); - - return View("Index", GetIndexModel()); - } - catch (ValidationException ex) - { - ModelState.AddModelError("error", ex.ToString()); - } - } - return View(model); - } - } -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Tue Mar 15 08:24:18 2011 -0300 @@ -0,0 +1,99 @@ +using System; +using System.Linq; +using System.Web.Mvc; +using Agendas.Factories; +using Agendas.Web.Models; +using AltNetHispano.Agendas.Domain.Exceptions; + +namespace Agendas.Web.Controllers +{ + public class EventoController : Controller + { + public ActionResult Index() + { + var model = GetIndexModel(); + return View(model); + } + + private static EventoIndexModel GetIndexModel() + { + var agenda = AgendaFactory.GetAgenda(); + + return new EventoIndexModel + { + ProximosEventos = from e in agenda.GetEventosPublicados() + select new EventoDto {Id = e.Id.ToString(), Titulo = e.Titulo} + }; + } + + [Authorize] + public ActionResult New() + { + return View(); + } + + [HttpPost] + [Authorize] + public ActionResult New(EventoNewModel model) + { + if (ModelState.IsValid) + { + var agenda = AgendaFactory.GetAgenda(); + + try + { + agenda.Publicar(model.Titulo, model.Ponente, model.Fecha); + + return View("Index", GetIndexModel()); + } + catch (ValidationException ex) + { + ModelState.AddModelError("error", ex.ToString()); + } + } + return View(model); + } + + [Authorize] + public ActionResult Edit(string id) + { + var agenda = AgendaFactory.GetAgenda(); + var evento = agenda.GetEventoPublicado(new Guid(id)); + if (evento!=null) + { + var model = new EventoEditModel + { + Id = id, + Titulo = evento.Titulo, + Ponente = evento.Ponente != null ? evento.Ponente.Nombre : string.Empty, + Fecha = evento.Fecha + }; + return View(model); + } + ModelState.AddModelError("error","No se encontró el evento que quiere modificar"); + return View(); + } + + [HttpPost] + [Authorize] + public ActionResult Edit(EventoEditModel model) + { + if (ModelState.IsValid) + { + var agenda = AgendaFactory.GetAgenda(); + + try + { + agenda.ModificarEvento(new Guid(model.Id), model.Titulo, model.Ponente, model.Fecha); + + return View("Index", GetIndexModel()); + } + catch (ValidationException ex) + { + ModelState.AddModelError("error", ex.ToString()); + } + } + return View(model); + } + } +}
--- a/Agendas/trunk/src/Agendas.Web/Models/AgendaModel.cs Tue Mar 15 07:49:53 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Models/AgendaModel.cs Tue Mar 15 08:24:18 2011 -0300 @@ -5,12 +5,12 @@ namespace Agendas.Web.Models { - public class AgendaIndexModel + public class EventoIndexModel { public IEnumerable<EventoDto> ProximosEventos { get; set; } } - public class AgendaNewModel + public class EventoNewModel { [Required(ErrorMessage = "debe ingresar el título")] public string Titulo { get; set; } @@ -22,7 +22,7 @@ public DateTime Fecha { get; set; } } - public class AgendaEditModel + public class EventoEditModel { [HiddenInput(DisplayValue = false)] public string Id { get; set; }
--- a/Agendas/trunk/src/Agendas.Web/Views/Agenda/Edit.cshtml Tue Mar 15 07:49:53 2011 -0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -@model Agendas.Web.Models.AgendaEditModel -@{ - ViewBag.Title = "Agenda"; -} - -<p> - Modifique los datos que desea corregir y presione guardar -</p> - -<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" /> -<script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script> - -<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> -<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> - -<script type="text/javascript"> - $(document).ready(function () { - $("#Fecha").datepicker({ dateFormat: 'dd-mm-yy' }); - }); -</script> - -@using (Html.BeginForm()) -{ - @Html.ValidationSummary(true, "Los datos ingresados no son validos, por favor verifíquelos") - <div> - <fieldset> - <legend>Datos del evento:</legend> - @Html.EditorForModel() - <p> - <input type="submit" value="Guardar" /> - </p> - </fieldset> - </div> -} \ No newline at end of file
--- a/Agendas/trunk/src/Agendas.Web/Views/Agenda/Index.cshtml Tue Mar 15 07:49:53 2011 -0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -@model Agendas.Web.Models.AgendaIndexModel -@{ - ViewBag.Title = "Agenda"; -} - -<p> - Los próximos eventos son: -</p> -<table> - <thead> - <tr> - <th>Evento</th> - <th>Acciones</th> - </tr> - </thead> - <tbody> - @foreach (var item in Model.ProximosEventos) - { - <tr> - <td>@item.Titulo</td> - <td>@Html.ActionLink("Modificar", "Edit", new { id = item.Id })</td> - </tr> - } - </tbody> -</table> - -<p> -@Html.ActionLink("Nuevo", "New") -</p>
--- a/Agendas/trunk/src/Agendas.Web/Views/Agenda/New.cshtml Tue Mar 15 07:49:53 2011 -0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -@model Agendas.Web.Models.AgendaNewModel -@{ - ViewBag.Title = "Agenda"; -} - -<p> - Complete los siguiente datos para agendar un nuevo evento -</p> - -<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" /> -<script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script> - -<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> -<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> - -<script type="text/javascript"> - $(document).ready(function () { - $("#Fecha").datepicker({ dateFormat: 'dd-mm-yy' }); - }); -</script> - -@using (Html.BeginForm()) -{ - @Html.ValidationSummary(true, "Los datos ingresados no son validos, por favor verifíquelos") - <div> - <fieldset> - <legend>Datos del evento:</legend> - @Html.EditorForModel() - <p> - <input type="submit" value="Guardar" /> - </p> - </fieldset> - </div> -} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Web/Views/Evento/Edit.cshtml Tue Mar 15 08:24:18 2011 -0300 @@ -0,0 +1,34 @@ +@model Agendas.Web.Models.EventoEditModel +@{ + ViewBag.Title = "Agenda"; +} + +<p> + Modifique los datos que desea corregir y presione guardar +</p> + +<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" /> +<script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script> + +<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> +<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> + +<script type="text/javascript"> + $(document).ready(function () { + $("#Fecha").datepicker({ dateFormat: 'dd-mm-yy' }); + }); +</script> + +@using (Html.BeginForm()) +{ + @Html.ValidationSummary(true, "Los datos ingresados no son validos, por favor verifíquelos") + <div> + <fieldset> + <legend>Datos del evento:</legend> + @Html.EditorForModel() + <p> + <input type="submit" value="Guardar" /> + </p> + </fieldset> + </div> +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Web/Views/Evento/Index.cshtml Tue Mar 15 08:24:18 2011 -0300 @@ -0,0 +1,29 @@ +@model Agendas.Web.Models.EventoIndexModel +@{ + ViewBag.Title = "Agenda"; +} + +<p> + Los próximos eventos son: +</p> +<table> + <thead> + <tr> + <th>Evento</th> + <th>Acciones</th> + </tr> + </thead> + <tbody> + @foreach (var item in Model.ProximosEventos) + { + <tr> + <td>@item.Titulo</td> + <td>@Html.ActionLink("Modificar", "Edit", new { id = item.Id })</td> + </tr> + } + </tbody> +</table> + +<p> +@Html.ActionLink("Nuevo", "New") +</p>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Web/Views/Evento/New.cshtml Tue Mar 15 08:24:18 2011 -0300 @@ -0,0 +1,34 @@ +@model Agendas.Web.Models.EventoNewModel +@{ + ViewBag.Title = "Agenda"; +} + +<p> + Complete los siguiente datos para agendar un nuevo evento +</p> + +<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" /> +<script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script> + +<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> +<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> + +<script type="text/javascript"> + $(document).ready(function () { + $("#Fecha").datepicker({ dateFormat: 'dd-mm-yy' }); + }); +</script> + +@using (Html.BeginForm()) +{ + @Html.ValidationSummary(true, "Los datos ingresados no son validos, por favor verifíquelos") + <div> + <fieldset> + <legend>Datos del evento:</legend> + @Html.EditorForModel() + <p> + <input type="submit" value="Guardar" /> + </p> + </fieldset> + </div> +} \ No newline at end of file
--- a/Agendas/trunk/src/Agendas.Web/Views/Shared/_Layout.cshtml Tue Mar 15 07:49:53 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Views/Shared/_Layout.cshtml Tue Mar 15 08:24:18 2011 -0300 @@ -21,7 +21,7 @@ <ul id="menu"> <li>@Html.ActionLink("Home", "Index", "Home")</li> - <li>@Html.ActionLink("Agenda", "Index", "Agenda")</li> + <li>@Html.ActionLink("Eventos", "Index", "Evento")</li> <li>@Html.ActionLink("Histórico", "Index", "Histórico")</li> <li>@Html.ActionLink("About", "About", "Home")</li> </ul>