Ejemplo n.º 1
0
        public ActionResult InfrastructureImport()
        {
            HttpPostedFileBase lteFileBase           = Request.Files["lte"];
            HttpPostedFileBase cdmaFileBase          = Request.Files["cdma"];
            SaveCollegeInfrastructureService service = new SaveCollegeInfrastructureService(InfrastructureRepository);
            string info = "";

            if (lteFileBase != null && lteFileBase.FileName != "")
            {
                CollegeLteExcelModel lteResults = lteFileBase.ImportLteInfos();
                int eNodebCounts    = service.SaveENodebs(lteResults.BtsExcels, ENodebRepository);
                int cellCounts      = service.SaveCells(lteResults.CellExcels, CellRepository);
                int lteIndoorCounts = service.SaveLteIndoorDistributions(lteResults.IndoorExcels,
                                                                         IndoorDistributioinRepository);
                info += "新增ENodeB" + eNodebCounts + "个;新增LTE小区" + cellCounts + "个;新增LTE室分" + lteIndoorCounts + "个\n";
            }
            if (cdmaFileBase != null && cdmaFileBase.FileName != "")
            {
                CollegeCdmaExcelImporter cdmaResults = cdmaFileBase.ImportCdmaInfos();
                int btsCounts        = service.SaveBtss(cdmaResults.BtsExcels, BtsRepository);
                int cdmaCellCounts   = service.SaveCdmaCells(cdmaResults.CellExcels, CdmaCellRepository);
                int cdmaIndoorCounts = service.SaveCdmaIndoorDistributions(cdmaResults.IndoorExcels,
                                                                           IndoorDistributioinRepository);
                info += "新增BTS" + btsCounts + "个;新增CDMA小区" + cdmaCellCounts + "个;新增CDMA室分" + cdmaIndoorCounts + "个";
            }
            TempData["info"] = info;
            return(RedirectToAction("List"));
        }