public ActionResult ENodebEdit(int eNodebId) { ENodebDetailsViewModel viewModel = new ENodebDetailsViewModel(); viewModel.Import(eNodebId, _eNodebRepository, _cellRepository, _btsRepository, _cdmaCellRepository, _photoRepository); return View(viewModel); }
public ActionResult ENodebEdit(int eNodebId) { ENodebDetailsViewModel viewModel = new ENodebDetailsViewModel(); viewModel.Import(eNodebId, _eNodebRepository, _cellRepository, _btsRepository, _cdmaCellRepository, _photoRepository); return(View(viewModel)); }
public ActionResult UpdateImage() { int eNodebId = int.Parse(Request["ENodeb.ENodebId"]); string name = Request["ENodeb.Name"]; if (Request.Files["btsImage"] != null && !string.IsNullOrEmpty(Request.Files["btsImage"].FileName)) { HttpImporter btsImporter = new ImageFileImporter(Request.Files["btsImage"], name); ENodebPhoto btsPhoto = _photoRepository.Photos.FirstOrDefault( x => x.ENodebId == eNodebId && x.SectorId == 255 && x.Angle == -1); if (btsPhoto == null) { btsPhoto = new ENodebPhoto { ENodebId = eNodebId, SectorId = 255, Angle = -1, Path = btsImporter.FilePath }; _photoRepository.AddOnePhoto(btsPhoto); } _photoRepository.SaveChanges(); } IEnumerable <Cell> cells = _cellRepository.GetAll().Where(x => x.ENodebId == eNodebId).ToList(); foreach (Cell cell in cells) { HttpPostedFileBase file = Request.Files["cellImage-" + cell.SectorId]; if (file != null && !string.IsNullOrEmpty(file.FileName)) { HttpImporter cellImporter = new ImageFileImporter(file, name); byte sectorId = cell.SectorId; ENodebPhoto cellPhoto = _photoRepository.Photos.FirstOrDefault( x => x.ENodebId == eNodebId && x.SectorId == sectorId && x.Angle == -1); if (cellPhoto == null) { cellPhoto = new ENodebPhoto { ENodebId = eNodebId, SectorId = sectorId, Angle = -1, Path = cellImporter.FilePath }; _photoRepository.AddOnePhoto(cellPhoto); } _photoRepository.SaveChanges(); } } ENodebDetailsViewModel viewModel = new ENodebDetailsViewModel(); viewModel.Import(eNodebId, _eNodebRepository, _cellRepository, _btsRepository, _cdmaCellRepository, _photoRepository); return(View("ENodebEdit", viewModel)); }
public ActionResult UpdateENodebInfo(ENodeb item) { ENodeb eNodeb = _eNodebRepository.GetAll().FirstOrDefault(x => x.ENodebId == item.ENodebId); if (eNodeb == null) { return(View("ENodebEdit", new ENodebDetailsViewModel())); } eNodeb.Address = item.Address; eNodeb.Name = item.Name; eNodeb.Factory = item.Factory; ENodebDetailsViewModel viewModel = new ENodebDetailsViewModel(); viewModel.Import(eNodeb.ENodebId, _eNodebRepository, _cellRepository, _btsRepository, _cdmaCellRepository, _photoRepository); return(View("ENodebEdit", viewModel)); }
public ActionResult UpdateBtsInfo(CdmaBts item) { CdmaBts bts = _btsRepository.GetAll().FirstOrDefault(x => x.ENodebId == item.ENodebId); if (bts == null) { return(View("ENodebEdit", new ENodebDetailsViewModel())); } bts.Address = item.Address; bts.Name = item.Name; _btsRepository.Update(bts); ENodebDetailsViewModel viewModel = new ENodebDetailsViewModel(); viewModel.Import(bts.ENodebId, _eNodebRepository, _cellRepository, _btsRepository, _cdmaCellRepository, _photoRepository); return(View("ENodebEdit", viewModel)); }
public ActionResult UpdateImage() { int eNodebId = int.Parse(Request["ENodeb.ENodebId"]); string name = Request["ENodeb.Name"]; if (Request.Files["btsImage"] != null && !string.IsNullOrEmpty(Request.Files["btsImage"].FileName)) { HttpImporter btsImporter = new ImageFileImporter(Request.Files["btsImage"], name); ENodebPhoto btsPhoto = _photoRepository.Photos.FirstOrDefault( x => x.ENodebId == eNodebId && x.SectorId == 255 && x.Angle == -1); if (btsPhoto == null) { btsPhoto = new ENodebPhoto { ENodebId = eNodebId, SectorId = 255, Angle = -1, Path = btsImporter.FilePath }; _photoRepository.AddOnePhoto(btsPhoto); } _photoRepository.SaveChanges(); } IEnumerable<Cell> cells = _cellRepository.GetAll().Where(x => x.ENodebId == eNodebId).ToList(); foreach (Cell cell in cells) { HttpPostedFileBase file = Request.Files["cellImage-" + cell.SectorId]; if (file != null && !string.IsNullOrEmpty(file.FileName)) { HttpImporter cellImporter=new ImageFileImporter(file,name); byte sectorId = cell.SectorId; ENodebPhoto cellPhoto = _photoRepository.Photos.FirstOrDefault( x => x.ENodebId == eNodebId && x.SectorId == sectorId && x.Angle == -1); if (cellPhoto == null) { cellPhoto = new ENodebPhoto { ENodebId = eNodebId, SectorId = sectorId, Angle = -1, Path = cellImporter.FilePath }; _photoRepository.AddOnePhoto(cellPhoto); } _photoRepository.SaveChanges(); } } ENodebDetailsViewModel viewModel = new ENodebDetailsViewModel(); viewModel.Import(eNodebId, _eNodebRepository, _cellRepository, _btsRepository, _cdmaCellRepository, _photoRepository); return View("ENodebEdit", viewModel); }
public ActionResult UpdateENodebInfo(ENodeb item) { ENodeb eNodeb = _eNodebRepository.GetAll().FirstOrDefault(x => x.ENodebId == item.ENodebId); if (eNodeb == null) return View("ENodebEdit", new ENodebDetailsViewModel()); eNodeb.Address = item.Address; eNodeb.Name = item.Name; eNodeb.Factory = item.Factory; ENodebDetailsViewModel viewModel = new ENodebDetailsViewModel(); viewModel.Import(eNodeb.ENodebId, _eNodebRepository, _cellRepository, _btsRepository, _cdmaCellRepository, _photoRepository); return View("ENodebEdit",viewModel); }
public ActionResult UpdateBtsInfo(CdmaBts item) { CdmaBts bts = _btsRepository.GetAll().FirstOrDefault(x => x.ENodebId == item.ENodebId); if (bts == null) return View("ENodebEdit", new ENodebDetailsViewModel()); bts.Address = item.Address; bts.Name = item.Name; _btsRepository.Update(bts); ENodebDetailsViewModel viewModel = new ENodebDetailsViewModel(); viewModel.Import(bts.ENodebId, _eNodebRepository, _cellRepository, _btsRepository, _cdmaCellRepository, _photoRepository); return View("ENodebEdit", viewModel); }