private void btnAddGame_Click(object sender, RoutedEventArgs e) { string strName = txtGameName.Text; string strGenre = txtGenre.Text; string strDesc = txtDesc.Text; string strPrice = txtPrice.Text; string strAgeRating = txtRating.Text; DatabaseBroker broker = new DatabaseBroker(); broker.insertGame(strName, strGenre, strDesc, strPrice, strAgeRating); MessageBox.Show("Game successfully added"); this.Close(); }
private void btnAdd_Click(object sender, RoutedEventArgs e) { string strFirst = txtFirstName.Text; string strLast = txtLastName.Text; string strNumber = txtNumber.Text; string strStreet = txtStreet.Text; string strTown = txtTown.Text; string strPostcode = txtPostcode.Text; string strAge = txtAge.Text; DatabaseBroker broker = new DatabaseBroker(); broker.insertCustomer(strFirst, strLast, strNumber, strStreet, strTown, strPostcode, strAge); MessageBox.Show("Customer successfully added"); this.Close(); }
/// <summary> /// populates cmbGames with /// games from the table /// in the connected database /// </summary> private void updateGames() { cmbGames.ItemsSource = null; db = new DatabaseBroker(); cmbGames.ItemsSource = db.getGameData(); }
/// <summary> /// populates cmbCustomer with /// customers from the table /// in the connected database /// </summary> private void updateCustomers() { cmbCustomer.ItemsSource = null; db = new DatabaseBroker(); cmbCustomer.ItemsSource = db.getData(); }