public static List <double> AgruparSegmentacion(commonFDP.Segment.Segmentacion segmentacion, List <Evento> eventos) { if (eventos != null && eventos.Count > 0) { double cantEventos = (double)eventos.Count; switch (segmentacion) { case Segment.Segmentacion.DIA: return(eventos.Select(x => new { Mes = x.fecha.Month, Anio = x.fecha.Year, Dia = x.fecha.Day }) .GroupBy(x => new { x.Mes, x.Anio, x.Dia }).Select(x => Convert.ToDouble(x.Count())).ToList()); case Segment.Segmentacion.HORA: return(eventos.Select(x => new { Mes = x.fecha.Month, Anio = x.fecha.Year, Dia = x.fecha.Day, Hora = x.fecha.Hour }) .GroupBy(x => new { x.Anio, x.Mes, x.Dia, x.Hora }).Select(x => Convert.ToDouble(x.Count())).ToList()); case Segment.Segmentacion.MINUTO: return(eventos.Select(x => new { Mes = x.fecha.Month, Anio = x.fecha.Year, Dia = x.fecha.Day, Hora = x.fecha.Hour, Minuto = x.fecha.Minute }) .GroupBy(x => new { x.Anio, x.Mes, x.Dia, x.Hora, x.Minuto }).Select(x => Convert.ToDouble(x.Count())).ToList()); case Segment.Segmentacion.SEGUNDO: return(eventos.Select(x => new { Mes = x.fecha.Month, Anio = x.fecha.Year, Dia = x.fecha.Day, Hora = x.fecha.Hour, Minuto = x.fecha.Minute, Segundo = x.fecha.Second }) .GroupBy(x => new { x.Anio, x.Mes, x.Dia, x.Hora, x.Minuto, x.Segundo }).Select(x => Convert.ToDouble(x.Count())).ToList()); default: return(null); } } else { return(null); } }
public FrmAjusteFunciones(commonFDP.MetodologiaAjuste metodologia, commonFDP.Segment.Segmentacion segmentacion, List <Double> intervalos, int flagIntervalos, commonFDP.Origen proyecto, AnalisisPrevio aPrevio) { InitializeComponent(); this.metodologia = metodologia; this.segmentacion = segmentacion; this.intervalos = intervalos; this.flagIntervalos = flagIntervalos; this.proyecto = proyecto; this.analisisPrevio = aPrevio; this.FrmAjusteFunciones_Load(); }