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.
		
		
		
		
		
			
		
			
	
	
		
			46 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Dart
		
	
		
		
			
		
	
	
			46 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Dart
		
	
| 
								 
											3 years ago
										 
									 | 
							
								class ServiceRequestSearch{
							 | 
						||
| 
								 | 
							
								  String deviceSerialNumber;
							 | 
						||
| 
								 | 
							
								  String deviceName;
							 | 
						||
| 
								 | 
							
								  String hospital;
							 | 
						||
| 
								 | 
							
								  String model;
							 | 
						||
| 
								 | 
							
								  int statusValue;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  ServiceRequestSearch({
							 | 
						||
| 
								 | 
							
								    this.deviceSerialNumber,
							 | 
						||
| 
								 | 
							
								    this.statusValue,
							 | 
						||
| 
								 | 
							
								    this.deviceName,
							 | 
						||
| 
								 | 
							
								    this.model,
							 | 
						||
| 
								 | 
							
								    this.hospital,
							 | 
						||
| 
								 | 
							
								  });
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  fromSearch(ServiceRequestSearch newSearch){
							 | 
						||
| 
								 | 
							
								    deviceSerialNumber = newSearch.deviceSerialNumber;
							 | 
						||
| 
								 | 
							
								    statusValue = newSearch.statusValue;
							 | 
						||
| 
								 | 
							
								    hospital = newSearch.hospital;
							 | 
						||
| 
								 | 
							
								    model = newSearch.model;
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  String toSearchString(){
							 | 
						||
| 
								 | 
							
								    String _search = "";
							 | 
						||
| 
								 | 
							
								    if(deviceSerialNumber != null  && deviceSerialNumber.isNotEmpty){
							 | 
						||
| 
								 | 
							
								      _search += "&sn_id=$deviceSerialNumber";
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    if(statusValue != null){
							 | 
						||
| 
								 | 
							
								      _search += "&status=$statusValue";
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    if(deviceName != null && deviceName.isNotEmpty){
							 | 
						||
| 
								 | 
							
								      _search += "&equipment_en_name=$deviceName";
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    if(hospital != null && hospital.isNotEmpty){
							 | 
						||
| 
								 | 
							
								      _search += "&client=$hospital";
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								    if(model != null && model.isNotEmpty){
							 | 
						||
| 
								 | 
							
								      _search += "&model=$model";
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								    return _search;
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								}
							 |