From 76c693e91ef121ef109d90580498cdd04d326b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Berk=20Ba=C5=9Fo=C4=9Flu?= Date: Fri, 16 Nov 2018 14:48:02 -0500 Subject: [PATCH] Added UML and Test file fixes, added string description to the DBHelper and SignUp. Further fixes needed --- .../java/com/uottawa/olympus/olympusservices/DBHelper.java | 3 ++- .../java/com/uottawa/olympus/olympusservices/SignUpPart2.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java index eadb140..f188be4 100644 --- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java +++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java @@ -290,12 +290,13 @@ public class DBHelper extends SQLiteOpenHelper { String phonenumber = cursor.getString(6); String companyname = cursor.getString(7); boolean licensed = Boolean.parseBoolean(cursor.getString(8)); + String description = cursor.getString(9); if (cursor.getString(4) .equals("Admin")){ usertype = new Admin(); } else if (cursor.getString(4) .equals("ServiceProvider")){ - ServiceProvider serviceProvider = new ServiceProvider(username, password, firstname, lastname, address, phonenumber, companyname, licensed); + ServiceProvider serviceProvider = new ServiceProvider(username, password, firstname, lastname, address, phonenumber, companyname, licensed, description); getAllServicesProvidedByUser(serviceProvider); getAvailabilities(serviceProvider); usertype = serviceProvider; diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/SignUpPart2.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/SignUpPart2.java index 48ab789..e135746 100644 --- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/SignUpPart2.java +++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/SignUpPart2.java @@ -32,6 +32,7 @@ public class SignUpPart2 extends AppCompatActivity { String phonenumber = ((EditText) findViewById(R.id.PhoneNumberInput)).getText().toString(); String address = ((EditText) findViewById(R.id.AddressInput)).getText().toString(); boolean licensed = ((CheckBox) findViewById(R.id.LicensedInput)).isChecked(); + String description = ((EditText) findViewById(R.id.DescriptionInput)).getText().toString(); if(companyname.length()>0 && address.length()>0 && phonenumber.length()>0 && companyname.matches("^[a-zA-Z0-9_ ]*$") && address.matches("^[a-zA-Z0-9_ ]*$") @@ -40,7 +41,7 @@ public class SignUpPart2 extends AppCompatActivity { && address.replaceAll("\\s+","").length()>0) { ServiceProvider serviceProvider = new ServiceProvider(username, password, firstname, lastname, - address, phonenumber, companyname, licensed); + address, phonenumber, companyname, licensed, description); if(dbHelper.addUser(serviceProvider)){ startActivity(intent); finish();