view Agendas/trunk/src/Agendas.Web/DataProviders.cs @ 185:2d02adb79322

Se agrega fecha de termino de un Evento y se incluye la hora a la fecha de inicio. Se modifica la propiedad Fecha del Evento, renombrandola FechaInicio. En el ModelView se agrega propiedades Duración y Hora del Evento cuando es Modificado, Nuevo y Agendado. Las fechas ingresadas son creadas en sistema UTC Queda pendiente Agregar duración a Google Calendar.
author alabra
date Tue, 09 Aug 2011 01:04:27 -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};
		}
	}
}