Mercurial > altnet-hispano
comparison Agendas/trunk/src/Agendas.Web/DataProviders.cs @ 238:b43dc14886e3
Quitando ponente principal de la UI
author | nelopauselli |
---|---|
date | Tue, 04 Oct 2011 21:59:40 -0300 |
parents | e5959f3405e0 |
children | da9c295e9fa1 |
comparison
equal
deleted
inserted
replaced
237:51faeabfb9d9 | 238:b43dc14886e3 |
---|---|
14 { | 14 { |
15 return from t in EventoModelHelper.GetTiposEventos() | 15 return from t in EventoModelHelper.GetTiposEventos() |
16 select new SelectListItem {Text = t.TipoEventoStr, Value = t.TipoEvento.ToString()}; | 16 select new SelectListItem {Text = t.TipoEventoStr, Value = t.TipoEvento.ToString()}; |
17 } | 17 } |
18 | 18 |
19 public static IEnumerable<SelectListItem> GetPonentes(this HtmlHelper helper, Guid id) | 19 public static IEnumerable<SelectListItem> GetPonentes(this HtmlHelper helper, IEnumerable<Guid> ids) |
20 { | |
21 var lista = new List<SelectListItem> {new SelectListItem {Text = "[Ninguno]", Value = Guid.Empty.ToString()}}; | |
22 | |
23 var personaService = AgendaFactory.GetPersonaService(); | |
24 var personas = from p in personaService.GetAll() | |
25 orderby p.Nombre | |
26 select | |
27 new SelectListItem {Text = p.Nombre, Value = p.Id.ToString(), Selected = p.Id.Equals(id)}; | |
28 | |
29 return lista.Union(personas); | |
30 } | |
31 | |
32 public static IEnumerable<SelectListItem> GetOtrosPonentes(this HtmlHelper helper, IEnumerable<Guid> ids) | |
33 { | 20 { |
34 var personas = AgendaFactory.GetPersonaService(); | 21 var personas = AgendaFactory.GetPersonaService(); |
35 if (ids == null || !ids.Any()) return new SelectListItem[] {}; | 22 if (ids == null || !ids.Any()) return new SelectListItem[] {}; |
36 | 23 |
37 return from p in from id in ids | 24 return from p in from id in ids |
38 select personas.GetById(id) | 25 select personas.GetById(id) |
39 select new SelectListItem { Text = p.Nombre, Value = p.Id.ToString() }; | 26 select new SelectListItem { Text = p.Nombre, Value = p.Id.ToString() }; |
40 } | 27 } |
41 | 28 |
42 | 29 |
43 public static IEnumerable<SelectListItem> GetOtrosPonentesExcepto(this HtmlHelper helper, IEnumerable<Guid> ids) | 30 public static IEnumerable<SelectListItem> GetPonentesExcepto(this HtmlHelper helper, IEnumerable<Guid> ids) |
44 { | 31 { |
45 var personas = AgendaFactory.GetPersonaService(); | 32 var personas = AgendaFactory.GetPersonaService(); |
46 | 33 |
47 if (ids==null) ids = new List<Guid>(); | 34 if (ids==null) ids = new List<Guid>(); |
48 | 35 |