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.
PatientApp-KKUMC/lib/services/appointment_services/GetDoctorsList.dart

89 lines
2.6 KiB
Dart

import 'package:diplomaticquarterapp/client/base_app_client.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
class DoctorsListService {
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
Future<Map> getDoctorsList(int clinicID, int projectID) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null,
"ClinicID": 21,
"ProjectID": 0,
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": true,
"PatientID": 0,
"gender": 0,
"age": 0,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,
"License": true
};
dynamic localRes;
await BaseAppClient.post(GET_DOCTORS_LIST_URL,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorsListByName(String docName) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null,
"ClinicID": 0,
"ProjectID": 0,
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": false,
"DoctorName": docName,
"PatientID": 0,
"gender": 0,
"age": 0,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,
"License": true
};
dynamic localRes;
await BaseAppClient.post(GET_DOCTORS_LIST_URL,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
}