コード例 #1
0
ファイル: PReporte.cs プロジェクト: Jessie5509/AlasWeb
        public double PorcentajeVuelos(DtoRPorcentaje dto)
        {
            double porcentaje = 0;

            using (AlasPUMEntities context = new AlasPUMEntities())
            {
                int vuelos = context.Vuelo.Select(s => s).Count();

                List <Vuelo> colVuelo = context.Vuelo.Where(w => w.dtLlegada == dto.fechaInicio && w.dtSalida == dto.fechaFin).ToList();
                int          eso      = colVuelo.Count();

                porcentaje = (vuelos * eso) / 100;
            }

            DecimalFormat df = new DecimalFormat("#.00");

            string total = df.Format(porcentaje);

            porcentaje = double.Parse(total);

            return(porcentaje);
        }
コード例 #2
0
        public ActionResult Reporte1(DtoRPorcentaje dto)
        {
            double porcentaje = HReporte.getInstace().PorcentajeVuelos(dto);

            return(RedirectToAction("PorcentajeVuelos"));
        }
コード例 #3
0
        public double PorcentajeVuelos(DtoRPorcentaje dto)
        {
            PReporte pe = new PReporte();

            return(pe.PorcentajeVuelos(dto));
        }