//Login 按鈕的點擊事件 private void log_Click(object sender, EventArgs e) { string uemail = email.Text; string upass = password.Text; //欄位格式驗證不合格 if (validate_Login() != true) { MessageBox.Show("Please check your input in correct format!!"); } //欄位格式驗證合格但為註冊過 else if (validate_Login() && (HasRegister(uemail) == false)) { this.Hide(); Nonmember nonM = new Nonmember(); nonM.ShowDialog(); this.Close(); } //欄位格式驗證合格且登入成功 else if (validate_Login() && IsLogin(uemail, upass)) { this.Hide(); LoginSuccess logs = new LoginSuccess(); logs.ShowDialog(); this.Close(); } //登入失敗 else { MessageBox.Show("Incorrect Password!"); return; } }
//RESET 按鈕的點擊事件 private void reset_Click(object sender, EventArgs e) { string uemail = email.Text; string npass = password.Text; //欄位格式驗證不合格 if (validate_ResetPass() != true) { MessageBox.Show("Please check your input in correct format!!"); } //欄位格式驗證合格且資料更新成功 else if (validate_ResetPass() && IsUpdate(uemail, npass)) { this.Hide(); ResetSuccess resS = new ResetSuccess(); resS.ShowDialog(); this.Close(); } //查無相符會員資料列,更新失敗 else { this.Hide(); Nonmember nonM = new Nonmember(); nonM.ShowDialog(); this.Close(); } }
//Not a member 按鈕的點擊事件 private void nonmembership_Click(object sender, EventArgs e) { this.Hide(); Nonmember nonM = new Nonmember(); nonM.ShowDialog(); this.Close(); }
//CHECK 按鈕的點擊事件 private void check_Click(object sender, EventArgs e) { string uemail = mEmail.Text; //欄位格式驗證不合格 if (validate_MemberCheck() != true) { MessageBox.Show("Please check your input in correct format!"); } //欄位格式驗證合格且資料存在 else if (validate_MemberCheck() && IsExit(uemail)) { //資料更新成功 if (IsUpdate(uemail)) { this.Hide(); Update up = new Update(); up.ShowDialog(); this.Close(); } //資料更新失敗 else { MessageBox.Show("Sorry,update failed!"); } } //查無相應資料列 else { MessageBox.Show("Sorry,you do not have a membership!\n Miss the reward up!!"); this.Hide(); Nonmember nonM = new Nonmember(); nonM.ShowDialog(); this.Close(); } }