Пример #1
0
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //생성 :
 //추가 :
 //목적 : 생성자
 //설명 :
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 public CUserInformation(string strID, string strName, string strPassword, CDefine.enumUserAuthorityLevel eAuthorityLevel)
 {
     m_strID           = strID;
     m_strName         = strName;
     m_strPassword     = strPassword;
     m_eAuthorityLevel = eAuthorityLevel;
 }
Пример #2
0
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //생성 :
 //추가 :
 //목적 : 생성자
 //설명 :
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 public CUserInformation()
 {
     m_strID           = "Default";
     m_strName         = "Default";
     m_strPassword     = "";
     m_eAuthorityLevel = CDefine.enumUserAuthorityLevel.USER_AUTHORITY_LEVEL_FINAL;
 }
Пример #3
0
		//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		//생성 : 
		//추가 : 
		//목적 : 로그인 확인
		//설명 : 
		//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		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;
		}
Пример #4
0
		//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		//생성 : 
		//추가 : 
		//목적 : 암호 변경
		//설명 : 
		//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		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;
		}
Пример #5
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 비밀번호 변경
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        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);
        }
Пример #7
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 초기화
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private bool Initialize()
        {
            bool bReturn   = false;
            var  pDocument = CDocument.GetDocument;

            do
            {
                m_objUserAuthorityLevel = CDefine.enumUserAuthorityLevel.USER_AUTHORITY_LEVEL_OPERATOR;
                // 폼 초기화
                if (false == InitializeForm())
                {
                    break;
                }
                // 로그 아웃 true이면 로그 아웃
                if (true == m_bLogout)
                {
                    pDocument.SetLogout();
                }

                bReturn = true;
            } while(false);

            return(bReturn);
        }
Пример #8
0
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //생성 :
 //추가 :
 //목적 : 마스터 선택
 //설명 :
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 private void BtnMaster_Click(object sender, EventArgs e)
 {
     m_objUserAuthorityLevel = CDefine.enumUserAuthorityLevel.USER_AUTHORITY_LEVEL_MASTER;
     // 포커스 ID 버튼으로 이동
     this.ActiveControl = this.TextPassword;
 }
Пример #9
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 로그인
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        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);
        }
Пример #10
0
 public CDialogChangeLogInPassword(CDefine.enumUserAuthorityLevel eUserAuthorityLevel)
 {
     InitializeComponent();
     m_objUserAuthorityLevel = eUserAuthorityLevel;
     Initialize();
 }