示例#1
0
  public void insertStubData() {
    for (Client client : _dao.clientGateway().getAll()) {
      Bill bill = new Bill();

      bill.setClient(client);
      bill.setDescription("Test Quote ");
      bill.getProducts()
          .add(new BillProduct(new Product("Product 1", "Test", 10), bill.getID(), 9));
      insert(bill);
    }

    Bill bill = new Bill();

    bill.setType(TransactionType.Invoice);
    ArrayList<Client> clients = new ArrayList<Client>(_dao.clientGateway().getAll());
    Client client = clients.get(0);
    bill.setClient(client);
    bill.setDescription("Test Invoice");
    bill.getProducts().add(new BillProduct(new Product("Product 2", "Test 2", 8), bill.getID(), 8));
    insert(bill);
  }