예제 #1
0
 public void UpdateValueByEnum(ParentCode parentCode, ChildCode childCode, object Value)
 {
     _isFileSave = true;
     ParentCode Child_Parent = (ParentCode)GEI.GetParameter<ChildCode>(childCode, 0);
     if (Child_Parent == parentCode)
     {
         this.SetValue(parentCode.ToString(), childCode.ToString(), Value);
     }
     else
     {
         throw new Exception("부모 코드와 자식 코드가 매칭되지 않습니다.");
     }
     _isFileSave = false;
 }
예제 #2
0
        /// <summary>
        /// 해당 환경설정 값 가져오기
        /// </summary>
        /// <param name="parentCode">환경설정 부모코드</param>
        /// <param name="childCode">환경설정 자식코드</param>
        /// <returns>환경설정 값</returns>
        public object GetValueByEnum(ParentCode parentCode, ChildCode childCode)
        {
            ParentCode Child_Parent = (ParentCode)GEI.GetParameter<ChildCode>(childCode, 0);

            if (Child_Parent == parentCode)
            {
                object ReturnObj = this.GetValue(parentCode.ToString(), childCode.ToString());
                // 사용자가 환경설정 값 저장을 안한 경우
                if (ReturnObj == null)
                {
                    // 기본 환경설정 값
                    string DefaultVal = GEI.GetParameter<ChildCode>(childCode, 1).ToString();
                    // 기본 환경설정 값 저장
                    this.UpdateValueByEnum(parentCode, childCode, DefaultVal);

                    // 다시 불러옴.
                    return this.GetValue(parentCode.ToString(), childCode.ToString());
                }

                return ReturnObj;
            }
            else
            {
                throw new Exception("부모 코드와 자식 코드가 매칭되지 않습니다.");
            }
        }