Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Booking App COM5007
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
austin.blanke
Booking App COM5007
Commits
4afc5f2e
Commit
4afc5f2e
authored
May 29, 2023
by
austin.blanke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Database Updated, Working on Add Booking Method
parent
67e195a8
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
158 additions
and
90 deletions
+158
-90
DatabaseConnector.java
...om/example/bookingapp_austinblanke/DatabaseConnector.java
+118
-86
MoreInfoActivity.java
...com/example/bookingapp_austinblanke/MoreInfoActivity.java
+40
-4
No files found.
app/src/main/java/com/example/bookingapp_austinblanke/DatabaseConnector.java
View file @
4afc5f2e
This diff is collapsed.
Click to expand it.
app/src/main/java/com/example/bookingapp_austinblanke/MoreInfoActivity.java
View file @
4afc5f2e
...
@@ -3,6 +3,7 @@ package com.example.bookingapp_austinblanke;
...
@@ -3,6 +3,7 @@ package com.example.bookingapp_austinblanke;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
android.widget.Toast
;
...
@@ -31,6 +32,9 @@ public class MoreInfoActivity extends AppCompatActivity {
...
@@ -31,6 +32,9 @@ public class MoreInfoActivity extends AppCompatActivity {
String
Flashdis
=
null
;
String
Flashdis
=
null
;
String
Wheelchairdis
=
null
;
String
Wheelchairdis
=
null
;
String
Stairsdis
=
null
;
String
Stairsdis
=
null
;
String
Tickets1Type
=
null
;
String
Tickets2Type
=
null
;
String
Tickets3Type
=
null
;
String
Tickets1
=
null
;
String
Tickets1
=
null
;
String
Tickets2
=
null
;
String
Tickets2
=
null
;
String
Tickets3
=
null
;
String
Tickets3
=
null
;
...
@@ -57,12 +61,15 @@ public class MoreInfoActivity extends AppCompatActivity {
...
@@ -57,12 +61,15 @@ public class MoreInfoActivity extends AppCompatActivity {
if
(
Stairs
==
"true"
){
Stairsdis
=
"There are less than 20 steps"
;}
if
(
Stairs
==
"true"
){
Stairsdis
=
"There are less than 20 steps"
;}
else
{
Stairsdis
=
"There are more than 20 steps"
;}
else
{
Stairsdis
=
"There are more than 20 steps"
;}
Tickets1
=
connector
.
get
Info
(
PID
,
8
);
Tickets1
=
connector
.
get
TicketCount
(
PID
,
1
);
Tickets2
=
connector
.
getTicketCount
(
PID
,
2
);
Tickets2
=
connector
.
getTicketCount
(
PID
,
2
);
Tickets3
=
connector
.
getTicketCount
(
PID
,
3
);
Tickets3
=
connector
.
getTicketCount
(
PID
,
3
);
Tickets1Price
=
connector
.
getTicketPrice
(
PID
,
1
);
Tickets1Price
=
connector
.
getTicketPrice
(
PID
,
1
);
Tickets2Price
=
connector
.
getTicketPrice
(
PID
,
2
);
Tickets2Price
=
connector
.
getTicketPrice
(
PID
,
2
);
Tickets3Price
=
connector
.
getTicketPrice
(
PID
,
3
);
Tickets3Price
=
connector
.
getTicketPrice
(
PID
,
3
);
Tickets1Type
=
connector
.
getTicketType
(
PID
,
1
);
Tickets2Type
=
connector
.
getTicketType
(
PID
,
2
);
Tickets3Type
=
connector
.
getTicketType
(
PID
,
3
);
...
@@ -81,13 +88,42 @@ public class MoreInfoActivity extends AppCompatActivity {
...
@@ -81,13 +88,42 @@ public class MoreInfoActivity extends AppCompatActivity {
TextView
stairs
=
(
TextView
)
findViewById
(
R
.
id
.
stairs
);
TextView
stairs
=
(
TextView
)
findViewById
(
R
.
id
.
stairs
);
stairs
.
setText
(
Stairsdis
);
stairs
.
setText
(
Stairsdis
);
TextView
ticket1
=
(
TextView
)
findViewById
(
R
.
id
.
tickets1
);
TextView
ticket1
=
(
TextView
)
findViewById
(
R
.
id
.
tickets1
);
ticket1
.
setText
(
Tickets1
+
", £"
+
Tickets1Price
);
TextView
ticket2
=
(
TextView
)
findViewById
(
R
.
id
.
tickets2
);
TextView
ticket2
=
(
TextView
)
findViewById
(
R
.
id
.
tickets2
);
ticket2
.
setText
(
Tickets2
+
", £"
+
Tickets2Price
);
TextView
ticket3
=
(
TextView
)
findViewById
(
R
.
id
.
tickets3
);
TextView
ticket3
=
(
TextView
)
findViewById
(
R
.
id
.
tickets3
);
ticket3
.
setText
(
Tickets3
+
", £"
+
Tickets3Price
);
if
(
Tickets1
!=
null
){
ticket1
.
setText
(
Tickets1Type
+
": "
+
Tickets1
+
" (£"
+
Tickets1Price
+
")"
);}
else
{
ticket1
.
setText
(
""
);}
if
(
Tickets2
!=
null
){
ticket2
.
setText
(
Tickets2Type
+
": "
+
Tickets2
+
" (£"
+
Tickets2Price
+
")"
);}
else
{
ticket2
.
setText
(
""
);}
if
(
Tickets3
!=
null
){
ticket3
.
setText
(
Tickets3Type
+
": "
+
Tickets3
+
" (£"
+
Tickets3Price
+
")"
);}
else
{
ticket3
.
setText
(
""
);}
}
public
void
bookNow
(
View
view
){
bookNow
();}
public
void
bookNow
(){
DatabaseConnector
connector
=
new
DatabaseConnector
(
this
,
null
);
int
TIC1
=
0
;
int
TIC2
=
0
;
int
TIC3
=
0
;
EditText
Tic1Cnt
=
findViewById
(
R
.
id
.
bookTicket1Cnt
);
EditText
Tic2Cnt
=
findViewById
(
R
.
id
.
bookTicket2Cnt
);
EditText
Tic3Cnt
=
findViewById
(
R
.
id
.
bookTicket3Cnt
);
if
(
Tic1Cnt
!=
null
){
TIC1
=
Integer
.
parseInt
(
Tic1Cnt
.
getText
().
toString
());}
if
(
Tic2Cnt
!=
null
){
TIC2
=
Integer
.
parseInt
(
Tic2Cnt
.
getText
().
toString
());}
if
(
Tic3Cnt
!=
null
){
TIC3
=
Integer
.
parseInt
(
Tic3Cnt
.
getText
().
toString
());}
connector
.
addBooking
(
PID
,
TIC1
,
TIC2
,
TIC3
);
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
startActivity
(
intent
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment