示例#1
0
        /// <summary>
        /// 저장 버튼 클릭 이벤트
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (this.groupSelectComboBox.SelectedItem == null)
            {
                MessageBox.Show("저장할 그룹을 선택하세요.", "그룹정보 저장", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            GroupInfo groupInfo = this.groupSelectComboBox.SelectedItem as GroupInfo;
            bool      isHave    = false;

            foreach (GroupContent groupContent in this.lstGroupContent)
            {
                if (groupContent.Title == groupInfo.ButtonID)
                {
                    foreach (GroupContent grpContent in GroupContentMng.LstGroupContent)
                    {
                        if (grpContent.Title == groupContent.Title)
                        {
                            isHave = true;
                            break;
                        }
                    }

                    if (isHave)
                    {
                        foreach (GroupContent grpContent in GroupContentMng.LstGroupContent)
                        {
                            if (grpContent.Title == groupContent.Title)
                            {
                                grpContent.LstGroupData = groupContent.LstGroupData;
                            }
                        }
                    }
                    else
                    {
                        GroupContentMng.LstGroupContent.Add(groupContent);
                    }
                }
            }

            GroupContentMng.SaveGroupContent();
            MessageBox.Show("그룹정보가 저장되었습니다.", "그룹정보 저장", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#2
0
        /// <summary>
        /// OnLoad override method
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try
            {
                NCasBizActivator.Active(NCASBIZ.NCasDefine.NCasDefineActivatorCode.ForProv);
                this.InitMmfInfo(NCasUtilityMng.INCasEtcUtility.GetIPv4());
                NCasEnvironmentMng.NCasEnvConfig.NetSessionContext.UseConnectionChecking = true;
                NCasEnvironmentMng.NCasEnvConfig.NetSessionContext.UsePolling            = true;
                this.InitDualSession(NCasUtilityMng.INCasEtcUtility.GetIPv4());

                this.udpCasMon = new NCasUdpSocket();
                this.udpCasMon.Listen(IP_LOOPBACK, (int)NCasPortID.PortIdRecvCasMonData);
                this.udpCasMon.ReceivedData += new NCasUdpRecvEventHandler(udpCasMon_ReceivedData);

                this.recvUdpKey = new NCasUdpSocket();
                this.recvUdpKey.Listen(this.IP_LOOPBACK, (int)NCasPipes.PipePcaScreenPlc);
                this.recvUdpKey.ReceivedData += new NCasUdpRecvEventHandler(recvUdpKey_ReceivedData);

                this.recvUdpGis = new NCasUdpSocket();
                this.recvUdpGis.Listen(this.IP_LOOPBACK, (int)NCasPipes.PipePcaScreen);
                this.recvUdpGis.ReceivedData += new NCasUdpRecvEventHandler(recvUdpGis_ReceivedData);

                this.recvUdpLauncher = new NCasUdpSocket();
                this.recvUdpLauncher.Listen(this.IP_LOOPBACK, (int)NCasPipes.PipePcaScreenLauncher);
                this.recvUdpLauncher.ReceivedData += new NCasUdpRecvEventHandler(recvUdpLauncher_ReceivedData);

                this.recvCenterAlarm = new NCasUdpSocket();
                this.recvCenterAlarm.Listen(this.IP_LOOPBACK, (int)NCasPipes.PipePcaScreenAlm);
                this.recvCenterAlarm.ReceivedData += new NCasUdpRecvEventHandler(recvCenterAlarm_ReceivedData);

                KeyDataMng.LoadKeyDatas();
                DeviceStatusMng.LoadDeviceStatusDatas();
                PasswordMng.LoadPassword();
                GroupContentMng.LoadGroupContent();
                NCasContentsMng.LoadTtsOptionFromFile();
                TtsDelayTimeMng.LoadTtsDelayTime();
                TeleSendDelayTimeMng.LoadTeleDelayTime();

                this.ttsDelayTime  = int.Parse(TtsDelayTimeMng.TtsDelayTime);
                this.teleDelayTime = int.Parse(TeleSendDelayTimeMng.TeleDelayTime);
                this.pAlmScreenBiz = new PAlmScreenBiz(this);
                this.InitDeviceStatus();
                this.InitView();
                NCasAnimator.InitAnimator();
                this.OpenView(ViewKind.None);
                this.InitLogoImage(this.provInfo.Code);
                this.StartTimer(1000);
                this.Text = "민방위 시도 경보대시스템 " + NCasUtilityMng.INCasEtcUtility.GetVersionInfo();
                PDevInfo pDevInfo = this.mmfMng.GetPDevInfoByIp(NCasUtilityMng.INCasEtcUtility.GetIPv4());

                if (pDevInfo == null)
                {
                    MessageBox.Show("IP가 정상적이지 않습니다.\n네트워크를 확인하세요.", "시도 경보대시스템", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    NCasLoggingMng.ILogging.WriteLog("MainForm", "IP가 정상적이지 않습니다.");
                    return;
                }

                if (!(pDevInfo.DevId == NCasDefineDeviceKind.AlarmCtrlSys1 || pDevInfo.DevId == NCasDefineDeviceKind.AlarmCtrlSys2))
                {
                    MessageBox.Show("IP가 정상적이지 않습니다.\n네트워크를 확인하세요.", "시도 경보대시스템", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    NCasLoggingMng.ILogging.WriteLog("MainForm", "IP가 정상적이지 않습니다.");
                }

                NCasEnvironmentMng.NCasEnvConfig.LoggingContext.UseDebugLogging = true;
            }
            catch (Exception ex)
            {
                NCasLoggingMng.ILoggingException.WriteException("MainForm", "MainForm.OnLoad(EventArgs e) Method", ex);
                return;
            }
        }