////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //생성 : //추가 : //목적 : 특정 Form View를 리턴 //설명 : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public Form GetFormView(CDefine.FormView eView) { Form objForm = null; do { if (null == m_stForm[( int )eView].m_objForm) { break; } objForm = m_stForm[( int )eView].m_objForm; } while(false); return(objForm); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //생성 : //추가 : //목적 : 유저 권한 레벨에 따라 버튼 상태 변경 //설명 : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void SetChangeButtonStatus(CDocument objDocument, Control.ControlCollection collection, CDefine.FormView eFormView) { 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 (( int )objUserInformation.m_eAuthorityLevel < ( int )objDocument.m_objAuthorityParameter.m_objLevelForm[( int )eFormView].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); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //생성 : //추가 : //목적 : 폼 변경 //설명 : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void SetChangeForm(CDefine.FormView eForm) { do { // 현재 폼이 이전 폼과 같으면 건너뜀 if (m_eCurrentForm == eForm) { break; } // 현재 폼 Invisible if (CDefine.FormView.FORM_VIEW_FINAL != m_eCurrentForm) { m_stForm[( int )m_eCurrentForm].m_IForm.SetVisible(false); m_stForm[( int )m_eCurrentForm].m_IForm.SetTimer(false); } // 생성이 되어 있지 않으면 생성 if (null == m_stForm[( int )eForm].m_IForm) { switch (eForm) { case CDefine.FormView.FORM_VIEW_MAIN: m_stForm[( int )eForm] = new structureForm(new CFormMain() as CFormInterface); break; case CDefine.FormView.FORM_VIEW_SETUP: m_stForm[( int )eForm] = new structureForm(new CFormSetup() as CFormInterface); break; case CDefine.FormView.FORM_VIEW_CONFIG: m_stForm[( int )eForm] = new structureForm(new CFormConfig() as CFormInterface); break; case CDefine.FormView.FORM_VIEW_IO: m_stForm[( int )eForm] = new structureForm(new CFormCommunication() as CFormInterface); break; case CDefine.FormView.FORM_VIEW_REPORT: m_stForm[( int )eForm] = new structureForm(new CFormReport() as CFormInterface); break; default: break; } // 패널에 생성된 화면 붙임 SetFormDockStyle(m_stForm[( int )eForm].m_objForm, this.panelView); m_stForm[( int )eForm].m_IForm.SetVisible(true); m_stForm[( int )eForm].m_IForm.SetTimer(true); m_stForm[( int )eForm].m_IForm.SetChangeLanguage(); } // 생성 되어 있으면 Visible else { m_stForm[( int )eForm].m_IForm.SetVisible(true); m_stForm[( int )eForm].m_IForm.SetTimer(true); m_stForm[( int )eForm].m_IForm.SetChangeLanguage(); } m_eCurrentForm = eForm; } while(false); }