Ejemplo n.º 1
0
        /// <summary>
        /// 리스트 아이템 더블클릭.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lvWaitToOrderSWRList_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                AdengListView view = sender as AdengListView;
                if (view == null || view.SelectedItems == null || view.SelectedItems.Count <= 0)
                {
                    return;
                }
                AdengListViewItem item = view.SelectedItems[0];
                if (item == null)
                {
                    return;
                }

                SWRProfile profile = item.Tag as SWRProfile;
                if (profile == null)
                {
                    return;
                }

                SWRWarningItemDetailForm detailForm = new SWRWarningItemDetailForm(profile);
                detailForm.ShowDialog(this);
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("[WaitToOrderForm] lvWaitToOrderSWRList_DoubleClick( Exception: \n" + ex.ToString() + ")");
                FileLogManager.GetInstance().WriteLog("[WaitToOrderForm] lvWaitToOrderSWRList_DoubleClick( Exception=[" + ex.ToString() + "] )");
            }
        }
Ejemplo n.º 2
0
        /// <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() + "] )");
            }
        }
Ejemplo n.º 3
0
        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++;
            }
        }
Ejemplo n.º 4
0
        /// <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;
            }
        }
Ejemplo n.º 5
0
        private void UpdateProgramHistoryList(List <Log> logList)
        {
            this.lvProgramHistoryList.Items.Clear();
            if (this.lvProgramHistoryList.Columns == null)
            {
                return;
            }

            if (logList == null || logList.Count < 1)
            {
                return;
            }

            int count = logList.Count;

            if (count > PROGRAM_HISTORY_LIMIT_CNT)
            {
                count = PROGRAM_HISTORY_LIMIT_CNT;
            }
            for (int index = 0; index < count; index++)
            {
                Log log = logList.ElementAt(count - 1 - index);
                if (log == null)
                {
                    break;
                }

                // 상태 아이콘
                AdengListViewItem item = this.lvProgramHistoryList.Items.Add("");
                item.ImageIndex = 0;
                if (log.Kind.ToUpper() == "ERROR")
                {
                    item.ImageIndex = 1;
                }

                // 종류
                item.SubItems.Add(log.Kind);

                // 날짜
                item.SubItems.Add(log.Date);

                // 시간
                item.SubItems.Add(log.Time);

                // 내용
                item.SubItems.Add(log.Message);
            }
        }
Ejemplo n.º 6
0
        /// <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() + "] )");
            }
        }
Ejemplo n.º 7
0
        private void UpdateAccountList()
        {
            this.lvAccountList.Items.Clear();

            if (this.currentAccountList == null)
            {
                return;
            }
            foreach (UserAccount account in this.currentAccountList)
            {
                AdengListViewItem item = this.lvAccountList.Items.Add(account.ID);
                item.SubItems.Add(account.Name);

                item.Tag = account;
            }
        }
Ejemplo n.º 8
0
        private void UpdateSelectedOrderList()
        {
            this.lvSelectedOrder.Items.Clear();

            if (this.lvSelectedOrder.Columns == null)
            {
                return;
            }
            if (this.currentOrderRecord == null)
            {
                return;
            }

            // 발령 결과
            AdengListViewItem item = this.lvSelectedOrder.Items.Add(" ");

            // 발령 시각
            item.SubItems.Add(this.currentOrderRecord.OrderedTime.ToString());
            // 발령지 구분
            item.SubItems.Add(BasisData.GetDisplayStringLocationKindName(this.currentOrderRecord.LocationKind));
            // 발령 모드
            item.SubItems.Add(BasisData.GetDisplayStringOrderMode(this.currentOrderRecord.OrderMode));
            // 재난 종류
            item.SubItems.Add(BasisData.GetDisplayStringDisasterKindName(this.currentOrderRecord.DisasterKindCode));
            // 비고(참조 정보)
            if (!string.IsNullOrEmpty(currentOrderRecord.RefRecordID))
            {
                if (currentOrderRecord.RefType == OrderReferenceType.Cancel)
                {
                    item.SubItems.Add("[발령취소] " + currentOrderRecord.RefRecordID);
                }
                else
                {
                    item.SubItems.Add(currentOrderRecord.RefRecordID);
                }
            }

            item.Name = this.currentOrderRecord.CAPID;
            item.Tag  = this.currentOrderRecord;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// [경보 상황 해제 대기 목록] 더블 클릭.
        /// 기발령 정보의 상세 내용을 표시한다.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lvClearWaitingList_DoubleClick(object sender, EventArgs e)
        {
            AdengListView view = sender as AdengListView;

            if (view == null || view.SelectedItems == null || view.SelectedItems.Count <= 0)
            {
                return;
            }
            AdengListViewItem item = view.SelectedItems[0];

            if (item == null)
            {
                return;
            }

            //OrderRecordDetails details = new OrderRecordDetails();
            //Size defaultSize = details.Size;
            //details.Left = this.Right;
            //details.Top = this.Top;
            //details.Size = defaultSize;
            //details.ShowDialog(this);
        }
Ejemplo n.º 10
0
        private void UpdateResponseList()
        {
            this.lvOrderResponse.Items.Clear();

            if (this.lvOrderResponse.Columns == null)
            {
                return;
            }
            if (this.currentResponseList == null)
            {
                return;
            }

            Dictionary <string, SASProfile> sasProfiles = new Dictionary <string, SASProfile>();
            List <SASProfile> sasList = DBManager.GetInstance().QuerySASInfo();

            if (sasList != null)
            {
                foreach (SASProfile profile in sasList)
                {
                    sasProfiles.Add(profile.ID, profile);
                }
            }

            bool isAllOK = true;
            bool isAllNG = true;

            foreach (OrderResponseProfile response in this.currentResponseList)
            {
                if (response == null)
                {
                    continue;
                }

                bool existOK = false;
                bool existNG = false;

                // 발령 결과
                AdengListViewItem item = this.lvOrderResponse.Items.Add(" ");
                item.ForeColor        = Color.Gray;
                item.SubItems[0].Text = "?";
                // 응답 시스템 이름
                if (sasProfiles.ContainsKey(response.SenderID))
                {
                    item.SubItems.Add(sasProfiles[response.SenderID].Name);
                }
                else
                {
                    item.SubItems.Add(response.SenderID);
                }

                if (string.IsNullOrEmpty(response.CapMsg))
                {
                    // 리소스 인증
                    item.SubItems.Add("");
                    // 경보 서비스
                    item.SubItems.Add("");
                    // 수행 결과
                    item.SubItems.Add("");
                }
                else
                {
                    CAP capMsg = new CAP(response.CapMsg);
                    if (capMsg == null)
                    {
                        continue;
                    }
                    if (capMsg == null || capMsg.MessageType == null ||
                        (capMsg.MessageType.Value != MsgType.Ack && capMsg.MessageType.Value != MsgType.Error))
                    {
                        MessageBox.Show("올바르지 않는 데이터가 존재합니다.", "데이터 오류", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        break;
                    }
                    if (string.IsNullOrEmpty(capMsg.Note))
                    {
                        continue;
                    }
                    string[] seperator = { " ", };
                    string[] resAll    = capMsg.Note.Split(seperator, StringSplitOptions.RemoveEmptyEntries);
                    if (resAll == null || resAll.Count() < 1)
                    {
                        continue;
                    }
                    string responseCodeStr = resAll[0];
                    int    responseCode    = -1;
                    if (!int.TryParse(responseCodeStr, out responseCode))
                    {
                        responseCode = -1;
                    }

                    // 리소스 인증
                    if (responseCode < (int)OrderResponseCodes.SasResourceCerciticationOK)
                    {
                        item.SubItems.Add("");
                    }
                    else if (responseCode >= (int)OrderResponseCodes.SasResourceCerciticationOK &&
                             responseCode != (int)OrderResponseCodes.SasResourceCerciticationNG)
                    {
                        item.SubItems.Add("성공");
                        existOK = true;
                    }
                    else
                    {
                        item.SubItems.Add("실패");
                        existNG = true;
                    }

                    // 경보 서비스
                    if (responseCode < (int)OrderResponseCodes.SasAlertServiceOK)
                    {
                        item.SubItems.Add("");
                    }
                    else if (responseCode >= (int)OrderResponseCodes.SasAlertServiceOK &&
                             responseCode != (int)OrderResponseCodes.SasAlertServiceError)
                    {
                        item.SubItems.Add("성공");
                        existOK = true;
                    }
                    else
                    {
                        item.SubItems.Add("실패");
                        existNG = true;
                    }

                    // 수행 결과 (전체/성공/실패)
                    if (resAll.Count() > 1 && !string.IsNullOrEmpty(resAll[1]))
                    {
                        string res = resAll[1].Replace(",", "/");
                        item.SubItems.Add(res);
                    }


                    if (existNG)
                    {
                        // 하나라도 실패가 있으면 실패로 표시
                        item.ForeColor        = Color.Red;
                        item.SubItems[0].Text = "X";

                        isAllOK = false;
                    }
                    else if (existOK)
                    {
                        if (responseCode == 800)
                        {
                            // 성공
                            item.ForeColor        = Color.Black;
                            item.SubItems[0].Text = "O";

                            isAllNG = false;
                        }
                        else
                        {
                            // 하나라도 성공이 있으면 응답중
                            item.ForeColor        = Color.Black;
                            item.SubItems[0].Text = "△";
                        }
                    }
                    else
                    {
                        // 아무 것도 없으면 무응답
                        item.ForeColor        = Color.Gray;
                        item.SubItems[0].Text = "?";
                    }
                }
            }

            if (isAllOK)
            {
                this.lvSelectedOrder.Items[0].SubItems[0].Text = "O";
            }
            else if (isAllNG)
            {
                this.lvSelectedOrder.Items[0].SubItems[0].Text = "X";
            }
            else
            {
                this.lvSelectedOrder.Items[0].SubItems[0].Text = "△";
            }
        }