private void btnLogin_Click(object sender, EventArgs e) { FileFunctions filefuncs = new FileFunctions(); string username = txtUsername.Text; if (filefuncs.checkUser(username, "admins.csv")) { string password = filefuncs.getField(username, 2, "admins.csv"); if (password == txtPassword.Text) // Update user object and go to admin page if account exists and password matches. { this.Hide(); User.Name = filefuncs.getField(username, 0, "admins.csv"); User.Email = username; User.Password = password; frmAdmin admin = new frmAdmin(); admin.ShowDialog(); } else { MessageBox.Show("Invalid password."); } } else { MessageBox.Show("An account does not exist with this username."); } }
private void BtnLogin_Click(object sender, EventArgs e) { InputFunctions inputfuncs = new InputFunctions(); FileFunctions filefuncs = new FileFunctions(); string email = txtEmail.Text; if (!inputfuncs.verifyEmail(email)) { MessageBox.Show("Please enter a valid email address"); } else if (filefuncs.checkUser(email, "users.csv")) { string password = filefuncs.getField(email, 3, "users.csv"); if (password == txtPassword.Text) { this.Hide(); User.Name = filefuncs.getField(email, 0, "users.csv"); User.Email = email; User.Password = password; frmProfile profile = new frmProfile(); profile.ShowDialog(); } else { MessageBox.Show("Invalid password."); } } else { MessageBox.Show("An account does not exist with that email address."); } }
private string generateProfileInfo() { FileFunctions funcs = new FileFunctions(); string message = "Here are the tickets you've purchased:\n"; message += "Lower: " + funcs.getField(User.Email, 7, "users.csv") + "\n"; message += "Club: " + funcs.getField(User.Email, 8, "users.csv") + "\n"; message += "Upper: " + funcs.getField(User.Email, 9, "users.csv") + "\n"; return(message); }