private void Save_btn_Click(object sender, RoutedEventArgs e) //수정 { ID_concern.Visibility = Visibility.Hidden; // 처음엔 일단 숨기기 PW_corcenrn2.Visibility = Visibility.Hidden; // 처음엔 일단 숨기기 if (PW_Box.Password != PWCon_Box.Password) //비밀번호 strcmp { PW_corcenrn2.Visibility = Visibility.Visible; //다르다고 경고 } if (IdExists(ID_box.Text)) //있다 { ID_concern.Visibility = Visibility.Visible; ID_box.Text = ""; ID_box.Focus(); } else if (PW_Box.Password == PWCon_Box.Password) { string major = ""; if (College_cbx.Text == "일반대학") { major = Major_normal.Text; } else if (College_cbx.Text == "공과대학") { major = Major_engineer.Text; } else if (College_cbx.Text == "건축대학") { major = Major_architecture.Text; } PostUser(ID_box.Text, PW_Box.Password, YearOfEntry_cbx.Text, College_cbx.Text, major); System.Windows.MessageBox.Show("회원가입이 완료되었습니다"); this.Close(); } else { PWCon_Box.Focus(); } }
private void Save_btn_Click(object sender, RoutedEventArgs e) //수정 { if (invisible2.Text == "check_success") { ID_concern.Visibility = Visibility.Hidden; // 처음엔 일단 숨기기 PW_corcenrn.Visibility = Visibility.Hidden; //처음엔 일단 숨기기 PW_corcenrn2.Visibility = Visibility.Hidden; // 처음엔 일단 숨기기 Regex regexPW = new Regex(@"(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{2,})$"); //비밀번호 정규식 string id = null; //id가 id + 이메일이라서 필요 Boolean foundMatch = regexPW.IsMatch(PW_Box.Password); if (PW_Box.Password != PWCon_Box.Password) //비밀번호 strcmp { PW_corcenrn2.Visibility = Visibility.Visible; //다르다고 경고 } if (IdExists(ID_box.Text)) //이미 아이디가 존재하거나 이메일 형식이 아니다 { ID_concern.Visibility = Visibility.Visible; ID_box.Text = ""; ID_box.Focus(); } else if (PW_Box.Password.Length < 8 || !foundMatch) { PW_corcenrn.Visibility = Visibility.Visible; } else if (PW_Box.Password == PWCon_Box.Password) { string major = ""; if (College_cbx.Text == "일반대학") { major = Major_normal.Text; } else if (College_cbx.Text == "공과대학") { major = Major_engineer.Text; } else if (College_cbx.Text == "건축대학") { major = Major_architecture.Text; } if (email_cbx.Text == "직접입력") { id = ID_box.Text + "@" + emailWrite_tbx.Text; } else { id = ID_box.Text + "@" + email_tbk.Text; } PostUser(id, PW_Box.Password, YearOfEntry_cbx.Text, College_cbx.Text, major); System.Windows.MessageBox.Show("회원가입이 완료되었습니다"); this.Hide(); } else { PWCon_Box.Focus(); } } else { System.Windows.MessageBox.Show("회원가입이 완료되었습니다"); } }
private void PWCon_TextBox_GotFocus(object sender, RoutedEventArgs e) { PWCon_TextBox.Visibility = Visibility.Collapsed; PWCon_Box.Focus(); }