private void Register_Click(object sender, RoutedEventArgs e) { String userName = userNametxt.Text; String pass = passtxt.Text; String fname = firstNametxt.Text; String lname = lastNametxt.Text; String IDnumber = IDtxt.Text; String gender = (gendertxt.SelectedValue as ComboBoxItem).Content.ToString(); String dateOfBirth = dateOdBirthtxt.Text; Boolean goodInput = false; Club_Member customer = new Club_Member(IDnumber, fname, lname, gender, IDnumber, dateOfBirth); if (MainWindow.isWord(fname) && MainWindow.isWord(lname) && MainWindow.isNumber(IDnumber)) { goodInput = true; } if (goodInput && BL_manager.BL_clubMember.Add(customer) && !BL_manager.BL_user.isUserNameTaken(userName)) { MessageBox.Show("Welcome to Emart !"); User addedNow = new User(userName, pass, IDnumber); BL_manager.BL_user.Add(addedNow); MessageBox.Show("User name : " + userName + "\nPassword : "******"User name and Password", MessageBoxButton.OK, MessageBoxImage.Information); MainWindow mw = new MainWindow(BL_manager); mw.Show(); this.Close(); } else { MessageBox.Show("There where a problem.\n One or more from the fields is incorrect, please try again", "Problem", MessageBoxButton.OK, MessageBoxImage.Warning); } }
private void addInfo_Click(object sender, RoutedEventArgs e) { String inf = info.Text; if (MainWindow.isNumber(inf)) { if (member is Club_Member) { BL_manager.BL_clubMember.updateMemberVisa(member.ID, inf); MessageBox.Show("transaction completed"); this.Close(); } if (member is Employee) { BL_manager.BL_employee.updateEmployeeVisa(member.ID, inf); MessageBox.Show("transaction completed"); this.Close(); } } else { MessageBox.Show("Incorrect Credit card number,please try again.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); } }