Mercurial > altnet-hispano
comparison Agendas/trunk/src/Agendas.Web/DataProviders.cs @ 145:e6e6bfb1da9e
En la edición de un evento (nuevo, propuesta, modificación), el ponente se selecciona desde un combo.
author | Nelo@Guinea.neluz.int |
---|---|
date | Mon, 01 Aug 2011 11:42:24 -0300 |
parents | a5ff4de4a1d3 |
children | 734d3f0853bf |
comparison
equal
deleted
inserted
replaced
144:a2b14da4902f | 145:e6e6bfb1da9e |
---|---|
1 using System.Collections.Generic; | 1 using System; |
2 using System.Collections.Generic; | |
2 using System.Linq; | 3 using System.Linq; |
3 using System.Web.Mvc; | 4 using System.Web.Mvc; |
5 using AltNetHispano.Agendas.Factories; | |
4 using AltNetHispano.Agendas.Web.Models; | 6 using AltNetHispano.Agendas.Web.Models; |
5 | 7 |
6 namespace AltNetHispano.Agendas.Web | 8 namespace AltNetHispano.Agendas.Web |
7 { | 9 { |
8 public static class DataProviders | 10 public static class DataProviders |
10 public static IEnumerable<SelectListItem> GetTiposEvento(this HtmlHelper helper) | 12 public static IEnumerable<SelectListItem> GetTiposEvento(this HtmlHelper helper) |
11 { | 13 { |
12 return from t in EventoModelHelper.GetTiposEventos() | 14 return from t in EventoModelHelper.GetTiposEventos() |
13 select new SelectListItem {Text = t.TipoEventoStr, Value = t.TipoEvento.ToString()}; | 15 select new SelectListItem {Text = t.TipoEventoStr, Value = t.TipoEvento.ToString()}; |
14 } | 16 } |
17 | |
18 public static IEnumerable<SelectListItem> GetPonentes(this HtmlHelper helper, Guid id) | |
19 { | |
20 var personas = AgendaFactory.GetPersonaService(); | |
21 return from p in personas.GetAll() | |
22 orderby p.Nombre | |
23 select | |
24 new SelectListItem {Text = p.Nombre, Value = p.Id.ToString(), Selected = p.Id.Equals(id)}; | |
25 } | |
26 | |
15 } | 27 } |
16 } | 28 } |