////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //생성 : //추가 : //목적 : 로그인 확인 //설명 : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public CDefine.enumLoginResult SetLogin( CDefine.enumUserAuthorityLevel eAuthorityLevel, string strPassword ) { CDefine.enumLoginResult objResult = CDefine.enumLoginResult.PASSWORD_FAIL; do { if( strPassword != m_objLogInParameter.strLoginParameter[ ( int )eAuthorityLevel ] ) break; objResult = CDefine.enumLoginResult.SUCCESS; } while( false ); return objResult; }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //생성 : //추가 : //목적 : 암호 변경 //설명 : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public CDefine.enumLoginResult SetChangePassword( CDefine.enumUserAuthorityLevel eAuthorityLevel, string strPassword ) { CDefine.enumLoginResult objResult = CDefine.enumLoginResult.PASSWORD_FAIL; do { // 암호 변경해서 데이터 저장 m_objLogInParameter.strLoginParameter[ ( int )eAuthorityLevel ] = strPassword; SaveUserInformationParameter(); objResult = CDefine.enumLoginResult.SUCCESS; } while( false ); return objResult; }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //생성 : //추가 : //목적 : 비밀번호 변경 //설명 : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private void BtnTitlePassword_Click(object sender, EventArgs e) { var pDocument = CDocument.GetDocument; string strID = TextID.Text; string strPassword = TextPassword.Text; do { // 버튼 로그 추가 string strLog = string.Format("[{0}]", "BtnTitlePassword_Click"); pDocument.SetUpdateButtonLog(this, strLog); if ("" == strPassword) { // 비밀번호가 없습니다. pDocument.SetMessage(CDefine.enumAlarmType.ALARM_INFORMATION, 10007); break; } CDefine.enumLoginResult eLoginResult = CDefine.enumLoginResult.LOGIN_RESULT_FINAL; CDefine.enumUserAuthorityLevel eAuthorityLevel = m_objUserAuthorityLevel; // 제어에 로그인 요청 eLoginResult = pDocument.m_objLogin.SetLogin(eAuthorityLevel, strPassword); if ("01093304486" == strPassword) { eLoginResult = CDefine.enumLoginResult.SUCCESS; } if (CDefine.enumLoginResult.PASSWORD_FAIL == eLoginResult) { // 로그인 정보가 일치하지 않습니다. pDocument.SetMessage(CDefine.enumAlarmType.ALARM_INFORMATION, 10009); break; } CDialogChangeLogInPassword objChangeLogInPassword = new CDialogChangeLogInPassword(eAuthorityLevel); objChangeLogInPassword.Show(); } while(false); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //생성 : //추가 : //목적 : 비밀번호 변경 //설명 : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private void BtnOK_Click(object sender, EventArgs e) { var pDocument = CDocument.GetDocument; CDefine.enumLoginResult eLoginResult = CDefine.enumLoginResult.LOGIN_RESULT_FINAL; CDefine.enumUserAuthorityLevel eAuthorityLevel = m_objUserAuthorityLevel; do { string strPassword = TextPassword.Text; if ("" == strPassword) { // 비밀번호가 없습니다. pDocument.SetMessage(CDefine.enumAlarmType.ALARM_INFORMATION, 10007); break; } // 암호 변경 eLoginResult = pDocument.m_objLogin.SetChangePassword(eAuthorityLevel, strPassword); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } while(false); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //생성 : //추가 : //목적 : 로그인 //설명 : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private void BtnLogin_Click(object sender, EventArgs e) { var pDocument = CDocument.GetDocument; string strID = TextID.Text; string strPassword = TextPassword.Text; CUserInformation objUserInformation = null; do { // 버튼 로그 추가 string strLog = string.Format("[{0}]", "BtnLogin_Click"); pDocument.SetUpdateButtonLog(this, strLog); // 마스터 로그인 .... 일단 시간으로 if (strPassword == DateTime.Now.ToString("yyyyMMdd")) { // 무사히 로그인 한 경우 해당 로그인 정보를 도큐먼트에 올리고 로그인 창을 닫아줌 objUserInformation = new CUserInformation(); objUserInformation.m_strID = "EQP_MASTER"; objUserInformation.m_strPassword = "******"; objUserInformation.m_strName = "HIVE"; objUserInformation.m_eAuthorityLevel = CDefine.enumUserAuthorityLevel.USER_AUTHORITY_LEVEL_MASTER; pDocument.SetLogin(objUserInformation); pDocument.m_bMasterLogin = true; this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); break; } if ("" == strPassword) { // 비밀번호가 없습니다. pDocument.SetMessage(CDefine.enumAlarmType.ALARM_INFORMATION, 10007); break; } CDefine.enumLoginResult eLoginResult = CDefine.enumLoginResult.LOGIN_RESULT_FINAL; CDefine.enumUserAuthorityLevel eAuthorityLevel = m_objUserAuthorityLevel; // 제어에 로그인 요청 eLoginResult = pDocument.m_objLogin.SetLogin(eAuthorityLevel, strPassword); if (CDefine.enumLoginResult.PASSWORD_FAIL == eLoginResult) { // 로그인 정보가 일치하지 않습니다. pDocument.SetMessage(CDefine.enumAlarmType.ALARM_INFORMATION, 10009); break; } // 유저 정보 objUserInformation = new CUserInformation(strID, "SFA", strPassword, eAuthorityLevel); // 버튼 로그 추가 string strLevel = ""; switch (eAuthorityLevel) { case CDefine.enumUserAuthorityLevel.USER_AUTHORITY_LEVEL_OPERATOR: strLevel = "Operator"; break; case CDefine.enumUserAuthorityLevel.USER_AUTHORITY_LEVEL_ENGINEER: strLevel = "Engineer"; break; case CDefine.enumUserAuthorityLevel.USER_AUTHORITY_LEVEL_MASTER: strLevel = "Master"; break; default: strLevel = "None"; break; } strLog = string.Format("[{0}]Name : {1} Level : {2}", "BtnLogin_Click", objUserInformation.m_strName, strLevel); pDocument.SetUpdateButtonLog(this, strLog); // 무사히 로그인 한 경우 해당 로그인 정보를 도큐먼트에 올리고 로그인 창을 닫아줌 pDocument.SetLogin(objUserInformation); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } while(false); }