private void FillData(List <Fire_SatelliteGroundStation> fireSatelliteGroundStationList) { this.pagerControl1.Bind(); this.pagerControl1.bindingSource.DataSource = fireSatelliteGroundStationList; this.pagerControl1.bindingNavigator.BindingSource = this.pagerControl1.bindingSource; this.listView1.Items.Clear(); if (fireSatelliteGroundStationList != null) { for (int i = 0; i < fireSatelliteGroundStationList.Count; i++) { Fire_SatelliteGroundStation fireSatelliteGroundStation = fireSatelliteGroundStationList[i]; ListViewItem item = new ListViewItem(); item.SubItems.Add(fireSatelliteGroundStation.name); AreaCodeInfo county = null; try { if (this.navigationControl1.AreaList != null) { county = this.navigationControl1.AreaList.Where(a => a.code == fireSatelliteGroundStation.pac).First(); } } catch { } item.SubItems.Add((county == null) ? "" : county.name); item.SubItems.Add(fireSatelliteGroundStation.manager); item.SubItems.Add(fireSatelliteGroundStation.longitude.ToString()); item.SubItems.Add(fireSatelliteGroundStation.latitude.ToString()); item.Tag = fireSatelliteGroundStation; this.listView1.Items.Add(item); } } }
private void FillData(List <Fire_DangerousFacilities> dFacilitiesList) { this.pagerControl1.Bind(); this.pagerControl1.bindingSource.DataSource = dFacilitiesList; this.pagerControl1.bindingNavigator.BindingSource = this.pagerControl1.bindingSource; this.listView1.Items.Clear(); if (dFacilitiesList != null) { for (int i = 0; i < dFacilitiesList.Count; i++) { Fire_DangerousFacilities dFacilities = dFacilitiesList[i]; ListViewItem item = new ListViewItem(); item.SubItems.Add(dFacilities.name); AreaCodeInfo county = null; try { if (this.navigationControl1.AreaList != null) { county = this.navigationControl1.AreaList.Where(a => a.code == dFacilities.pac).First(); } } catch { } item.SubItems.Add((county == null) ? "" : county.name); item.SubItems.Add(dFacilities.manager); item.SubItems.Add(dFacilities.longitude.ToString()); item.SubItems.Add(dFacilities.latitude.ToString()); item.Tag = dFacilities; this.listView1.Items.Add(item); } } }
private void FillData(List <Fire_Hot> hotList) { this.pager1.Bind(); this.pager1.bindingSource.DataSource = hotList; this.pager1.bindingNavigator.BindingSource = this.pager1.bindingSource; this.listView1.Items.Clear(); if (hotList != null) { for (int i = 0; i < hotList.Count; i++) { Fire_Hot hot = hotList[i]; ListViewItem item = new ListViewItem(); item.SubItems.Add(hot.no); AreaCodeInfo county = null; try { if (this.navigationControl1.AreaList != null) { county = this.navigationControl1.AreaList.Where(a => a.code == hot.pac).First(); } } catch { } item.SubItems.Add((hot.county == null && county != null) ? county.name : hot.county); item.SubItems.Add(Enum.GetName(typeof(HotType), hot.type)); item.SubItems.Add(hot.reporter); item.SubItems.Add(hot.reporttime); item.Tag = hot; this.listView1.Items.Add(item); } } }