view Agendas/trunk/src/Agendas.Web/DataProviders.cs @ 171:4e4b758ab744

Ticket 155: Se carga la Duración correcta, formateada en HH:MM
author juanjose.montesdeocaarbos
date Sat, 06 Aug 2011 13:46:56 -0300
parents 734d3f0853bf
children 222362c29416
line wrap: on
line source

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
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)};
        }
    }
}