Ejemplo n.º 1
0
        public ActionResult ImportResult(MrInterferenceViewModel model)
        {
            IEnumerable <ENodeb> eNodebs = _eNodebRepository.GetAllWithNames(_townRepository,
                                                                             model.CityName, model.DistrictName, model.TownName, model.ENodebName, model.Address);
            IEnumerable <ENodebBase> eNodebBases = eNodebs.ToList().Select(x =>
                                                                           new ENodebBase
            {
                ENodebId = x.ENodebId,
                Name     = x.Name
            });

            if (eNodebs.Any())
            {
                MrsCellDate[] stats
                    = _mrsRepository.QueryItems(eNodebs, model.StartDate, model.EndDate).ToArray();
                Array.Sort(stats, new MrsCellDateComparer());
                if (stats.Any())
                {
                    RutraceStatContainer.MrsStats = stats.Select(x =>
                    {
                        MrsCellDateView view = new MrsCellDateView();
                        x.CloneProperties(view);
                        ENodebBase eNodeb = eNodebBases.FirstOrDefault(e => e.ENodebId == x.CellId);
                        view.CellName     = eNodeb == null ? "Unknown" : eNodeb.Name + "-" + x.SectorId;
                        return(view);
                    }).ToList();
                    outdoorCellList = RutraceStatContainer.QueryOutdoorCellsFromMrs(
                        _eNodebRepository, _cellRepository);
                }
            }
            model.InitializeTownList(_townRepository, model);
            model.UpdateStats(RutraceStatContainer.MrsStats, eNodebBases, PageSize);
            return(View("Import", model));
        }
Ejemplo n.º 2
0
 public ActionResult ImportResult(MrInterferenceViewModel model)
 {
     IEnumerable<ENodeb> eNodebs = _eNodebRepository.GetAllWithNames(_townRepository,
         model.CityName, model.DistrictName, model.TownName, model.ENodebName, model.Address);
     IEnumerable<ENodebBase> eNodebBases = eNodebs.ToList().Select(x =>
         new ENodebBase
         {
             ENodebId = x.ENodebId,
             Name = x.Name
         });
     if (eNodebs.Any())
     {
         MrsCellDate[] stats
             = _mrsRepository.QueryItems(eNodebs, model.StartDate, model.EndDate, model.MinMrs).ToArray();
         Array.Sort(stats, new MrsCellDateComparer());
         if (stats.Any())
         {
             RutraceStatContainer.MrsStats = stats.Select(x =>
             {
                 MrsCellDateView view = new MrsCellDateView();
                 x.CloneProperties(view);
                 ENodebBase eNodeb = eNodebBases.FirstOrDefault(e => e.ENodebId == x.CellId);
                 view.CellName = eNodeb == null ? "Unknown" : eNodeb.Name + "-" + x.SectorId;
                 return view;
             }).ToList();
             outdoorCellList = RutraceStatContainer.QueryOutdoorCellsFromMrs(
                 _eNodebRepository, _cellRepository);
         }
     }
     model.Initialize(_townRepository);
     model.UpdateStats(RutraceStatContainer.MrsStats, PageSize);
     return View("Import", model);
 }