Mercurial > altnet-hispano
diff Agendas/trunk/src/Agendas.Web/DataProviders.cs @ 225:f23ee59ef1bd
Otros ponentes
author | nelopauselli |
---|---|
date | Mon, 26 Sep 2011 08:47:01 -0300 |
parents | 222362c29416 |
children | e5959f3405e0 |
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/DataProviders.cs Sun Sep 25 01:40:18 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/DataProviders.cs Mon Sep 26 08:47:01 2011 -0300 @@ -25,6 +25,27 @@ new SelectListItem {Text = p.Nombre, Value = p.Id.ToString(), Selected = p.Id.Equals(id)}; } + public static IEnumerable<SelectListItem> GetOtrosPonentes(this HtmlHelper helper, IEnumerable<Guid> ids) + { + var personas = AgendaFactory.GetPersonaService(); + if (ids == null || !ids.Any()) return new SelectListItem[] {}; + + return from p in from id in ids + select personas.GetById(id) + select new SelectListItem { Text = p.Nombre, Value = p.Id.ToString() }; + } + + + public static IEnumerable<SelectListItem> GetOtrosPonentesExcepto(this HtmlHelper helper, IEnumerable<Guid> ids) + { + var personas = AgendaFactory.GetPersonaService(); + + if (ids==null) ids = new List<Guid>(); + + return from p in personas.GetAll() where !ids.Contains(p.Id) + select new SelectListItem { Text = p.Nombre, Value = p.Id.ToString() }; + } + public static IEnumerable<string> GetRoles(this HtmlHelper helper) { return new[] {Roles.Administrador, Roles.Usuario};