|
|
|
@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
|
|
|
|
@ -30,6 +31,9 @@ const String UPDATE_FILE_STATUS =
|
|
|
|
const String REMOVE_FILE_STATUS =
|
|
|
|
const String REMOVE_FILE_STATUS =
|
|
|
|
'Services/Authentication.svc/REST/ActiveDeactive_PatientFile';
|
|
|
|
'Services/Authentication.svc/REST/ActiveDeactive_PatientFile';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const String ACTIVATION_CODE_URL =
|
|
|
|
|
|
|
|
"Services/Authentication.svc/REST/CheckActivationCode";
|
|
|
|
|
|
|
|
|
|
|
|
class FamilyFilesProvider with ChangeNotifier {
|
|
|
|
class FamilyFilesProvider with ChangeNotifier {
|
|
|
|
bool isLogin = false;
|
|
|
|
bool isLogin = false;
|
|
|
|
bool isLoading = true;
|
|
|
|
bool isLoading = true;
|
|
|
|
@ -189,21 +193,34 @@ class FamilyFilesProvider with ChangeNotifier {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
silentLoggin(switchUser, {onSuccess}) async {
|
|
|
|
Future<dynamic> silentLoggin(GetAllSharedRecordsByStatusList switchUser,
|
|
|
|
|
|
|
|
{onSuccess}) async {
|
|
|
|
//var currentUser = this.authService.getAuthenticatedUser();
|
|
|
|
//var currentUser = this.authService.getAuthenticatedUser();
|
|
|
|
|
|
|
|
var currentUser =
|
|
|
|
|
|
|
|
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
|
|
|
|
//const request = new SwitchUserRequest();
|
|
|
|
//const request = new SwitchUserRequest();
|
|
|
|
Map<String, dynamic> request = {};
|
|
|
|
Map<String, dynamic> request = {};
|
|
|
|
request['LogInTokenID'] = '';
|
|
|
|
request['LogInTokenID'] = '';
|
|
|
|
// request['PatientOutSA'] = currentUser.PatientOutSA ? 1 : 0;
|
|
|
|
request['PatientOutSA'] = currentUser.outSA; //? 1 : 0;
|
|
|
|
request['PatientMobileNumber'] = switchUser.MobileNumber;
|
|
|
|
request['PatientMobileNumber'] =
|
|
|
|
|
|
|
|
switchUser.mobileNumber; //['MobileNumber'];
|
|
|
|
request['SearchType'] = 2;
|
|
|
|
request['SearchType'] = 2;
|
|
|
|
// request['SuperUser'] = currentUser.PatientID;
|
|
|
|
request['SuperUser'] = currentUser.patientID; //currentUser.PatientID;
|
|
|
|
request['PatientIdentificationID'] = '';
|
|
|
|
request['PatientIdentificationID'] = '';
|
|
|
|
request['IsSilentLogin'] = true;
|
|
|
|
request['IsSilentLogin'] = true;
|
|
|
|
|
|
|
|
if (switchUser.mobileNumber != null &&
|
|
|
|
|
|
|
|
switchUser.patientID != currentUser.patientID) {
|
|
|
|
|
|
|
|
request['PatientID'] = switchUser.patientID; //['PatientID'];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
request['PatientID'] = switchUser.responseID; //['ResponseID'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966";
|
|
|
|
|
|
|
|
request['activationCode'] = '0000';
|
|
|
|
|
|
|
|
request['isRegister'] = false;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
dynamic localRes;
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
|
|
await new BaseAppClient().post(REMOVE_FILE_STATUS,
|
|
|
|
await new BaseAppClient().post(ACTIVATION_CODE_URL,
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
localRes = response;
|
|
|
|
localRes = response;
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|