/// <summary> /// 전체기초 데이터 생성 /// </summary> /// <remarks> /// 지역형식 정보 리스트, 특수수신기 정보 리스트, 특수 수신기 상태 정보 리스트, 각 시스템 상태 정보 리스트 /// 사용자 정보리스트, 특수수신기 그룹정보 리스트 /// 들을 로드하여 기초 데이터를 생성한다.</remarks> /// <returns></returns> public Boolean setInitData() { try { if (sfConnection == null) { return(false); } this.typeRegionList = sfConnection.remoteobject.getTypeRegionList(); this.typeDisasterList = sfConnection.remoteobject.getTypeDisasterList(); this.deviceInfoList = sfConnection.remoteobject.getDeviceInfoList(); this.userList = sfConnection.remoteobject.getUserInfoList(); this.getpriorityList = sfConnection.remoteobject.getTypePriorityList(); this.getTypedeviceList = sfConnection.remoteobject.getTypeDeviceList(); this.typeServerList = sfConnection.remoteobject.getTypeServerList(); this.serverList = sfConnection.remoteobject.getServerInfoList(); this.broadList = sfConnection.remoteobject.getBCenterList(); this.regionInfoList = sfConnection.remoteobject.getRegionInfoList(); RegionInfoIDComparer tarComp = new RegionInfoIDComparer(); this.regionInfoList.Sort(tarComp); IPAddress myip = null; IPHostEntry hostAdd = Dns.GetHostEntry(Dns.GetHostName()); uint tmpServerID = 0; foreach (IPAddress ip in hostAdd.AddressList) { myip = ip; break; } for (int i = 0; i < this.serverList.Count; i++) { if (this.serverList[i].RealIP.ToString() == myip.ToString().Trim()) { if (this.serverList[i].Name == "DS") { tmpServerID = this.serverList[i].ID; } } } sfConnection.ServerID = tmpServerID; return(true); } catch (Exception err) { Console.WriteLine("datamanager.setInitData {0}", err.Message); return(false); } }
/// <summary> /// 수신기 리스트에 데이터를 초기화한다. /// </summary> private void initListViewData() { if (this.dataMng.TypeDisasterList.Count < 1) { return; } RegionInfo rcomparee = new RegionInfo(); RegionInfoIDComparer rcomparer = new RegionInfoIDComparer(); DeviceInfoIDComparer comparer = new DeviceInfoIDComparer(); string tot = string.Empty; string prov = string.Empty; string dist = string.Empty; string area = string.Empty; dataMng.DeviceInfoList.Sort(comparer); dataMng.RegionInfoList.Sort(rcomparer); foreach (DeviceInfo disItem in this.dataMng.DeviceInfoList) { tot = string.Empty; prov = string.Empty; dist = string.Empty; area = string.Empty; rcomparee.ID = disItem.FkRegion; RegionInfo ri = dataMng.RegionInfoList[dataMng.RegionInfoList.BinarySearch(rcomparee, rcomparer)]; area = ri.Name; foreach (RegionInfo distRi in dataMng.RegionInfoList) { if (distRi.ID == ri.ParentRegionID) { dist = distRi.Name; foreach (RegionInfo provRi in dataMng.RegionInfoList) { if (provRi.ID == distRi.ParentRegionID) { prov = provRi.Name; break; } } break; } } tot = prov + " " + dist + " " + area; ListViewItem item = new ListViewItem(); item.Name = disItem.ID.ToString(); ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem(); foreach (TypeDevice td in dataMng.GetTypedeviceList) { if (td.ID == disItem.TkDevice) { subItem.Text = td.Name.ToString(); } } item.SubItems.Add(subItem); subItem = new ListViewItem.ListViewSubItem(); subItem.Text = disItem.Name.ToString(); item.SubItems.Add(subItem); subItem = new ListViewItem.ListViewSubItem(); subItem.Text = tot.Trim(); item.SubItems.Add(subItem); subItem = new ListViewItem.ListViewSubItem(); subItem.Text = disItem.CellNumber.ToString(); item.SubItems.Add(subItem); this.listViewDisasterList.Items.Add(item); } }