Exemplo n.º 1
0
        ///// <summary>
        ///// 로그인정보를 저장하는 메서드 -OJH
        ///// </summary>
        ///// <param name="loginCustomerVO">고객정보</param>
        //private void SetLoginInfo(mem list)
        //{
        //    if (list == null)
        //        return;
        //    LoginInfo.UserInfo.LI_ID = list.MANAGER_ID;
        //    LoginInfo.UserInfo.LI_NAME = list.MANAGER_NAME;
        //    LoginInfo.UserInfo.LI_DEPT = list.CUSTOMER_PHN_NBR;
        //}

        #endregion

        #region 이벤트

        /// <summary>
        /// 로그인 정보를 확인하고 로그인기능을 수행하는 이벤트 -OJH
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOK_Click(object sender, EventArgs e)
        {
            string userID   = ptxtID.Text.Trim();
            string password = ptxtPswd.Text.Trim();

            //로그인 정보 유효성확인
            bool bISIDValid   = ValidCheck.VaildText(ValidCheck.ContentTypes.ID, userID);
            bool bISPswdValid = ValidCheck.VaildText(ValidCheck.ContentTypes.Password, password);

            if (!(bISIDValid && bISPswdValid))
            {
                MessageBox.Show("ID와 비밀번호 형식을 확인하세요.", "로그인 정보 입력", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                ptxtID.Clear();
                ptxtPswd.Clear();
                return;
            }

            //DB확인
            LoginService service = new LoginService();

            if (!service.CheckLoginInfo(userID, password))
            {
                MessageBox.Show("존재하지 않는 사용자입니다. 로그인정보를 확인하세요.", "로그인 정보 확인", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                ptxtID.Clear();
                ptxtPswd.Clear();
                return;
            }
            else //로그인정보 일치
            {
                //관리자 정보 가져오기
                SaveLoginUserInfo(userID, service);
                this.DialogResult = DialogResult.OK;
                this.Close();
            }

            ////로그인 정보 저장 (userConfig)
            //SaveUserConfig(userID, password, ckbLoginSave);
            ////로그인 정보 저장  (전역변수)
            //if (loginType == 0) //고객
            //    SetLoginInfo(service.GetCustomerInfo(userID));
            //else
            //    SetLoginInfo(service.GetManagerInfo(userID));
        }
Exemplo n.º 2
0
        /// <summary>
        /// DB에 아이디 중복 조회하는 이벤트
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnStdCheck_Click(object sender, EventArgs e)
        {
            //유효값확인
            if (!ValidCheck.VaildText(ValidCheck.ContentTypes.ID, txtID.Text.Trim())) //유효값이 아닌경우
            {
                txtID.Clear();
                MessageBox.Show("아이디 형식을 확인해주세요.", "ID 형식 확인", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            //DB확인
            LoginService service = new LoginService();

            if (!service.CheckIDExist(txtID.Text.Trim()))
            {
                bIDCheck = true;
                MessageBox.Show("가입이 가능한 ID입니다.");
            }
            else
            {
                MessageBox.Show("이미 존재하는 ID입니다.");
                txtID.Clear();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 회원 등록 버튼 클릭시 발생하는 이벤트
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOK_Click(object sender, EventArgs e)
        {
            //ID중복검사여부 확인
            if (!bIDCheck)
            {
                MessageBox.Show("ID의 유효성 검사는 필수입니다.", "ID 중복검사", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            //값 입력 확인
            bool          isemptyTextExist = false;
            StringBuilder sb = new StringBuilder();

            foreach (var item in pnlContents.Controls)
            {
                if (item is TextBox)
                {
                    TextBox tb = item as TextBox;
                    if (tb.Text.Trim().Length < 1)
                    {
                        isemptyTextExist = true;
                        sb.AppendFormat($"<{tb.Tag.ToString()}>");
                    }
                }
            }
            if (isemptyTextExist)
            {
                MessageBox.Show(sb.ToString() + "항목을 입력해주세요.");
                return;
            }


            bool bPwdCheck  = ValidCheck.VaildText(ValidCheck.ContentTypes.Password, txtPwd.Text.Trim());
            bool bPwd2Check = (txtPwd.Text == txtPwdCheck.Text);
            bool bNameCheck = ValidCheck.VaildText(ValidCheck.ContentTypes.이름, txtName.Text.Trim());
            bool bEMLCheck  = ValidCheck.VaildText(ValidCheck.ContentTypes.Email, txtEML.Text.Trim());

            if (bIDCheck && bPwdCheck && bPwd2Check && bNameCheck && bEMLCheck)
            {
                MANAGER_VO mv = new MANAGER_VO
                {
                    MANAGER_ID = txtID.Text.Trim()
                    ,
                    MANAGER_NAME = txtName.Text.Trim()
                    ,
                    MANAGER_PSWD = txtPwd.Text.Trim()
                    ,
                    MANAGER_EML = txtEML.Text.Trim()
                    ,
                    MANAGER_DEP = cboDept.Text
                };

                //서비스호출
                LoginService service = new LoginService();
                Message      msg     = service.InsertOrUpdateManager(mv);
                if (msg.IsSuccess)
                {
                    MessageBox.Show(msg.ResultMessage);
                    this.Close();
                }
                else
                {
                    MessageBox.Show(msg.ResultMessage);
                    return;
                }
            }
            else
            {
                MessageBox.Show("유효한 값이 아닙니다. 입력항목들을 확인해주세요.", "입력값 확인", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
        }