view Agendas/trunk/src/Agendas.Web/DataProviders.cs @ 201:38b018822bb6

Se soluciona ticket #172, no muestra imágen de DiscountASP.NET en el Footer.
author alabra
date Sat, 20 Aug 2011 17:47:21 -0400
parents 222362c29416
children f23ee59ef1bd
line wrap: on
line source

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using AltNetHispano.Agendas.Domain;
using AltNetHispano.Agendas.Factories;
using AltNetHispano.Agendas.Web.Models;

namespace AltNetHispano.Agendas.Web
{
    public static class DataProviders
    {
        public static IEnumerable<SelectListItem> GetTiposEvento(this HtmlHelper helper)
        {
            return from t in EventoModelHelper.GetTiposEventos()
                   select new SelectListItem {Text = t.TipoEventoStr, Value = t.TipoEvento.ToString()};
        }

        public static IEnumerable<SelectListItem> GetPonentes(this HtmlHelper helper, Guid id)
        {
            var personas = AgendaFactory.GetPersonaService();
            return from p in personas.GetAll()
                   orderby p.Nombre
                   select
                       new SelectListItem {Text = p.Nombre, Value = p.Id.ToString(), Selected = p.Id.Equals(id)};
        }

		public static IEnumerable<string> GetRoles(this HtmlHelper helper)
		{
			return new[] {Roles.Administrador, Roles.Usuario};
		}
	}
}