private void btnSignUp2_Click(object sender, EventArgs e) { Member obj = new Member { Username = txtUserName.Text, Password = txtPassWord.Text, Email = txtEmail.Text }; MemberRepository repository = new MemberRepository(); string[] msg = { "Username exists", "Success" }; int ret = repository.Add2(obj); MessageBox.Show(msg[ret]); }
private void btnSignIn2_Click(object sender, EventArgs e) { MemberRepository repository = new MemberRepository(); string usr = txtUserName.Text; string pwd = txtPassWord.Text; int ret; Member obj = repository.SignIn2(usr, pwd, out ret); if (obj != null) { MessageBox.Show("Sign in Success"); } else { string[] msg = { "Username not exists.", "Input passwrod fail." }; MessageBox.Show(msg[ret]); } }