You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
Dart
47 lines
1.1 KiB
Dart
|
3 years ago
|
class ServiceRequestSearch {
|
||
|
|
String? deviceSerialNumber;
|
||
|
|
String? deviceName;
|
||
|
|
String? hospital;
|
||
|
|
String? model;
|
||
|
|
int? statusValue;
|
||
|
3 years ago
|
|
||
|
|
ServiceRequestSearch({
|
||
|
|
this.deviceSerialNumber,
|
||
|
|
this.statusValue,
|
||
|
|
this.deviceName,
|
||
|
|
this.model,
|
||
|
|
this.hospital,
|
||
|
|
});
|
||
|
|
|
||
|
3 years ago
|
fromSearch(ServiceRequestSearch newSearch) {
|
||
|
3 years ago
|
deviceSerialNumber = newSearch.deviceSerialNumber;
|
||
|
|
statusValue = newSearch.statusValue;
|
||
|
|
hospital = newSearch.hospital;
|
||
|
|
model = newSearch.model;
|
||
|
|
}
|
||
|
|
|
||
|
3 years ago
|
String toSearchString() {
|
||
|
|
String search = "";
|
||
|
|
if (deviceSerialNumber != null &&
|
||
|
|
(deviceSerialNumber?.isNotEmpty ?? false)) {
|
||
|
|
search += "&sn_id=$deviceSerialNumber";
|
||
|
3 years ago
|
}
|
||
|
|
|
||
|
3 years ago
|
if (statusValue != null) {
|
||
|
|
search += "&status=$statusValue";
|
||
|
3 years ago
|
}
|
||
|
|
|
||
|
3 years ago
|
if (deviceName != null && (deviceName?.isNotEmpty ?? false)) {
|
||
|
|
search += "&equipment_en_name=$deviceName";
|
||
|
3 years ago
|
}
|
||
|
|
|
||
|
3 years ago
|
if (hospital != null && (hospital?.isNotEmpty ?? false)) {
|
||
|
|
search += "&client=$hospital";
|
||
|
3 years ago
|
}
|
||
|
3 years ago
|
if (model != null && (model?.isNotEmpty ?? false)) {
|
||
|
|
search += "&model=$model";
|
||
|
3 years ago
|
}
|
||
|
3 years ago
|
return search;
|
||
|
3 years ago
|
}
|
||
|
3 years ago
|
}
|