private void loadItems() { voucherCode = RandomIDGenerator.randomInt(Constants.VOUCHER_CODE_LENGTH); voucherCodeTextBox.Text = voucherCode; customers = DatabaseOperations.getCustomers(false); if (customers != null && customers.Any()) { selectCustomerComboBox.Items.Clear(); foreach (var data in customers) { selectCustomerComboBox.Items.Add(data.customerName); } } }
private void regenerateCodeButton_Click(object sender, EventArgs e) { voucherCode = RandomIDGenerator.randomInt(Constants.VOUCHER_CODE_LENGTH); voucherCodeTextBox.Text = voucherCode; }