private void adjustLabels() // Adjust label values on form. { FileFunctions filefuncs = new FileFunctions(); lblSalesNum.Text = filefuncs.getTotalSales().ToString("c"); lblLowerNum.Text = filefuncs.getTicks(0); lblClubNum.Text = filefuncs.getTicks(1); lblUpperNum.Text = filefuncs.getTicks(2); }
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); }
private void generateDataTable() // Populate the datagridview control with data from users.csv. { // Create column headers. dataCustomers.ColumnCount = 7; dataCustomers.Columns[0].Name = "Customer"; dataCustomers.Columns[1].Name = "Email"; dataCustomers.Columns[2].Name = "Total Cost"; dataCustomers.Columns[3].Name = "Confirmation Number"; dataCustomers.Columns[4].Name = "Lower Level Seats"; dataCustomers.Columns[5].Name = "Club Level Seats"; dataCustomers.Columns[6].Name = "Upper Deck Seats"; // Use file functions getCustomerData to populate rows with information. FileFunctions filefuncs = new FileFunctions(); string[][] data = filefuncs.getCustomerData(); for (int i = 1; i < data.Length; i++) { dataCustomers.Rows.Add(data[i]); } }
private void btnSubmit_Click(object sender, EventArgs e) { FileFunctions filefuncs = new FileFunctions(); if (filefuncs.checkUser(txtUsername.Text, "admins.csv")) { MessageBox.Show("An account already exists with this username."); } else if (txtPassword.Text != txtConfirm.Text) { MessageBox.Show("Passwords must match."); } else { User.Name = txtName.Text; User.Username = txtUsername.Text; User.Password = txtPassword.Text; filefuncs.writeUser("admins.csv"); this.Hide(); frmAdminLogin adminlogin = new frmAdminLogin(); adminlogin.ShowDialog(); } }