Update AppUser Objecct to cater for all fields.
enable file generation of med cert
This commit is contained in:
@@ -1,15 +1,39 @@
|
||||
class AppUser {
|
||||
final int idusers;
|
||||
final String email;
|
||||
final int idUser;
|
||||
final String UserName;
|
||||
final int docOffice_id;
|
||||
final String fname;
|
||||
final String lname;
|
||||
final String title;
|
||||
|
||||
const AppUser(
|
||||
this.idusers,
|
||||
this.email,
|
||||
this.docOffice_id,
|
||||
);
|
||||
const AppUser({
|
||||
required this.idUser,
|
||||
required this.UserName,
|
||||
required this.docOffice_id,
|
||||
required this.fname,
|
||||
required this.lname,
|
||||
required this.title,
|
||||
});
|
||||
|
||||
factory AppUser.fromJson(dynamic json) {
|
||||
return AppUser(json['idusers'], json['email'], json['docOffice_id']);
|
||||
factory AppUser.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
'idUser': int idUser,
|
||||
'UserName': String UserName,
|
||||
'docOffice_id': int docOffice_id,
|
||||
'fname': String fname,
|
||||
'lname': String lname,
|
||||
'title': String title,
|
||||
} =>
|
||||
AppUser(
|
||||
idUser: idUser,
|
||||
UserName: UserName,
|
||||
docOffice_id: docOffice_id,
|
||||
fname: fname,
|
||||
lname: lname,
|
||||
title: title,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load album.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
47
Frontend/patient_manager/lib/objects/Patient2.dart
Normal file
47
Frontend/patient_manager/lib/objects/Patient2.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
class Patient2 {
|
||||
final int idpatients;
|
||||
final String id_no;
|
||||
final String first_name;
|
||||
final String last_name;
|
||||
final String email;
|
||||
final String cell_no;
|
||||
final String medical_aid_name;
|
||||
final String medical_aid_no;
|
||||
final String medical_aid_scheme;
|
||||
final String address;
|
||||
final int doc_office_id;
|
||||
|
||||
const Patient2(
|
||||
this.idpatients,
|
||||
this.id_no,
|
||||
this.first_name,
|
||||
this.last_name,
|
||||
this.email,
|
||||
this.cell_no,
|
||||
this.medical_aid_name,
|
||||
this.medical_aid_no,
|
||||
this.medical_aid_scheme,
|
||||
this.address,
|
||||
this.doc_office_id,
|
||||
);
|
||||
|
||||
factory Patient2.fromJson(dynamic json) {
|
||||
return Patient2(
|
||||
json['idpatients'],
|
||||
json['id_no'],
|
||||
json['first_name'],
|
||||
json['last_name'],
|
||||
json['email'],
|
||||
json['cell_no'],
|
||||
json['medical_aid_name'],
|
||||
json['medical_aid_no'],
|
||||
json['medical_aid_scheme'],
|
||||
json['address'],
|
||||
json['docOffice_id'],
|
||||
);
|
||||
}
|
||||
|
||||
String getIDNum() {
|
||||
return id_no;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user