Exemplo n.º 1
0
        private void InitializeSystemKindInfo()
        {
            this.cmbboxSystemKind.Items.Clear();

            // "시스템 전체"
            this.cmbboxSystemKind.Items.Add(entireSystemKind);
            this.cmbboxSystemKind.SelectedIndex = 0;

            // 각 종류 추가
            if (BasisData.SASKindInfo == null ||
                BasisData.SASKindInfo.Values == null)
            {
                return;
            }

            foreach (SASKind kind in BasisData.SASKindInfo.Values)
            {
                if (kind == null)
                {
                    continue;
                }

                SASKind copy = new SASKind();
                copy.DeepCopyFrom(kind);

                int itemIndex = this.cmbboxSystemKind.Items.Add(copy);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 발령대상으로 선택된 지역 정보를 그룹 프로필 정보에 반영.
        /// </summary>
        public void ReflectTargetSystemKinds()
        {
            if (this.currentProfile.TargetSystemKinds == null)
            {
                this.currentProfile.TargetSystemKinds = new List <string>();
            }
            this.currentProfile.TargetSystemKinds.Clear();

            if (this.chkListBoxSASKind.CheckedItems != null)
            {
                foreach (object obj in this.chkListBoxSASKind.CheckedItems)
                {
                    if (obj == null)
                    {
                        continue;
                    }

                    SASKind kind = obj as SASKind;
                    if (kind == null)
                    {
                        continue;
                    }

                    this.currentProfile.TargetSystemKinds.Add(kind.Code);
                }
            }
        }
Exemplo n.º 3
0
        private void InitializeSystemKindInfo()
        {
            // 각 종류 추가
            if (BasisData.SASKindInfo == null ||
                BasisData.SASKindInfo.Values == null)
            {
                return;
            }

            foreach (SASKind kind in BasisData.SASKindInfo.Values)
            {
                if (kind == null)
                {
                    continue;
                }
                SASKind copy = new SASKind();
                copy.DeepCopyFrom(kind);

                int itemIndex = this.chkListBoxSASKind.Items.Add(copy);
                if (itemIndex >= 0)
                {
                    this.chkListBoxSASKind.SetItemChecked(itemIndex, true);
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// [표준경보시스템 종류 선택]
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmbboxSystemKind_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox cmbbox = sender as ComboBox;

            if (cmbbox == null)
            {
                return;
            }
            SASKind systemKind = cmbbox.SelectedItem as SASKind;

            if (systemKind == null)
            {
                return;
            }

            this.filter.SystemKindCode = systemKind.Code;
        }
Exemplo n.º 5
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.None;

            bool isAllSelected = false;

            this.currentSelList.Clear();

            if (this.chkListBoxStdAlertSystemKind.CheckedItems == null || this.chkListBoxStdAlertSystemKind.CheckedItems.Count == 0)
            {
                MessageBox.Show("하나 이상의 표준경보시스템 종류를 선택해야 합니다.");
                this.DialogResult = System.Windows.Forms.DialogResult.None;
                return;
            }
            else
            {
                for (int index = 0; index < this.chkListBoxStdAlertSystemKind.CheckedItems.Count; index++)
                {
                    SASKind kindInfo = this.chkListBoxStdAlertSystemKind.CheckedItems[index] as SASKind;
                    if (kindInfo == null)
                    {
                        continue;
                    }
                    this.currentSelList.Add(kindInfo);
                }
                if (this.currentSelList.Count == this.chkListBoxStdAlertSystemKind.Items.Count)
                {
                    isAllSelected = true;
                }
            }

            if (this.NotifySASKindChanged != null)
            {
                this.NotifySASKindChanged(this, new SASKindEventArgs(isAllSelected, this.currentSelList));
            }

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
Exemplo n.º 6
0
        private void LoadForm(object sender, EventArgs e)
        {
            if (BasisData.SASKindInfo == null ||
                BasisData.SASKindInfo.Values == null)
            {
                return;
            }

            foreach (SASKind kind in BasisData.SASKindInfo.Values)
            {
                SASKind copy = new SASKind();
                copy.DeepCopyFrom(kind);

                int itemIndex = this.chkListBoxStdAlertSystemKind.Items.Add(copy);
                if (this.originalSelList.Count == 0)
                {
                    this.chkListBoxStdAlertSystemKind.SetItemCheckState(itemIndex, CheckState.Checked);
                }
            }

            for (int i = 0; i < this.originalSelList.Count; i++)
            {
                for (int index = 0; index < this.chkListBoxStdAlertSystemKind.Items.Count; index++)
                {
                    SASKind ctrlKind = this.chkListBoxStdAlertSystemKind.Items[index] as SASKind;
                    if (ctrlKind == null)
                    {
                        System.Console.WriteLine("[SelectionStdAlertSystemKind] 체크 리스트 => 오브젝트 변환 실패");
                        continue;
                    }

                    if (this.originalSelList[i].Code == ctrlKind.Code)
                    {
                        this.chkListBoxStdAlertSystemKind.SetItemChecked(index, true);
                        break;
                    }
                }
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 표준경보시스템 종류 선택 변경 통지 이벤트 핸들러
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void orderModeForm_OnNotifySASKindChanged(object sender, SASKindEventArgs e)
        {
            if (e.IsAllSelected || e.SelectedSystemKinds == null)
            {
                // 전체선택
                this.currentOrderInfo.TargetSystemsKinds = null;

                this.currentOrderInfo.Scope = CAPLib.ScopeType.Public;
            }
            else
            {
                this.currentOrderInfo.Scope = CAPLib.ScopeType.Restricted;

                this.currentOrderInfo.TargetSystemsKinds.Clear();
                foreach (SASKind kind in e.SelectedSystemKinds)
                {
                    SASKind copy = new SASKind();
                    copy.DeepCopyFrom(kind);
                    this.currentOrderInfo.TargetSystemsKinds.Add(copy);
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 프로필 정보에 기초하여 발령대상 시스템 종류를 표시.
        /// </summary>
        private void UpdateTargetSystemKinds()
        {
            if (this.currentProfile == null || this.chkListBoxSASKind.Items == null)
            {
                return;
            }
            if (this.currentProfile.TargetSystemKinds == null || this.currentProfile.TargetSystemKinds.Count < 1)
            {
                return;
            }

            for (int index = 0; index < this.chkListBoxSASKind.Items.Count; index++)
            {
                SASKind kind = this.chkListBoxSASKind.Items[index] as SASKind;
                if (kind == null)
                {
                    continue;
                }

                bool set = this.currentProfile.TargetSystemKinds.Contains(kind.Code);
                this.chkListBoxSASKind.SetItemChecked(index, set);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// [조회] 표준경보시스템 필터링
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnFiltering_Click(object sender, EventArgs e)
        {
            if (this.currentDicSystemInfo == null ||
                this.currentDicSystemInfo.Values == null || this.currentDicSystemInfo.Values.Count <= 0)
            {
                return;
            }

            // 현재의 조회결과 리스트를 클리어
            this.lstboxInquiredSASList.Items.Clear();


            bool    needRegionFilter1 = false;
            bool    needRegionFilter2 = false;
            bool    needKindFilter    = false;
            string  filterRegion1Code = string.Empty;
            string  filterRegion2Code = string.Empty;
            SASKind filterSystemKind  = null;

            if (this.cmbboxRegionLevel1.SelectedIndex > 0)
            {
                needRegionFilter1 = true;
                filterRegion1Code = this.filter.Region1Code.Trim('0');

                if (this.cmbboxRegionLevel2.SelectedIndex > 0)
                {
                    needRegionFilter2 = true;

                    int startIndex = filterRegion1Code.Length;
                    int count      = 10 - filterRegion1Code.Length;
                    filterRegion2Code = this.filter.Region2Code.Substring(startIndex, count).Trim('0');
                }
            }

            if (this.cmbboxSystemKind.SelectedIndex > 0)
            {
                needKindFilter   = true;
                filterSystemKind = this.cmbboxSystemKind.SelectedItem as SASKind;
            }

            foreach (SASProfile profile in this.currentDicSystemInfo.Values)
            {
                if (profile == null)
                {
                    continue;
                }

                if (needRegionFilter1)
                {
                    int    startIndex = 0;
                    int    count      = filterRegion1Code.Length;
                    string temp       = profile.AssignedIAGWRegionCode.Substring(startIndex, count);
                    if (temp != filterRegion1Code)
                    {
                        continue;
                    }
                }
                if (needRegionFilter2)
                {
                    int    startIndex = filterRegion1Code.Length;
                    int    count      = filterRegion2Code.Length;
                    string temp       = profile.AssignedIAGWRegionCode.Substring(startIndex, count);
                    if (temp != filterRegion2Code)
                    {
                        continue;
                    }
                }

                if (needKindFilter)
                {
                    if (profile.KindCode != filterSystemKind.Code)
                    {
                        continue;
                    }
                }

                this.lstboxInquiredSASList.Items.Add(profile);
            }
        }