public ActionResult ReactorStatistics()
        {
            StatisticsPO     dbStats       = new StatisticsPO();
            StatisticsBO     statisticsBO  = new StatisticsBO();
            List <ReactorBO> reactorBOList = new List <ReactorBO>();

            try
            {
                List <ReactorDO> reactorDOList = _reactorDAO.ObtainAllReactors();
                if (reactorDOList != null)
                {
                    foreach (ReactorDO reactorDO in reactorDOList)
                    {
                        ReactorBO reactorBO = Mapping.Mapper.ReactorDOtoBO(reactorDO);
                        reactorBOList.Add(reactorBO);
                    }
                    statisticsBO = _reactorBLO.SpectrumCount(reactorBOList, statisticsBO);
                    statisticsBO = _reactorBLO.SpectrumPercentage(statisticsBO);
                    statisticsBO = _reactorBLO.GenerationCounter(reactorBOList, statisticsBO);

                    int[] genCount = new int[6];
                    genCount[0]  = statisticsBO.NoGenCount;
                    genCount[1]  = statisticsBO.GenIcount;
                    genCount[2]  = statisticsBO.GenIIcount;
                    genCount[3]  = statisticsBO.GenIIIcount;
                    genCount[4]  = statisticsBO.GenIVcount;
                    genCount[5]  = statisticsBO.GenVcount;
                    statisticsBO = _reactorBLO.GenerationPercentage(genCount, statisticsBO);
                    dbStats      = Mapping.Mapper.StatisticsBOtoPO(statisticsBO);
                }
            }
            catch (Exception ex)
            {
                _logger.LogMessage(ex, "Fatal");
            }
            finally { }
            return(View(dbStats));
        }
Esempio n. 2
0
        public static StatisticsPO StatisticsBOtoPO(StatisticsBO from)
        {
            StatisticsPO to = new StatisticsPO();

            to.ReactorCount   = from.ReactorCount;
            to.ThermalCount   = from.ThermalCount;
            to.FastCount      = from.FastCount;
            to.PercentThermal = from.PercentThermal;
            to.PercentFast    = from.PercentFast;
            to.GenIcount      = from.GenIcount;
            to.GenIIcount     = from.GenIIcount;
            to.GenIIIcount    = from.GenIIIcount;
            to.GenIVcount     = from.GenIVcount;
            to.GenVcount      = from.GenVcount;
            to.NoGenCount     = from.NoGenCount;
            to.PercentGenI    = from.PercentGenI;
            to.PercentGenII   = from.PercentGenII;
            to.PercentGenIII  = from.PercentGenIII;
            to.PercentGenIV   = from.PercentGenIV;
            to.PercentGenV    = from.PercentGenV;
            to.PercentNoGen   = from.PercentNoGen;
            return(to);
        }