Availabilities

This commit is contained in:
Anshu Sharma 2018-11-11 11:37:05 -05:00
parent b857c93aff
commit 8bdca52a6d
3 changed files with 40 additions and 0 deletions

View file

@ -1,6 +1,7 @@
package com.uottawa.olympus.olympusservices; package com.uottawa.olympus.olympusservices;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -13,6 +14,9 @@ public class ServiceProvider extends UserType {
//Field for list of services that service provider offers. //Field for list of services that service provider offers.
private List<Service> services; private List<Service> services;
//Field for array of availabilities
private int[][] availabilities;
/** /**
* Constructor for the service object which takes the parameters to * Constructor for the service object which takes the parameters to
@ -26,6 +30,7 @@ public class ServiceProvider extends UserType {
ServiceProvider(String username, String password, String firstname, String lastname){ ServiceProvider(String username, String password, String firstname, String lastname){
super(username, password, firstname, lastname); super(username, password, firstname, lastname);
services = new ArrayList<>(); services = new ArrayList<>();
Availability = new Date[7][2];
} }
/** /**
@ -61,4 +66,17 @@ public class ServiceProvider extends UserType {
return services; return services;
} }
public void setAvailabilities(int day, int startHour, int startMin, int endHour, int endMin){
availabilities[day][0] = startHour;
availabilities[day][1] = startMin;
availabilities[day][2] = endHour;
availabilities[day][3] = endMin;
}
public int[][] getAvailabilities(){
return availabilities;
}
} }

View file

@ -0,0 +1,13 @@
package com.uottawa.olympus.olympusservices;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class ServiceProviderWelcome extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_service_provider_welcome);
}
}

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ServiceProviderWelcome">
</android.support.constraint.ConstraintLayout>