Example #1
0
 //사용자로부터 입력받는 ID,PW칸이 비어있는지 확인
 private bool ControlCheck()
 {
     if (String.IsNullOrEmpty(UserID.Text))
     {
         MessageBox.Show("Please enter your ID and password.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         UserID.Focus();
         return(false);
     }
     else if (String.IsNullOrEmpty(UserPW.Text))
     {
         MessageBox.Show("Please enter your username and password.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         UserPW.Focus();
         return(false);
     }
     return(true);
 }
Example #2
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            LoginHandler loginHandler = new LoginHandler();

            if (ControlCheck())
            {
                if (loginHandler.LoginCheck(UserID.Text, UserPW.Text)) //loginHandler 객체를 통한 아이디 비밀번호 체크
                {
                    string userName = UserID.Text;
                    loginEventHandler(userName);
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("Login information is incorrect.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    UserID.Clear();
                    UserPW.Clear();
                }
            }
        }