/// <summary> /// 리스트 갱신. /// </summary> private void UpdateReportList() { try { this.lvWaitToOrderSWRList.Items.Clear(); if (this.currentWaitingList == null || this.currentWaitingList.Count <= 0) { return; } CAPHelper helper = new CAPHelper(); foreach (SWRProfile profile in this.currentWaitingList) { if (profile == null) { continue; } SWRWarningItemProfile warningItem = profile.GetWarningItemProfile(); if (warningItem == null) { continue; } // ReportId: 특보 아이디 AdengListViewItem newItem = this.lvWaitToOrderSWRList.Items.Add(warningItem.ReportID); // AnnounceTime: 발표 시각 newItem.SubItems.Add(warningItem.AnnounceTime.ToString()); // AreaName: 특보 구역 string targetAreaNames = profile.GetTargetAreaNames(); if (!string.IsNullOrEmpty(targetAreaNames)) { newItem.SubItems.Add(targetAreaNames); } else { newItem.SubItems.Add("Unknown(" + profile.TargetAreas + ")"); } // WarnKind: 특보 종류 string kind = BasisData.FindSWRKindStringByKindCode(profile.WarnKindCode); string stress = BasisData.FindSWRStressStringByStressCode(profile.WarnStressCode); newItem.SubItems.Add(kind + " " + stress); // CommandCode: 발표 코드 string command = BasisData.FindSWRCommandStringByCommandCode(profile.CommandCode); newItem.SubItems.Add(command); newItem.Name = profile.ID; newItem.Tag = profile; } } catch (Exception ex) { System.Console.WriteLine("[WaitToOrderForm] UpdateReportList( Exception: \n" + ex.ToString() + ")"); FileLogManager.GetInstance().WriteLog("[WaitToOrderForm] UpdateReportList( Exception=[" + ex.ToString() + "] )"); } }
private void SetHeadline() { if (this.currentOrderInfo.RefType == OrderReferenceType.SWR) { if (this.currentOrderInfo.Tag == null) { return; } SWRProfile profile = this.currentOrderInfo.Tag as SWRProfile; if (profile == null) { return; } SWRWarningItemProfile warningItem = profile.GetWarningItemProfile(); if (warningItem == null) { return; } StringBuilder builder = new StringBuilder("[기상특보연계] "); if (warningItem.AnnounceTime.Ticks > 0) { builder.Append(warningItem.AnnounceTime.ToString()); } string areaNames = profile.GetTargetAreaNames(); if (!string.IsNullOrEmpty(areaNames)) { builder.Append(" " + areaNames); } if (!string.IsNullOrEmpty(profile.WarnKindCode)) { string kindName = BasisData.FindSWRKindStringByKindCode(profile.WarnKindCode); if (!string.IsNullOrEmpty(kindName)) { builder.Append(" " + kindName); } } if (!string.IsNullOrEmpty(profile.WarnStressCode)) { string stressName = BasisData.FindSWRStressStringByStressCode(profile.WarnStressCode); if (!string.IsNullOrEmpty(stressName)) { builder.Append(" " + stressName); } } if (!string.IsNullOrEmpty(profile.CommandCode)) { string commandName = BasisData.FindSWRCommandStringByCommandCode(profile.CommandCode); if (!string.IsNullOrEmpty(commandName)) { builder.Append(" " + commandName); } } this.lblHeadline.Text = builder.ToString(); } }
/// <summary> /// 기상특보통보문 상세 리스트 갱신. /// </summary> private void UpdateItemDetailList() { this.dgvItemDetail.Rows.Clear(); if (this.dgvItemDetail.Columns == null) { return; } if (this.currentProfile == null) { MessageBox.Show("데이터가 존재하지 않습니다.", "기상특보상세", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } SWRWarningItemProfile profile = this.currentProfile.GetWarningItemProfile(); if (profile == null) { MessageBox.Show("데이터 변환 중 오류가 발생하였습니다.", "기상특보상세", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.dgvItemDetail.Rows.Add("지점코드", profile.StationID); if (profile.AnnounceTime.Ticks > 0) { this.dgvItemDetail.Rows.Add("발표시각", profile.AnnounceTime.ToString()); } else { this.dgvItemDetail.Rows.Add("발표시각", "-"); } this.dgvItemDetail.Rows.Add("발표번호(월별)", profile.SequenceNo.ToString()); this.dgvItemDetail.Rows.Add("특보발표코드", profile.CommandCode); this.dgvItemDetail.Rows.Add("제목", profile.Title); this.dgvItemDetail.Rows.Add("해당구역", profile.TargetAreas); this.dgvItemDetail.Rows.Add("발효시각", profile.EffectStartInfo); this.dgvItemDetail.Rows.Add("내용", profile.Contents); if (profile.PresentConditionTime.Ticks > 0) { this.dgvItemDetail.Rows.Add("특보발효현황시각", profile.PresentConditionTime.ToString()); } else { this.dgvItemDetail.Rows.Add("특보발효현황시각", "-"); } this.dgvItemDetail.Rows.Add("특보발효현황내용", profile.PresentConditionContents.ToString()); this.dgvItemDetail.Rows.Add("예비특보발효현황", profile.PreliminaryConditionContents); this.dgvItemDetail.Rows.Add("참고사항", profile.Other); }
private void UpdateHeadline() { SWRWarningItemProfile profile = this.currentProfile.GetWarningItemProfile(); if (profile == null) { MessageBox.Show("데이터 변환 중 오류가 발생하였습니다.", "기상특보상세", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } List <string> elements = new List <string>(); elements.Add(profile.AnnounceTime.ToString()); elements.Add(this.currentProfile.GetTargetAreaNames()); string swrKind = BasisData.FindSWRKindStringByKindCode(this.currentProfile.WarnKindCode); if (string.IsNullOrEmpty(swrKind)) { elements.Add("Unknown(" + this.currentProfile.WarnKindCode + ")"); } else { elements.Add(" " + swrKind); } string swrStress = BasisData.FindSWRStressStringByStressCode(this.currentProfile.WarnStressCode); if (string.IsNullOrEmpty(swrStress)) { elements.Add("Unknown(" + this.currentProfile.WarnStressCode + ")"); } else { elements.Add(" " + swrStress); } string swrCommand = BasisData.FindSWRCommandStringByCommandCode(this.currentProfile.CommandCode); if (string.IsNullOrEmpty(swrCommand)) { elements.Add("Unknown(" + this.currentProfile.CommandCode + ")"); } else { elements.Add(" " + swrCommand); } this.lblReportHeadline.Text = string.Join(" ", elements); }