Merge branch 'master' of https://github.com/ebivibe/SEG2105-Olympus into DBBranch
This commit is contained in:
commit
d767ccc37a
11 changed files with 21 additions and 54 deletions
|
@ -20,6 +20,8 @@ import android.widget.RadioGroup;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class Bookings extends AppCompatActivity {
|
||||
|
@ -43,10 +45,12 @@ public class Bookings extends AppCompatActivity {
|
|||
dbhelper = new DBHelper(this);
|
||||
|
||||
List<Booking> booking = (List<Booking>)dbhelper.findBookings(username);
|
||||
Collections.reverse(booking);
|
||||
Booking[] bookings = new Booking[booking.size()];
|
||||
bookings = booking.toArray(bookings);
|
||||
Booking[] mostRecentBookings = new Booking[bookings.length];
|
||||
|
||||
/* mock data
|
||||
/* //mock data
|
||||
Booking[] bookings = {new Booking(5, 5, 6, 6, 2, 3, 2019, (ServiceProvider)dbhelper.findUserByUsername("testing"),
|
||||
(HomeOwner)dbhelper.findUserByUsername("tester"), dbhelper.findService("service1"))};
|
||||
*/
|
||||
|
|
|
@ -85,7 +85,14 @@ public class FindServiceProvider extends AppCompatActivity {
|
|||
|
||||
public void Reset(View view){
|
||||
|
||||
|
||||
Button button = findViewById(R.id.Start);
|
||||
Button button2 = findViewById(R.id.End);
|
||||
Button button3 = findViewById(R.id.Date);
|
||||
RadioGroup ratingselect = findViewById(R.id.RatingSelect);
|
||||
button.setText("START");
|
||||
button2.setText("END");
|
||||
button3.setText("DATE");
|
||||
ratingselect.clearCheck();
|
||||
//clears recycler view
|
||||
String[][] empty = {};
|
||||
mAdapter = new MyAdapter(empty, this);
|
||||
|
|
|
@ -82,8 +82,6 @@ public class MakeBooking extends AppCompatActivity {
|
|||
if (starth<endh || (starth==endh && startmin<endmin)){
|
||||
DBHelper dbHelper = new DBHelper(this);
|
||||
|
||||
//check if sp is availible not just true
|
||||
if(true) {
|
||||
|
||||
if (dbHelper.addBooking(serviceprovider, homeowner, service, year, month, day,
|
||||
starth, startmin, endh, endmin)) {
|
||||
|
@ -96,7 +94,6 @@ public class MakeBooking extends AppCompatActivity {
|
|||
} else {
|
||||
Toast.makeText(this, "Booking could not be made", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue