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.
75 lines
1.7 KiB
Dart
75 lines
1.7 KiB
Dart
|
|
import 'dart:convert';
|
|
|
|
import 'package:queuing_system/utils/call_type.dart';
|
|
|
|
class Tickets {
|
|
Tickets({
|
|
this.callNo,
|
|
this.roomNo,
|
|
this.callType,
|
|
this.createdON,
|
|
this.doctorName,
|
|
this.doctorNameN,
|
|
this.editedON,
|
|
this.mobileNo,
|
|
this.patientGender,
|
|
this.patientID,
|
|
this.queueNo,});
|
|
|
|
Tickets.fromJson(dynamic json) {
|
|
callNo = json['CallNo'];
|
|
roomNo = json['RoomNo'];
|
|
callType = json['CallType'];
|
|
createdON = json['CreatedON'];
|
|
doctorName = json['DoctorName'];
|
|
doctorNameN = json['DoctorNameN'];
|
|
editedON = json['EditedON'];
|
|
mobileNo = json['MobileNo'];
|
|
patientGender = json['PatientGender'];
|
|
patientID = json['PatientID'];
|
|
queueNo = json['QueueNo'];
|
|
}
|
|
|
|
int callNo;
|
|
String roomNo;
|
|
int callType;
|
|
String createdON;
|
|
String doctorName;
|
|
String doctorNameN;
|
|
String editedON;
|
|
String mobileNo;
|
|
int patientGender;
|
|
int patientID;
|
|
String queueNo;
|
|
bool call_updated = false;
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final map = <String, dynamic>{};
|
|
map['CallNo'] = callNo;
|
|
map['RoomNo'] = roomNo;
|
|
map['CallType'] = callType;
|
|
map['CreatedON'] = createdON;
|
|
map['DoctorName'] = doctorName;
|
|
map['DoctorNameN'] = doctorNameN;
|
|
map['EditedON'] = editedON;
|
|
map['MobileNo'] = mobileNo;
|
|
map['PatientGender'] = patientGender;
|
|
map['PatientID'] = patientID;
|
|
map['QueueNo'] = queueNo;
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (callNo).toString();
|
|
}
|
|
|
|
CallType getCallType(){
|
|
if(callType == 0) return CallType.RECEPTION;
|
|
if(callType == 1) return CallType.NURSE;
|
|
if(callType == 2) return CallType.DOCTOR;
|
|
return CallType.NONE;
|
|
}
|
|
|
|
} |