diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts
index e547c75a..fcb916f8 100644
--- a/Mohem/src/app/authentication/login/login.component.ts
+++ b/Mohem/src/app/authentication/login/login.component.ts
@@ -31,6 +31,11 @@ export class LoginComponent implements OnInit, OnDestroy {
isSupportAr:boolean=false;
isAppleStore:boolean=false;
memberLogin: any = {};
+
+ private password: string;
+ private language: string;
+ private username : string;
+
constructor(
public cs: CommonService,
public authService: AuthenticationService,
@@ -58,6 +63,14 @@ export class LoginComponent implements OnInit, OnDestroy {
}
public changeLanguage(){
this.ts.switchLanguage();
+ console.log(this.ts.getCurrentSystemLanguageName());
+ if(TranslatorService.CURRENT_LANGUAGE == TranslatorService.EN)
+ {
+ this.language = "US";
+ }
+ else{
+ this.language = "AR";
+ }
}
private checkIfLoggedInBefore() {
this.cs.startLoading();
@@ -135,10 +148,10 @@ export class LoginComponent implements OnInit, OnDestroy {
private initializeForAuthentictedUser(user: AuthenticatedUser) {
this.ngZone.run(() => {
- this.isMobileFingerPrint = true;
- this.FingerPrintPatientIdentificationID = user.IdentificationNo;
- this.mobileNumber = user.MobileNumber;
- this.zipCode = CountryCode.localCode(user.ZipCode);
+ //this.isMobileFingerPrint = true;
+ //this.FingerPrintPatientIdentificationID = user.IdentificationNo;
+ //this.mobileNumber = user.MobileNumber;
+ //this.zipCode = CountryCode.localCode(user.ZipCode);
});
}
@@ -157,16 +170,7 @@ export class LoginComponent implements OnInit, OnDestroy {
}).catch((error: any) => console.log(error));
}
-
- /**
- we need holders here since the country code maybe is not loaded yet for automatic login
- */
- private mobileNumber: string;
- private zipCode: string;
-
public onLogin() {
-
-
this.checkUserAuthentication();
}
@@ -344,17 +348,17 @@ export class LoginComponent implements OnInit, OnDestroy {
private checkUserAuthentication() {
const request = new CheckUserAuthenticationRequest();
- request.PatientMobileNumber = this.mobileNumber;
- request.ZipCode = this.zipCode;
- request.isRegister = false;
- request.TokenID = '';
-
+ request.P_USER_NAME = this.username;
+ request.P_LANGUAGE = this.language;
+ request.P_PASSWORD = this.password;
+ console.log(request);
this.authService.checkUserAuthentication(
request,
() => {
-
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
+ console.log(result);
+ this.cs.openSMSPage();
this.loginTokenID = result.LogInTokenID;
this.patientOutSA = result.PatientOutSA;
this.isMobileFingerPrint = false;
@@ -399,7 +403,7 @@ export class LoginComponent implements OnInit, OnDestroy {
private FingerPrintPatientIdentificationID: string;
private checkActivationCode(readedCode?) {
- const request = new CheckActivationCodeRequest();
+ /*const request = new CheckActivationCodeRequest();
request.IsMobileFingerPrint = this.isMobileFingerPrint;
request.FingerPrintPatientIdentificationID = this.FingerPrintPatientIdentificationID;
request.LogInTokenID = this.loginTokenID;
@@ -408,6 +412,8 @@ export class LoginComponent implements OnInit, OnDestroy {
request.IsSilentLogin = !readedCode;
request.PatientMobileNumber = this.mobileNumber;
request.ZipCode = this.zipCode;
+ request.isRegister = false;*/
+
// request.SearchType = this.loginType;
// if (this.loginType === LoginComponent.IDENTIFCIATION_LOGIN_TYPE) {
// request.PatientIdentificationID = this.id;
@@ -416,7 +422,6 @@ export class LoginComponent implements OnInit, OnDestroy {
// request.PatientID = Number(this.id);
// request.PatientIdentificationID = '';
// }
- request.isRegister = false;
// this.authService.checkActivationCode(
// request,
// () => {
@@ -440,7 +445,7 @@ export class LoginComponent implements OnInit, OnDestroy {
if (this.authService.isAgreedBefore()) {
this.cs.openHome();
} else {
- this.cs.openAgreement();
+ //this.cs.openAgreement();
}
});
}
diff --git a/Mohem/src/app/authentication/sms-page/sms-page.module.ts b/Mohem/src/app/authentication/sms-page/sms-page.module.ts
new file mode 100644
index 00000000..049e14a0
--- /dev/null
+++ b/Mohem/src/app/authentication/sms-page/sms-page.module.ts
@@ -0,0 +1,26 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { Routes, RouterModule } from '@angular/router';
+
+import { IonicModule } from '@ionic/angular';
+
+import { SmsPagePage } from './sms-page.page';
+
+const routes: Routes = [
+ {
+ path: 'smspage',
+ component: SmsPagePage
+ }
+];
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ RouterModule.forChild(routes)
+ ],
+ declarations: [SmsPagePage]
+})
+export class SmsPagePageModule {}
diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.html b/Mohem/src/app/authentication/sms-page/sms-page.page.html
new file mode 100644
index 00000000..c49cc795
--- /dev/null
+++ b/Mohem/src/app/authentication/sms-page/sms-page.page.html
@@ -0,0 +1,36 @@
+
+
+ {{'verificationcode.verificationcode' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{'verificationcode.title' | translate}}{{'verificationcode.verificationcode' | translate}} {{'verificationcode.by' | translate}}{{'verificationcode.sms' | translate}}{{'verificationcode.instruct' | translate}}{{'general.submit' | translate}}
+
+
+
+
+
+
+
{{displayTime}}
+
+
+ {{'verificationcode.verificationcode' | translate}}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.scss b/Mohem/src/app/authentication/sms-page/sms-page.page.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.spec.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.spec.ts
new file mode 100644
index 00000000..48e022a2
--- /dev/null
+++ b/Mohem/src/app/authentication/sms-page/sms-page.page.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SmsPagePage } from './sms-page.page';
+
+describe('SmsPagePage', () => {
+ let component: SmsPagePage;
+ let fixture: ComponentFixture
;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SmsPagePage ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SmsPagePage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.ts
new file mode 100644
index 00000000..9d67eec3
--- /dev/null
+++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts
@@ -0,0 +1,38 @@
+import { Component, OnInit } from '@angular/core';
+import { ElementRef} from '@angular/core';
+import { NavController } from '@ionic/angular';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
+@Component({
+ selector: 'app-sms-page',
+ templateUrl: './sms-page.page.html',
+ styleUrls: ['./sms-page.page.scss'],
+})
+export class SmsPagePage implements OnInit {
+
+ Channel: number=0;
+ activationCode: string;
+ P_SESSION_ID: number;
+ timeInSeconds: any;
+ time:any;
+ runTimer:any;
+ hasStarted: any;
+ hasFinished: any;
+ remainingTime:any;
+ displayTime:any;
+ loginTokenID:string;
+public isForgetPwd:boolean=false;
+public isExpiredPwd:boolean=false;
+public count:number=0;
+
+ constructor(public navCtrl: NavController,
+ public translate: TranslatorService,
+ public common:CommonService,
+ private elementRef:ElementRef,
+ public sharedData:SharedDataService) { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts
index 0a70b492..b5afd01e 100644
--- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts
+++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts
@@ -36,6 +36,9 @@ export class AuthenticationService {
/* login methods */
public static loginURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static checkUserAuthURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
+
+ public static login = 'Services/ERP.svc/REST/MemberLogin';
+
public static activationCodeURL = 'Services/Authentication.svc/REST/CheckActivationCode';
public static getLoginInfoURL = 'Services/Authentication.svc/REST/GetMobileLoginInfo';
@@ -90,12 +93,13 @@ export class AuthenticationService {
}
public setPublicFields(request: Request): Request {
- request.VersionID = 3.6;
- request.Channel = 3;
+ request.VersionID = 1;
+ request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode();
- request.IPAdress = '10.10.10.10';
+ //request.IPAdress = '10.10.10.10';
request.SessionID = 'any thing'; // ??? required for not authorized login funny
- request.isDentalAllowedBackend = false;
+ request.MobileType = "android";
+ //request.isDentalAllowedBackend = false;
return request;
}
@@ -420,7 +424,7 @@ export class AuthenticationService {
public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable {
this.setPublicFields(request);
- return this.con.post(AuthenticationService.checkUserAuthURL, request, onError, errorLabel);
+ return this.con.post(AuthenticationService.login, request, onError, errorLabel);
}
public checkActivationCode(request: CheckActivationCodeRequest, onError: any, errorLabel: string)
@@ -466,8 +470,8 @@ export class AuthenticationService {
request.TokenID = '';
request.PatientIdentificationID = '';
request.PatientID = 0;
- request.SearchType = 2;
- request.isRegister = false;
+ //request.SearchType = 2;
+ //request.isRegister = false;
return this.con.post(AuthenticationService.sendSMSForgotFileNoURL, request, onError, errorLabel);
}
@@ -540,7 +544,7 @@ export class AuthenticationService {
} else {
this.cs.presentConfirmDialog(this.ts.trPK('login', 'enter-email'),
() => {
- this.cs.openPatientProfile();
+ //this.cs.openPatientProfile();
observer.complete();
});
}
@@ -564,7 +568,7 @@ export class AuthenticationService {
private sessionTimeOutDialog() {
this.cs.presentConfirmDialog(this.ts.trPK('general', 'idle-relogin'), () => {
- this.cs.openUserLogin();
+ //this.cs.openUserLogin();
});
}
diff --git a/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.request.ts b/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.request.ts
index 5121f239..45314c6f 100644
--- a/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.request.ts
+++ b/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.request.ts
@@ -1,10 +1,14 @@
import { Request } from '../../models/request';
export class CheckUserAuthenticationRequest extends Request {
- PatientIdentificationID: string; // id
- PatientMobileNumber: string; // phone number
- ZipCode: string;
- SearchType: number; // 1 for id , 2 for file no
- isRegister: boolean; // false
- LogInTokenID?: string;
+ // PatientIdentificationID: string; // id
+ // PatientMobileNumber: string; // phone number
+ // ZipCode: string;
+ // SearchType: number; // 1 for id , 2 for file no
+ // isRegister: boolean; // false
+ // LogInTokenID?: string;
+
+ P_USER_NAME:string;
+ P_LANGUAGE: string;
+ P_PASSWORD: string;
}
diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts
index 2a54f10e..7cdaa3ab 100644
--- a/Mohem/src/app/hmg-common/services/common/common.service.ts
+++ b/Mohem/src/app/hmg-common/services/common/common.service.ts
@@ -899,6 +899,9 @@ export class CommonService {
public openUserForgot() {
this.nav.navigateForward(["/authentication/forgot"]);
}
+ public openSMSPage() {
+ this.nav.navigateForward(["/authentication/smspage"]);
+ }
public navigateTo(url: string) {
diff --git a/Mohem/src/app/hmg-common/services/models/request.ts b/Mohem/src/app/hmg-common/services/models/request.ts
index d88b96f0..77dee9a3 100644
--- a/Mohem/src/app/hmg-common/services/models/request.ts
+++ b/Mohem/src/app/hmg-common/services/models/request.ts
@@ -12,6 +12,7 @@ export class Request {
public IsIrisPrescription: boolean;
public TokenID: string;
public SessionID: string;
+ public MobileType: string;
public PatientIdentificationID: string;
public PatientMobileNumber: string;
public BookedBy?: number;
diff --git a/Mohem/src/app/hmg-common/ui/sms/sms.page.html b/Mohem/src/app/hmg-common/ui/sms/sms.page.html
index ac32038f..c49cc795 100644
--- a/Mohem/src/app/hmg-common/ui/sms/sms.page.html
+++ b/Mohem/src/app/hmg-common/ui/sms/sms.page.html
@@ -1,51 +1,36 @@
-
- {{'sms,title' | translate}}
-
+
+ {{'verificationcode.verificationcode' | translate}}
+
-
-
-
-
-
-
-
-
-
- {{ 'home,verification-code-text'| translate}}
-
-
- {{mobile}}
-
-
-
-
- {{ 'h2o,verification_message' | translate}}
-
-
-
-
-
-
- {{ 'h2o,validation_message' | translate}}
-
-
- {{displayTime}}
-
+
+
+
+
+
+
-
-
- {{'h2o,code_failure' | translate}}
-
-
- {{'h2o,resend' | translate}}
-
-
-
-
- {{'general,submit' | translate}}
-
+
+
+ {{'verificationcode.title' | translate}}{{'verificationcode.verificationcode' | translate}} {{'verificationcode.by' | translate}}{{'verificationcode.sms' | translate}}{{'verificationcode.instruct' | translate}}{{'general.submit' | translate}}
+
-
-
\ No newline at end of file
+
+
+
+
+
{{displayTime}}
+
+
+ {{'verificationcode.verificationcode' | translate}}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file