private void tbEmail_TextChanged(object sender, EventArgs e) { if (tbEmail.Text.Length > 8) { if (((RootForm)formManager.GetRootForm()).AccessDBManager().ExistUserEmail(tbEmail.Text)) { USERConfig.EMAIL = tbEmail.Text; formManager.ShowLoginPassForm(); } } }
private async void LoginPasswordForm_LoadAsync(object sender, EventArgs e) { for (Width = 0; Width < 700; Width += 50) { await Task.Delay(1); } if (new RegistryManager().IsAutoLogin()) { chbAutoLogin.Checked = true; } //DB로부터 암호화된 패스워드 수신 DataSet dataSet = ((RootForm)formManager.GetRootForm()).AccessDBManager().Select("User", "Email = '" + USERConfig.EMAIL + "'"); DataRow datarow = dataSet.Tables[0].Rows[0]; encryptedPassword = datarow["Password"].ToString(); tbPassword.Focus(); }
/// <summary> /// 인증 버튼을 눌렀을때 진행되는 동작을 수행하는 버튼 클릭 메서드 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void btnConfirmEmail_Click(object sender, EventArgs e) { lbnEmailNotification.ForeColor = Color.OrangeRed; if (!sendEmail && (tbEmail.Text.Length < 5 || !tbEmail.Text.Contains("@"))) { //TODO : Material Design Alert 박스 오류있음. 수정 필요 //new Alert(formManager.GetRootForm(), "오류", "올바른 이메일 주소를 입력 해 주세요.").Show(); lbnEmailNotification.Text = "올바른 이메일 주소를 입력 해 주세요."; shakeControlAsync(tbEmail); } else if (!sendEmail) { if (((RootForm)formManager.GetRootForm()).AccessDBManager().ExistUserEmail(tbEmail.Text)) { shakeControlAsync(tbEmail); lbnEmailNotification.Text = "존재하는 이메일 입니다."; return; } new Thread(new ThreadStart(delegate() { Cursor = Cursors.WaitCursor; email = tbEmail.Text; tbEmail.Enabled = false; btnConfirmEmail.Enabled = false; lbnEmailNotification.Text = "인증 이메일 전송 중 입니다."; Random random = new Random(); for (int i = 0; i < 5; i++) { code += random.Next(0, 9).ToString(); } if (MailManager.SendCode(tbEmail.Text, code)) { Cursor = Cursors.Default; lbnEmailNotification.Text = "발송 성공! 메일함을 확인 해 주세요."; lbnEmail.Text = "인증코드"; tbEmail.Text = ""; tbEmail.Enabled = true; tbEmail.Hint = "인증코드를 입력 해 주세요."; btnConfirmEmail.Enabled = true; btnConfirmEmail.Text = "재전송"; sendEmail = true; } else { tbEmail.Enabled = true; btnConfirmEmail.Enabled = true; lbnEmailNotification.Text = "인증 이메일 전송에 실패하였습니다."; sendEmail = false; } })).Start(); } else { lbnEmailNotification.Text = ""; lbnEmail.Text = "E-Mail"; tbEmail.Hint = "E-Mail"; tbEmail.Text = email; btnConfirmEmail.Text = "인증"; sendEmail = false; confirm = false; } await Task.Delay(150); }