Added UML and Test file fixes, added string description to the DBHelper and SignUp. Further fixes needed
This commit is contained in:
parent
90a1161f16
commit
76c693e91e
2 changed files with 4 additions and 2 deletions
|
@ -290,12 +290,13 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||||
String phonenumber = cursor.getString(6);
|
String phonenumber = cursor.getString(6);
|
||||||
String companyname = cursor.getString(7);
|
String companyname = cursor.getString(7);
|
||||||
boolean licensed = Boolean.parseBoolean(cursor.getString(8));
|
boolean licensed = Boolean.parseBoolean(cursor.getString(8));
|
||||||
|
String description = cursor.getString(9);
|
||||||
if (cursor.getString(4)
|
if (cursor.getString(4)
|
||||||
.equals("Admin")){
|
.equals("Admin")){
|
||||||
usertype = new Admin();
|
usertype = new Admin();
|
||||||
} else if (cursor.getString(4)
|
} else if (cursor.getString(4)
|
||||||
.equals("ServiceProvider")){
|
.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);
|
getAllServicesProvidedByUser(serviceProvider);
|
||||||
getAvailabilities(serviceProvider);
|
getAvailabilities(serviceProvider);
|
||||||
usertype = serviceProvider;
|
usertype = serviceProvider;
|
||||||
|
|
|
@ -32,6 +32,7 @@ public class SignUpPart2 extends AppCompatActivity {
|
||||||
String phonenumber = ((EditText) findViewById(R.id.PhoneNumberInput)).getText().toString();
|
String phonenumber = ((EditText) findViewById(R.id.PhoneNumberInput)).getText().toString();
|
||||||
String address = ((EditText) findViewById(R.id.AddressInput)).getText().toString();
|
String address = ((EditText) findViewById(R.id.AddressInput)).getText().toString();
|
||||||
boolean licensed = ((CheckBox) findViewById(R.id.LicensedInput)).isChecked();
|
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
|
if(companyname.length()>0 && address.length()>0 && phonenumber.length()>0
|
||||||
&& companyname.matches("^[a-zA-Z0-9_ ]*$") && address.matches("^[a-zA-Z0-9_ ]*$")
|
&& 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) {
|
&& address.replaceAll("\\s+","").length()>0) {
|
||||||
|
|
||||||
ServiceProvider serviceProvider = new ServiceProvider(username, password, firstname, lastname,
|
ServiceProvider serviceProvider = new ServiceProvider(username, password, firstname, lastname,
|
||||||
address, phonenumber, companyname, licensed);
|
address, phonenumber, companyname, licensed, description);
|
||||||
if(dbHelper.addUser(serviceProvider)){
|
if(dbHelper.addUser(serviceProvider)){
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
|
|
Loading…
Reference in a new issue