Exemplo n.º 1
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 폼 초기화
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public bool InitializeForm()
        {
            bool bReturn = false;

            do
            {
                CMainFrame objFormMain = Owner as CMainFrame;
                m_objView = objFormMain.GetFormView() as CFormView;
                // 버튼 이어줌
                m_objMenu = new Button[( int )CDefine.FormView.FORM_VIEW_FINAL];
                m_objMenu[( int )CDefine.FormView.FORM_VIEW_MAIN]   = this.BtnMain;
                m_objMenu[( int )CDefine.FormView.FORM_VIEW_SETUP]  = this.BtnSetup;
                m_objMenu[( int )CDefine.FormView.FORM_VIEW_CONFIG] = this.BtnConfig;
                m_objMenu[( int )CDefine.FormView.FORM_VIEW_IO]     = this.BtnIO;
                m_objMenu[( int )CDefine.FormView.FORM_VIEW_REPORT] = this.BtnReport;
                // 버튼 색상 정의
                SetButtonColor();
                // 타이머 시작
                timer.Interval = 100;
                timer.Enabled  = true;

                bReturn = true;
            } while(false);

            return(bReturn);
        }
Exemplo n.º 2
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 유저 권한 레벨에 따라 버튼 상태 변경
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public void SetChangeButtonStatus(CDocument objDocument, Control.ControlCollection collection)
        {
            do
            {
                // 현재 폼 내에 생성된 컨트롤 리스트를 뽑음
                Control.ControlCollection objCollection = collection;
                // 그 중에서 Button & ImageButton만 사용할 예정
                List <Control> objButtonList = new List <Control>();
                // Button or ImageButton Type인 놈만 List에 저장
                for (int iLoopCollection = 0; iLoopCollection < objCollection.Count; iLoopCollection++)
                {
                    // Button Type
                    if (objCollection[iLoopCollection].GetType().Name == (new Button()).GetType().Name)
                    {
                        objButtonList.Add(objCollection[iLoopCollection] as Button);
                    }
                }
                // 현재 유저 정보 받음
                CUserInformation objUserInformation = objDocument.GetUserInformation();
                // 현재 유저 권한 레벨이 폼 Write 레벨보다 낮으면 버튼 막음
                CFormView objFormView = objDocument.GetMainFrame().GetFormView() as CFormView;
                if (null == objFormView)
                {
                    break;
                }
                // 처음 생성 시 튕김
                if (CDefine.FormView.FORM_VIEW_FINAL == objFormView.GetCurrentForm())
                {
                    break;
                }

                if (( int )objUserInformation.m_eAuthorityLevel < ( int )objDocument.m_objAuthorityParameter.m_objLevelForm[( int )objFormView.GetCurrentForm()].eLevelWrite)
                {
                    for (int iLoopButton = 0; iLoopButton < objButtonList.Count; iLoopButton++)
                    {
                        if (true == objButtonList[iLoopButton].Enabled)
                        {
                            objButtonList[iLoopButton].Enabled = false;
                        }
                    }
                }
                // 아니면 버튼 살림
                else
                {
                    for (int iLoopButton = 0; iLoopButton < objButtonList.Count; iLoopButton++)
                    {
                        if (false == objButtonList[iLoopButton].Enabled)
                        {
                            objButtonList[iLoopButton].Enabled = true;
                        }
                    }
                }
            } while(false);
        }