コード例 #1
0
        private List <MsgText> GetMsgTextByCurrentConditions()
        {
            if (this.lstboxDisasterKind.SelectedIndex < 0)
            {
                return(null);
            }
            if (this.lstboxLanguageKind.SelectedIndex < 0)
            {
                return(null);
            }
            if (this.lstboxCityType.SelectedIndex < 0)
            {
                return(null);
            }

            DisasterKind kindInfo = lstboxDisasterKind.SelectedItem as DisasterKind;
            MsgTextDisplayLanguageKind selectedLangKind = this.lstboxLanguageKind.SelectedItem as MsgTextDisplayLanguageKind;
            MsgTextCityType            selectedCityType = this.lstboxCityType.SelectedItem as MsgTextCityType;

            if (kindInfo == null || selectedLangKind == null || selectedCityType == null)
            {
                return(null);
            }

            List <MsgText> msgInfo = BasisData.FindMsgTextInfoByDisasterCode(kindInfo.Code);

            if (msgInfo == null)
            {
                return(null);
            }

            List <MsgText> result = null;

            foreach (MsgText txt in msgInfo)
            {
                if (txt.LanguageKindID != selectedLangKind.ID)
                {
                    continue;
                }
                if (txt.CityTypeID != selectedCityType.ID)
                {
                    continue;
                }

                if (result == null)
                {
                    result = new List <MsgText>();
                }
                MsgText copy = new MsgText();
                copy.DeepCopyFrom(txt);

                result.Add(copy);
            }

            return(result);
        }
コード例 #2
0
        /// <summary>
        /// [언어 종류] 초기 설정.
        /// </summary>
        /// <returns></returns>
        private bool InitializeLanguageKindListBox()
        {
            this.lstboxLanguageKind.Items.Clear();
            if (BasisData.MsgTextLanguageKind == null || BasisData.MsgTextLanguageKind.Count < 1)
            {
                return(false);
            }

            foreach (MsgTextDisplayLanguageKind language in BasisData.MsgTextLanguageKind)
            {
                MsgTextDisplayLanguageKind copy = new MsgTextDisplayLanguageKind();
                copy.DeepCopyFrom(language);

                this.lstboxLanguageKind.Items.Add(copy);
            }

            return(true);
        }
コード例 #3
0
ファイル: OrderForm.cs プロジェクト: jay-JYPark/CAP-System
        private void CheckDefaultSet()
        {
            if (this.currentOrderInfo == null)
            {
                this.currentOrderInfo = new OrderProvisionInfo();
            }

            // 발령 모드
            if (this.currentOrderInfo.Mode == null)
            {
                //this.currentOrderInfo.Mode = BasisData.FindOrderModeInfoByCode(CAPLib.StatusType.Actual);
                this.currentOrderInfo.Mode = BasisData.FindOrderModeInfoByCode(CAPLib.StatusType.Test);
            }

            // 재난 정보
            if (this.currentOrderInfo.Disaster == null)
            {
                this.currentOrderInfo.Disaster = new Disaster();
            }
            if (this.currentOrderInfo.Disaster.Category == null)
            {
                this.currentOrderInfo.Disaster.Category = new DisasterCategory();
            }
            if (this.currentOrderInfo.Disaster.Kind == null)
            {
                this.currentOrderInfo.Disaster.Kind = new DisasterKind();
            }

            // 문안 정보
            if (this.currentOrderInfo.MsgTextInfo == null)
            {
                this.currentOrderInfo.MsgTextInfo = new SendingMsgTextInfo();
            }
            if (this.currentOrderInfo.MsgTextInfo.CurrentTransmitMsgText == null)
            {
                this.currentOrderInfo.MsgTextInfo.CurrentTransmitMsgText = new List <MsgText>();
            }
            if (this.currentOrderInfo.MsgTextInfo.OriginalTransmitMsgText == null)
            {
                this.currentOrderInfo.MsgTextInfo.OriginalTransmitMsgText = new List <MsgText>();
            }
            if (this.currentOrderInfo.MsgTextInfo.SelectedLanguages == null)
            {
                this.currentOrderInfo.MsgTextInfo.SelectedLanguages = new List <MsgTextDisplayLanguageKind>();
            }
            if (this.currentOrderInfo.MsgTextInfo.SelectedLanguages.Count < 1)
            {
                MsgTextDisplayLanguageKind defaultLanguage = BasisData.FindMsgTextLanguageInfoByCode(BasisData.DEFAULT_LANGUAGECODE);
                this.currentOrderInfo.MsgTextInfo.SelectedLanguages.Add(defaultLanguage);

                foreach (MsgTextDisplayLanguageKind language in BasisData.MsgTextLanguageKind)
                {
                    if (language.LanguageCode == BasisData.DEFAULT_LANGUAGECODE)
                    {
                        continue;
                    }
                    if (language.IsDefault)
                    {
                        MsgTextDisplayLanguageKind copy = new MsgTextDisplayLanguageKind();
                        copy.DeepCopyFrom(language);
                        this.currentOrderInfo.MsgTextInfo.SelectedLanguages.Add(copy);
                    }
                }
            }
            if (this.currentOrderInfo.MsgTextInfo.SelectedCityType == null)
            {
                this.currentOrderInfo.MsgTextInfo.SelectedCityType = new MsgTextCityType();
            }

            // 발령 대상
            if (this.currentOrderInfo.TargetRegions == null)
            {
                this.currentOrderInfo.TargetRegions = new List <DataClass.RegionDefinition>();
            }
            if (this.currentOrderInfo.TargetSystems == null)
            {
                this.currentOrderInfo.TargetSystems = new List <SASProfile>();
            }
            // 발령 대상 시스템 종류
            if (this.currentOrderInfo.TargetSystemsKinds == null)
            {
                this.currentOrderInfo.TargetSystemsKinds = new List <SASKind>();
                // 디폴트는 ALL 이므로, 오브젝트는 존재하되 카운트는 0
            }

            // 발령지 구분 (고정값: 자체 발령)
            if (this.currentOrderInfo.LocationKind == OrderLocationKind.Unknown)
            {
                this.currentOrderInfo.LocationKind = OrderLocationKind.Local;
            }

            //
            if (this.currentOrderInfo.CAPData == null)
            {
                this.currentOrderInfo.CAPData = new CAPLib.CAP();
            }
        }