private void UpdateRecord() { this.lvOrderList.Items.Clear(); // 리스트 아이템 추가 int index = 0; if (this.currentOrderHistory == null) { return; } foreach (OrderRecord record in this.currentOrderHistory) { if (record == null) { continue; } string targetsName = string.Empty; if (!string.IsNullOrEmpty(record.CapText)) { CAPHelper helper = new CAPHelper(); targetsName = helper.ExtractTargetNamesFromCAP(new CAPLib.CAP(record.CapText)); if (string.IsNullOrEmpty(targetsName)) { targetsName = ""; } } // 번호 AdengListViewItem item = this.lvOrderList.Items.Add((index + 1).ToString()); item.TextAlign = HorizontalAlignment.Center; // 결과 //this.lvOrderList.Items[index].SubItems.Add(" "); // 발령 시각 item.SubItems.Add(record.OrderedTime.ToString()); // 발령지 구분 item.SubItems.Add(BasisData.GetDisplayStringLocationKindName(record.LocationKind)); // 발령 모드 item.SubItems.Add(BasisData.GetDisplayStringOrderMode(record.OrderMode)); // 이벤트 종류 item.SubItems.Add(BasisData.GetDisplayStringDisasterKindName(record.DisasterKindCode)); // 발령 대상 item.SubItems.Add(targetsName); // 비고(참조 유형) item.SubItems.Add(BasisData.GetOrderRefTypeDescription(record.RefType)); item.Name = record.CAPID; item.Tag = record; index++; } }
/// <summary> /// 발령 이력 조회 리스트 갱신. /// </summary> /// <param name="historyList"></param> private void UpdateOrderHistoryList(List <OrderRecord> historyList) { this.lvOrderHistory.Items.Clear(); if (this.lvOrderHistory.Columns == null) { return; } foreach (OrderRecord record in historyList) { string targetsName = string.Empty; if (!string.IsNullOrEmpty(record.CapText)) { CAPHelper helper = new CAPHelper(); targetsName = helper.ExtractTargetNamesFromCAP(new CAPLib.CAP(record.CapText)); if (string.IsNullOrEmpty(targetsName)) { targetsName = ""; } } // 결과 AdengListViewItem item = this.lvOrderHistory.Items.Add((this.lvOrderHistory.Items.Count + 1).ToString()); // 아이디 item.SubItems.Add(record.CAPID); // 발령 시각 item.SubItems.Add(record.OrderedTime.ToString()); // 발령지 구분 item.SubItems.Add(BasisData.GetDisplayStringLocationKindName(record.LocationKind)); // 발령 모드 item.SubItems.Add(BasisData.GetDisplayStringOrderMode(record.OrderMode)); // 재난 정보 item.SubItems.Add(BasisData.GetDisplayStringDisasterKindName(record.DisasterKindCode)); // 발령 대상 item.SubItems.Add(targetsName); // 발령 참조 정보 item.SubItems.Add(record.RefRecordID); item.Name = record.CAPID; item.Tag = record; } }
/// <summary> /// 리스트 갱신. /// </summary> private void UpdateReportList() { try { this.lvClearWaitingList.Items.Clear(); if (this.currentWaitingList == null || this.currentWaitingList.Count <= 0) { return; } CAPHelper helper = new CAPHelper(); foreach (OrderRecord record in this.currentWaitingList) { // 번호 int itemNo = this.lvClearWaitingList.Items.Count + 1; AdengListViewItem newItem = this.lvClearWaitingList.Items.Add(itemNo.ToString()); // 발령 아이디 newItem.SubItems.Add(record.CAPID); // 발령 시각 newItem.SubItems.Add(record.OrderedTime.ToString()); // 발령 모드 newItem.SubItems.Add(BasisData.GetDisplayStringOrderMode(record.OrderMode)); // 재난종류 newItem.SubItems.Add(BasisData.GetDisplayStringDisasterKindName(record.DisasterKindCode)); CAP msg = new CAP(record.CapText); if (msg == null) { continue; } // 발령 대상 string targetNames = helper.ExtractTargetNamesFromCAP(msg); if (targetNames == null) { targetNames = ""; } newItem.SubItems.Add(targetNames); newItem.Name = record.CAPID; newItem.Tag = record; } } catch (Exception ex) { System.Console.WriteLine("[ClearAlertWaitingListForm] UpdateReportList( Exception: \n" + ex.ToString() + ")"); FileLogManager.GetInstance().WriteLog("[ClearAlertWaitingListForm] UpdateReportList( Exception=[" + ex.ToString() + "] )"); } }
private void UpdateOrderDetailList() { this.dgvOrderDetail.Rows.Clear(); if (this.dgvOrderDetail.Columns == null) { return; } this.dgvOrderDetail.Rows.Add("발령 아이디", this.currentOrderRecord.CAPID.ToString()); this.dgvOrderDetail.Rows.Add("발령 시각", this.currentOrderRecord.OrderedTime.ToString()); CAP capMsg = new CAP(this.currentOrderRecord.CapText); if (capMsg == null) { return; } this.dgvOrderDetail.Rows.Add("발령원", capMsg.Source); this.dgvOrderDetail.Rows.Add("모드", BasisData.GetDisplayStringOrderMode(this.currentOrderRecord.OrderMode)); this.dgvOrderDetail.Rows.Add("이벤트 종류", BasisData.GetDisplayStringDisasterKindName(this.currentOrderRecord.DisasterKindCode)); CAPHelper helper = new CAPHelper(); string targets = helper.ExtractTargetNamesFromCAP(capMsg); if (!string.IsNullOrEmpty(targets)) { this.dgvOrderDetail.Rows.Add("대상", targets); } List <SASKind> targetKinds = helper.ExtractTargetKindsFromCAP(capMsg); if (targetKinds != null && targetKinds.Count > 0) { bool isFirst = true; StringBuilder builder = new StringBuilder(); foreach (SASKind kind in targetKinds) { if (isFirst) { isFirst = false; builder.Append(kind.Name); } else { builder.Append("," + kind.Name); } } if (builder.Length > 0) { this.dgvOrderDetail.Rows.Add("시스템 종류", builder.ToString()); } } else { this.dgvOrderDetail.Rows.Add("시스템 종류", "전체"); } string languages = helper.GetLanguageNamesFromCAP(capMsg); if (!string.IsNullOrEmpty(languages)) { this.dgvOrderDetail.Rows.Add("언어", languages); } List <CAPParameterMsgInfo> msgInfo = helper.ExtractMsgTextFromCAP(capMsg, BasisData.DEFAULT_LANGUAGECODE); if (msgInfo != null && msgInfo.Count > 0) { foreach (CAPParameterMsgInfo info in msgInfo) { if (info.ValueName.ToUpper().Contains("TTS")) { int height = this.dgvOrderDetail.Rows.GetRowsHeight(DataGridViewElementStates.Displayed); int remainHeight = this.dgvOrderDetail.Height - height; int index = this.dgvOrderDetail.Rows.Add("문안[TTS]", info.Value); break; } } foreach (CAPParameterMsgInfo info in msgInfo) { if (info.ValueName.ToUpper().Contains("CBS")) { int height = this.dgvOrderDetail.Rows.GetRowsHeight(DataGridViewElementStates.Displayed); int remainHeight = this.dgvOrderDetail.Height - height; int index = this.dgvOrderDetail.Rows.Add("문안[CBS]", info.Value); break; } } foreach (CAPParameterMsgInfo info in msgInfo) { if (info.ValueName.ToUpper().Contains("BOARD")) { int height = this.dgvOrderDetail.Rows.GetRowsHeight(DataGridViewElementStates.Displayed); height += this.dgvOrderDetail.ColumnHeadersHeight + 2; int remainHeight = this.dgvOrderDetail.Height - height; int index = this.dgvOrderDetail.Rows.Add("문안[Board]", info.Value); if (remainHeight > 0) { //this.dgvOrderDetail.Rows[index].MinimumHeight = remainHeight; } break; } } foreach (CAPParameterMsgInfo info in msgInfo) { if (info.ValueName.ToUpper().Contains("DMB")) { int height = this.dgvOrderDetail.Rows.GetRowsHeight(DataGridViewElementStates.Displayed); height += this.dgvOrderDetail.ColumnHeadersHeight + 2; int remainHeight = this.dgvOrderDetail.Height - height; int index = this.dgvOrderDetail.Rows.Add("문안[DMB]", info.Value); if (remainHeight > 0) { //this.dgvOrderDetail.Rows[index].MinimumHeight = remainHeight; } break; } } } else { this.dgvOrderDetail.Rows.Add("문안[TTS]"); this.dgvOrderDetail.Rows.Add("문안[CBS]"); this.dgvOrderDetail.Rows.Add("문안[Board]"); this.dgvOrderDetail.Rows.Add("문안[DMB]"); } }