public void Test_NewCell(int eNodebId, byte sectorId, double longtitute, short frequency, string isIndoor, double azimuth, string antConfig) { var cellExcelInfo = new CellExcel { ENodebId = eNodebId, SectorId = sectorId, Longtitute = longtitute, Frequency = frequency, IsIndoor = isIndoor, AntennaGain = 12.8, Azimuth = azimuth, TransmitReceive = antConfig }; var cell = Cell.ConstructItem(cellExcelInfo); Assert.IsNotNull(cell); Assert.AreEqual(cell.ENodebId, eNodebId); Assert.AreEqual(cell.SectorId, sectorId); Assert.AreEqual(cell.Longtitute, longtitute); Assert.AreEqual(cell.IsOutdoor, isIndoor.Trim() == "否"); Assert.AreEqual(cell.AntennaGain, 12.8); Assert.AreEqual(cell.Azimuth, azimuth, "azimuth"); Assert.AreEqual(cell.AntennaPorts, antConfig.GetAntennaPortsConfig()); }
protected QuickSaveOneCellService(ICellRepository repository, CellExcel cellInfo, CellBaseRepository baseRepository, bool updateExisted = false) : base(repository, cellInfo) { _baseRepository = baseRepository; _updateExisted = updateExisted; }
public void Test_ENodebBtsIdPair_2() { var info = new CellExcel { ENodebId = 11223, ShareCdmaInfo = null }; var item = info.MapTo <ENodebBtsIdPair>(); item.ENodebId.ShouldBe(11223); item.BtsId.ShouldBe(0); }
public void TestCellExcelConstruction_BasicParameters() { cellExcel = new CellExcel(mockReader.Object); cellExcel.Import(); Assert.AreEqual(cellExcel.ENodebId, 3344); Assert.AreEqual(cellExcel.SectorId, 1); Assert.AreEqual(cellExcel.Longtitute, 112.123); Assert.AreEqual(cellExcel.Lattitute, 23.456); Assert.AreEqual(cellExcel.Pci, 34); Assert.AreEqual(cellExcel.Frequency, 100); Assert.AreEqual(cellExcel.Height, 30); Assert.AreEqual(cellExcel.BandClass, 1); }
public void ImportNewCellInfo(CellExcel cellInfo) { CellBase cell = QueryCell(cellInfo.ENodebId, cellInfo.SectorId); if (cell == null) { cellBaseList.Add(new CellBase { ENodebId = cellInfo.ENodebId, SectorId = cellInfo.SectorId }); } }
public void Test_DumpSingleExcel(int eNodebId, byte sectorId) { var cellExcel = new CellExcel { ENodebId = eNodebId, SectorId = sectorId, ShareCdmaInfo = "1" }; Assert.IsTrue(Service.DumpSingleCellExcel(cellExcel)); CellRepository.Object.Count().ShouldBe(7); var lastObject = CellRepository.Object.GetAllList()[6]; lastObject.ENodebId.ShouldBe(eNodebId); lastObject.SectorId.ShouldBe(sectorId); }
protected void Initialize() { eNodebRepository.Setup(x => x.GetAll()).Returns(new List<ENodeb> { new ENodeb { ENodebId = 1 } }.AsQueryable()); repository.Setup(x => x.GetAll()).Returns(new List<Cell> { new Cell { ENodebId = 1, SectorId = 0, IsOutdoor = false, Frequency = 1750, BandClass = 2, Height = 32, Azimuth = 55, AntennaGain = 18, MTilt = 3, ETilt = 6, RsPower = 15.2, AntennaPorts = AntennaPortsConfigure.Antenna2T2R } }.AsQueryable()); repository.Setup(x => x.GetAllList()).Returns(repository.Object.GetAll().ToList()); repository.Setup(x => x.Count()).Returns(repository.Object.GetAll().Count()); repository.MockCellRepositoryDeleteCell(); repository.MockCellRepositorySaveCell(); cellInfo = new CellExcel { ENodebId = 1, SectorId = 1, IsIndoor = "否 ", Frequency = 1750, BandClass = 1, Height = 40, Azimuth = 35, AntennaGain = 17.5, MTilt = 4, ETilt = 7, RsPower = 16.2, TransmitReceive = "2T4R" }; }
protected void Initialize() { eNodebRepository.Setup(x => x.GetAll()).Returns(new List <ENodeb> { new ENodeb { ENodebId = 1 } }.AsQueryable()); repository.Setup(x => x.GetAll()).Returns(new List <Cell> { new Cell { ENodebId = 1, SectorId = 0, IsOutdoor = false, Frequency = 1750, BandClass = 2, Height = 32, Azimuth = 55, AntennaGain = 18, MTilt = 3, ETilt = 6, RsPower = 15.2, AntennaPorts = AntennaPortsConfigure.Antenna2T2R } }.AsQueryable()); repository.Setup(x => x.GetAllList()).Returns(repository.Object.GetAll().ToList()); repository.Setup(x => x.Count()).Returns(repository.Object.GetAll().Count()); repository.MockCellRepositoryDeleteCell(); repository.MockCellRepositorySaveCell(); cellInfo = new CellExcel { ENodebId = 1, SectorId = 1, IsIndoor = "否 ", Frequency = 1750, BandClass = 1, Height = 40, Azimuth = 35, AntennaGain = 17.5, MTilt = 4, ETilt = 7, RsPower = 16.2, TransmitReceive = "2T4R" }; }
public void Test_DumpSingleCell(int eNodebId, byte sectorId, short originPci, int index, short modifiedPci) { CellRepository.MockSixCells(pci: originPci); CellRepository.MockOperations(); var cellExcel = new CellExcel { ENodebId = eNodebId, SectorId = sectorId, Pci = modifiedPci }; Service.DumpSingleCellExcel(cellExcel); CellRepository.Object.Count().ShouldBe(6); var results = CellRepository.Object.GetAllList(); for (int i = 0; i < 6; i++) { results[i].Pci.ShouldBe(i == index ? modifiedPci : originPci); } }
public bool DumpSingleCellExcel(CellExcel info) { var cell = _cellRepository.GetBySectorId(info.ENodebId, info.SectorId); if (cell == null) { cell = Mapper.Map <CellExcel, Cell>(info); var fields = info.ShareCdmaInfo.GetSplittedFields('_'); var btsId = (fields.Length > 2) ? fields[1].ConvertToInt(-1) : -1; if (btsId > 0) { var bts = _btsRepository.GetByBtsId(btsId); if (bts != null) { bts.ENodebId = info.ENodebId; _btsRepository.Update(bts); } } var result = _cellRepository.Insert(cell); if (result == null) { return(false); } var item = BasicImportContainer.CellExcels.FirstOrDefault( x => x.ENodebId == info.ENodebId && x.SectorId == info.SectorId); if (item != null) { BasicImportContainer.CellExcels.Remove(item); } _cellRepository.SaveChanges(); return(true); } cell.Pci = info.Pci; cell.BandClass = info.BandClass; cell.Frequency = info.Frequency; cell.IsInUse = true; _cellRepository.SaveChanges(); return(true); }
public Cell Match(CellExcel stat) { return(FirstOrDefault(x => x.ENodebId == stat.ENodebId && x.SectorId == stat.SectorId)); }
public SimpleSaveOneCellService(ICellRepository repository, CellExcel cellInfo, IENodebRepository eNodebRepository) : base(repository, cellInfo) { _eNodeb = eNodebRepository.GetAll().FirstOrDefault(x => x.ENodebId == cellInfo.ENodebId); }
public bool Post(CellExcel info) { return(_service.DumpSingleCellExcel(info)); }
public ByENodebBaseQuickSaveOneCellService(ICellRepository repository, CellBaseRepository baseRepository, CellExcel cellInfo, ENodebBaseRepository eNodebRepository, bool updateExisted = false) : base(repository, cellInfo, baseRepository, updateExisted) { _eNodeb = eNodebRepository.QueryENodeb(cellInfo.ENodebId); }
protected SaveOneCellService(ICellRepository repository, CellExcel cellInfo) { _repository = repository; _cellInfo = cellInfo; }
public bool SaveCell(CellExcel cellInfo, IENodebRepository eNodebRepository) { return(true); }
public ByENodebQuickSaveOneCellService(ICellRepository repository, CellBaseRepository baseRepository, CellExcel cellInfo, IENodebRepository eNodebRepository, bool updateExisted = false) : base(repository, cellInfo, baseRepository, updateExisted) { _eNodeb = eNodebRepository.GetAll().FirstOrDefault(x => x.ENodebId == cellInfo.ENodebId); }
private void btnIn_Click(object sender, EventArgs e) { if (gridView1.RowCount <= 0) { XtraMessageBox.Show("Không có nhân viên nào"); return; } Excel.Application application = new Excel.Application(); Excel.Workbook workbook; Excel.Worksheet worksheet; workbook = application.Workbooks.Add(Type.Missing); application.Visible = true; application.WindowState = Excel.XlWindowState.xlMaximized; //getdatabase workbook.Worksheets.Add(); worksheet = workbook.Sheets[1]; worksheet.Cells[1, 1] = "Dach sách Khách Hàng"; worksheet.Cells[3, 1] = "STT"; worksheet.Cells[3, 2] = "Mã Khách Hàng"; worksheet.Cells[3, 3] = "Tên Khách Hàng"; worksheet.Cells[3, 4] = "Ngày Sinh"; worksheet.Cells[3, 5] = "Giới tính"; worksheet.Cells[3, 6] = "Số Điện Thoại"; worksheet.Cells[3, 7] = "Địa chỉ Khách Hàng"; worksheet.Cells[3, 8] = "Tổng Tiền Đã Mua Hàng"; worksheet.Cells[3, 9] = "Số Tiền Nợ"; /// int j = 1; // List <KhachHang> lst2 = new List <KhachHang>(); lst2 = kh.loadallkh(); //list = kh.laydulieutongtien("KH007"); //string a = list[0].tongtien.ToString(); List <String> lsttongtientt = new List <string>(); List <String> lsttongtienno = new List <String>(); for (int i = 0; i < lst2.Count; i++) { lsttongtientt.Add(kh.laytienkhachhangthanhtoan(lst2[i].MaKH)); lsttongtienno.Add(kh.laytienkhachhangno(lst2[i].MaKH)); } for (int i = 0; i < lst2.Count; i++) { worksheet.Cells[i + 4, 1] = i + 1; worksheet.Cells[i + 4, 2] = lst2[i].MaKH; worksheet.Cells[i + 4, 3] = lst2[i].TenKH; worksheet.Cells[i + 4, 4] = lst2[i].Ngaysinh; worksheet.Cells[i + 4, 5] = lst2[i].GioiTinh; worksheet.Cells[i + 4, 6] = lst2[i].SDT; worksheet.Cells[i + 4, 7] = lst2[i].DiaChi; if (lsttongtientt[i].ToString() == "0") { CellExcel cell = new CellExcel(); worksheet.Cells[i + 4, 8] = lsttongtientt[i].ToString(); cell.dong = i + 4; cell.cot = 8; } else { worksheet.Cells[i + 4, 8] = lsttongtientt[i].ToString(); } if (lsttongtienno[i].ToString() == "0") { CellExcel cell = new CellExcel(); worksheet.Cells[i + 4, 9] = lsttongtienno[i].ToString(); cell.dong = i + 4; cell.cot = 9; } else { worksheet.Cells[i + 4, 9] = lsttongtienno[i].ToString(); } } // định dạng trang worksheet.PageSetup.Orientation = Excel.XlPageOrientation.xlPortrait; worksheet.PageSetup.PaperSize = Excel.XlPaperSize.xlPaperA4; worksheet.PageSetup.LeftMargin = 0; worksheet.PageSetup.RightMargin = 0; worksheet.PageSetup.BottomMargin = 0; worksheet.PageSetup.TopMargin = 0; //định dạng cột worksheet.Range["A1", "G100"].Font.Name = "Times New Roman"; worksheet.Range["A1", "I100"].Font.Size = 14; worksheet.Range["A1", "I1"].MergeCells = true; worksheet.Range["A1", "I3"].Font.Bold = true; // kẻ bảng nhân viên worksheet.Range["A3", "I" + (lst2.Count + 3)].Borders.LineStyle = 1; // định dạng các dòng worksheet.Range["A1", "G1"].HorizontalAlignment = 3; worksheet.Range["A3", "I3"].HorizontalAlignment = 3; worksheet.Range["A4", "I4" + lst2.Count.ToString()].HorizontalAlignment = 3; worksheet.Range["H4", "I4" + lst2.Count.ToString()].NumberFormat = "#,##0\" VNĐ\""; worksheet.Columns.AutoFit(); }
public static Cell ConstructItem(CellExcel cellExcelInfo) { return(Mapper.Map <CellExcel, Cell>(cellExcelInfo)); }
public LteRru Match(CellExcel stat) { return(Get(stat.ENodebId, stat.LocalSectorId)); }