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 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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue