comparison Agendas/trunk/src/Agendas.Web/DataProviders.cs @ 285:c8f378272407

#123: Patrocinadores de las vans.
author juanjose.montesdeocaarbos
date Sat, 31 Dec 2011 14:45:55 -0300
parents da9c295e9fa1
children 5f1e3d35e113
comparison
equal deleted inserted replaced
284:79942e030118 285:c8f378272407
44 44
45 public static string Version(this HtmlHelper helper) 45 public static string Version(this HtmlHelper helper)
46 { 46 {
47 return typeof (DataProviders).Assembly.GetName().Version.ToString(); 47 return typeof (DataProviders).Assembly.GetName().Version.ToString();
48 } 48 }
49
50 public static IEnumerable<SelectListItem> GetPatrocinadores(this HtmlHelper helper, IEnumerable<Guid> ids)
51 {
52 var repository = AgendaFactory.GetPatrocinadorRepository();
53
54 var patrocinadores = repository.GetAll();
55 if (ids == null || !ids.Any()) return new SelectListItem[] { };
56
57 return from p in patrocinadores
58 select new SelectListItem {Text = p.Nombre, Value = p.Id.ToString()};
59 }
60
61 public static IEnumerable<SelectListItem> GetPatrocinadoresExcepto(this HtmlHelper helper, IEnumerable<Guid> ids)
62 {
63 var repository = AgendaFactory.GetPatrocinadorRepository();
64
65 var patrocinadores = repository.GetAll();
66 if (ids == null) ids = new List<Guid>();
67
68 return from p in patrocinadores
69 where !ids.Contains(p.Id)
70 select new SelectListItem { Text = p.Nombre, Value = p.Id.ToString() };
71 }
49 } 72 }
50 } 73 }