private void CFormTeachOutputBufferStage_VisibleChanged(object sender, EventArgs e)
        {
            CFormCommon objForm = sender as CFormCommon;

            if (true == objForm.Visible)
            {
                // 해당 폼을 말단으로 설정
                m_objDocument.GetMainFrame().SetCurrentForm(objForm);
            }
        }
Beispiel #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);
        }