private void Register_Click(object sender, EventArgs e) { Userinos u = new Userinos(); if (string.IsNullOrWhiteSpace(rUsername.Text) || string.IsNullOrWhiteSpace(rPassword.Text) || string.IsNullOrWhiteSpace(rEmail.Text) || string.IsNullOrWhiteSpace(rCard.Text) || string.IsNullOrWhiteSpace(rDate.Text) || string.IsNullOrWhiteSpace(textBox1.Text)) { MessageBox.Show("Fill in the gaps."); } else { if (!checkBox1.Checked) { MessageBox.Show("You need to check the checkbox to finish."); } else { u.Username = rUsername.Text; u.Password = rPassword.Text; u.Email = rEmail.Text; u.Numbers = rCard.Text; u.Date = rDate.Text; u.Other = textBox1.Text; u.Points = 0; SqliteAcc.SaveUser(u); MessageBox.Show("Registration successful."); Login log = new Login(); this.Hide(); log.ShowDialog(); this.Close(); } } }
private void Order_Click(object sender, EventArgs e) { int id = idd; Userinos user = pur.AccPurchase(id); BuyOption selected = (BuyOption)Prices.SelectedItem; pric.Add(selected); user.Points = user.Points + selected.Amount; accCurrency.Text = user.Points + ""; SqliteAcc.Update(user); MessageBox.Show("Purchase Successful."); }
public void Load() { usee = SqliteAcc.LoadUsers(); }
public void Loadp() { pric = SqliteAcc.LoadPrice(); WireUpFoodList(); }