|
|
|
@ -278,44 +278,46 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
|
registerNow() {
|
|
|
|
|
dynamic request = getTempUserRequest();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
this.authService.registerUser(request).then((result) => {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context),
|
|
|
|
|
// userData = result.list;
|
|
|
|
|
//AuthenticatedUser.fromJson(result['List'][0]),
|
|
|
|
|
if(result is String){
|
|
|
|
|
new ConfirmDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: result,
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
okFunction: () => {
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context)
|
|
|
|
|
},
|
|
|
|
|
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)})
|
|
|
|
|
.showAlertDialog(context)
|
|
|
|
|
|
|
|
|
|
}else
|
|
|
|
|
{
|
|
|
|
|
result.list.isFamily = false,
|
|
|
|
|
sharedPref.setObject(USER_PROFILE, result.list),
|
|
|
|
|
this.sharedPref.setObject(MAIN_USER, result.list),
|
|
|
|
|
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
|
|
|
|
|
sharedPref.setString(TOKEN, result.authenticationTokenID),
|
|
|
|
|
Navigator.of(context).pushNamed(HOME)
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
this
|
|
|
|
|
.authService
|
|
|
|
|
.registerUser(request)
|
|
|
|
|
.then((result) => {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context),
|
|
|
|
|
// userData = result.list;
|
|
|
|
|
//AuthenticatedUser.fromJson(result['List'][0]),
|
|
|
|
|
if (result is String)
|
|
|
|
|
{
|
|
|
|
|
new ConfirmDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: result,
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
okFunction: () =>
|
|
|
|
|
{ConfirmDialog.closeAlertDialog(context)},
|
|
|
|
|
cancelFunction: () => {
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context)
|
|
|
|
|
}).showAlertDialog(context)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
result.list.isFamily = false,
|
|
|
|
|
sharedPref.setObject(USER_PROFILE, result.list),
|
|
|
|
|
this.sharedPref.setObject(MAIN_USER, result.list),
|
|
|
|
|
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
|
|
|
|
|
sharedPref.setString(TOKEN, result.authenticationTokenID),
|
|
|
|
|
Navigator.of(context).pushNamed(HOME)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: err,
|
|
|
|
|
okText: TranslationBase.of(context).confirm,
|
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
okFunction: () => {
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context)
|
|
|
|
|
},
|
|
|
|
|
okFunction: () => {ConfirmDialog.closeAlertDialog(context)},
|
|
|
|
|
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -347,12 +349,12 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
|
"PatientIdentificationNo": registerInfo.idNumber,
|
|
|
|
|
"MobileNumber": registerd_data.patientMobileNumber,
|
|
|
|
|
"PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1,
|
|
|
|
|
"FirstNameN":registerInfo.firstNameAr =='-' ?"": registerInfo.firstNameAr,
|
|
|
|
|
"FirstName": registerInfo.firstNameEn =='-' ?"":registerInfo.firstNameEn,
|
|
|
|
|
"MiddleNameN":registerInfo.secondNameAr =='-' ? "" : registerInfo.secondNameAr,
|
|
|
|
|
"MiddleName":registerInfo.secondNameEn == '-' ? "": registerInfo.secondNameEn,
|
|
|
|
|
"LastNameN": registerInfo.lastNameAr =='-'? "" : registerInfo.lastNameAr,
|
|
|
|
|
"LastName": registerInfo.lastNameEn =='-' ? "": registerInfo.lastNameEn,
|
|
|
|
|
"FirstNameN": registerInfo.firstNameAr,
|
|
|
|
|
"FirstName": registerInfo.firstNameEn,
|
|
|
|
|
"MiddleNameN": registerInfo.secondNameAr,
|
|
|
|
|
"MiddleName": registerInfo.secondNameEn,
|
|
|
|
|
"LastNameN": registerInfo.lastNameAr,
|
|
|
|
|
"LastName": registerInfo.lastNameEn,
|
|
|
|
|
"StrDateofBirth": registerInfo.dateOfBirth,
|
|
|
|
|
"DateofBirth": DateUtil.convertISODateToJsonDate(
|
|
|
|
|
registerInfo.dateOfBirth.replaceAll('/', '-')),
|
|
|
|
|