Beispiel #1
0
        /// <summary>
        /// [ ▷ ] 버튼 클릭 이벤트 핸들러.
        /// 선택한 대상을 발령 대상으로 추가.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnToTarget_Click(object sender, EventArgs e)
        {
            if (this.lstboxInquiredSASList.SelectedItems == null ||
                this.lstboxInquiredSASList.SelectedItems.Count <= 0)
            {
                return;
            }

            if (this.currentProfile.Targets == null)
            {
                this.currentProfile.Targets = new List <string>();
            }

            foreach (object obj in this.lstboxInquiredSASList.SelectedItems)
            {
                if (obj == null)
                {
                    continue;
                }
                SASProfile profile = obj as SASProfile;
                if (profile == null)
                {
                    System.Console.WriteLine("[SystemGroupBaseForm] null?");
                    continue;
                }

                bool isAdded = AddToTarget(profile);
                if (isAdded)
                {
                    this.currentProfile.Targets.Add(profile.ID);
                }
            }

            this.lstboxInquiredSASList.SelectedItems.Clear();
        }
Beispiel #2
0
        /// <summary>
        /// 발령 대상 목록에 이미 추가된 프로필인지 확인하고 아니면 추가.
        /// </summary>
        /// <param name="newProfile"></param>
        /// <returns></returns>
        private bool AddToTarget(SASProfile newProfile)
        {
            if (this.lstboxTargetSASList.Items == null ||
                this.lstboxTargetSASList.Items.Count <= 0)
            {
                this.lstboxTargetSASList.Items.Add(newProfile);
                return(true);
            }

            bool isRegisted = this.lstboxTargetSASList.Items.Contains(newProfile);

            if (!isRegisted)
            {
                this.lstboxTargetSASList.Items.Add(newProfile);
                return(true);
            }

            return(false);
        }
Beispiel #3
0
        public void SetSASProfileList(Dictionary <string, SASProfile> profileList)
        {
            if (profileList != null && profileList.Values != null)
            {
                if (this.currentDicSystemInfo == null)
                {
                    this.currentDicSystemInfo = new Dictionary <string, SASProfile>();
                }

                foreach (SASProfile info in profileList.Values)
                {
                    if (info == null)
                    {
                        continue;
                    }

                    SASProfile profile = new SASProfile();
                    profile.DeepCopyFrom(info);
                    this.currentDicSystemInfo.Add(profile.ID, profile);
                }
            }
        }
Beispiel #4
0
        public void SetSASInfo(Dictionary <string, SASInfo> systemInfo)
        {
            if (systemInfo != null && systemInfo.Values != null)
            {
                if (this.currentDicSystemInfo == null)
                {
                    this.currentDicSystemInfo = new Dictionary <string, SASProfile>();
                }

                foreach (SASInfo info in systemInfo.Values)
                {
                    if (info == null || info.Profile == null)
                    {
                        continue;
                    }

                    SASProfile profile = new SASProfile();
                    profile.DeepCopyFrom(info.Profile);
                    this.currentDicSystemInfo.Add(profile.ID, profile);
                }
            }
        }