Commit 2f2a22ef authored by sam.pople's avatar sam.pople

afterseeinggit

parent 847defd4
...@@ -48,7 +48,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele ...@@ -48,7 +48,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
int ticketsthere = database.gettickets(playnameforthis); int ticketsthere = database.gettickets(playnameforthis);
String getseating = seatingtype.getSelectedItem().toString(); String getseating = seatingtype.getSelectedItem().toString();
displaytickets.setText(String.valueOf(ticketsthere)); displaytickets.setText(String.valueOf(ticketsthere));
//This ensures that the number of ordered tickets is acceptable //This ensures that the number of ordered tickets is acceptable and tells the customer if they did something wrong
confirm.setOnClickListener(v -> { confirm.setOnClickListener(v -> {
TextView displayorderedtickets = findViewById(R.id.orderedticketshamlet); TextView displayorderedtickets = findViewById(R.id.orderedticketshamlet);
int orderedtickets = Integer.parseInt(displayorderedtickets.getText().toString()); int orderedtickets = Integer.parseInt(displayorderedtickets.getText().toString());
...@@ -79,6 +79,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele ...@@ -79,6 +79,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
}); });
//This returns to the main page
seatingback.setOnClickListener(new View.OnClickListener() { seatingback.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
...@@ -89,6 +90,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele ...@@ -89,6 +90,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
//This allows the user to order a certain number of tickets //This allows the user to order a certain number of tickets
Button plusone = findViewById(R.id.plusonehamlet); Button plusone = findViewById(R.id.plusonehamlet);
Button minusone = findViewById(R.id.minusonehamlet); Button minusone = findViewById(R.id.minusonehamlet);
//This adds one to the number of tickets on click
plusone.setOnClickListener(new View.OnClickListener() { plusone.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -96,6 +98,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele ...@@ -96,6 +98,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
displayorderedtickets.setText(String.valueOf(orderedtickets)); displayorderedtickets.setText(String.valueOf(orderedtickets));
} }
}); });
//This takes one from the number of tickets orders on click
minusone.setOnClickListener(new View.OnClickListener() { minusone.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment