update home

MOHEMM-Q3-DEV-LATEST
Sultan Khan 7 years ago
parent fe7e62bbe6
commit b967536b26

@ -12,7 +12,7 @@
</div> </div>
</div> </div>
<ion-list> <!-- <ion-list>
<button class="menu-item" ion-item menuClose ion-item (click)="goToWorkListPage()" > <button class="menu-item" ion-item menuClose ion-item (click)="goToWorkListPage()" >
<img width="30" src="../assets/imgs/bell.png" item-left > <img width="30" src="../assets/imgs/bell.png" item-left >
{{"home.worklist" | translate }} {{"home.worklist" | translate }}
@ -29,7 +29,7 @@
{{"home.logout" | translate }} {{"home.logout" | translate }}
</button> </button>
</ion-list> </ion-list> -->
<div class="menuFooter"> <div class="menuFooter">

@ -3,110 +3,173 @@ header
*/ */
.menu-header { .menu-header {
height: 2.5cm; height: 2.5cm;
} }
.content-ios:not([no-bounce]) > .scroll-content::before { .content-ios:not([no-bounce])>.scroll-content::before {
bottom: 0; bottom: 0;
} }
.menu-header .logo { .menu-header .logo {
position: absolute; position: absolute;
left: 0.6cm; left: 0.6cm;
top: 0.9cm; top: 0.9cm;
width: 1.6cm; width: 1.6cm;
} }
.menu-header .background { .menu-header .background {
height: 1.5cm; height: 1.5cm;
width: 100%; width: 100%;
} }
/* title */ /* title */
.title-v-spacer { .title-v-spacer {
height: 0.7cm; height: 0.7cm;
} }
.suliman-title { .suliman-title {
margin-left: 0.3cm; margin-left: 0.3cm;
margin-right: 0.3cm; margin-right: 0.3cm;
font-weight: bold; font-weight: bold;
font-size: 0.5cm; font-size: 0.5cm;
} }
.group-title { .group-title {
margin-left: 0.4cm; margin-left: 0.4cm;
margin-right: 0.4cm; margin-right: 0.4cm;
font-size: 0.4cm; font-size: 0.4cm;
} }
/* /*
items items
*/ */
.items-buttons-spacer { .items-buttons-spacer {
height: 10%; height: 10%;
} }
/*
/*
user information user information
*/ */
.user-v-spacer { .user-v-spacer {
height: 0.5cm; height: 0.5cm;
} }
.user-name-title { .user-name-title {
margin-left: 0.3cm; margin-left: 0.3cm;
margin-right: 0.3cm; margin-right: 0.3cm;
font-weight: bold; font-weight: bold;
} }
.file-id-title { .file-id-title {
margin-left: 0.4cm; margin-left: 0.4cm;
margin-right: 0.4cm; margin-right: 0.4cm;
} }
.social-media-container { .social-media-container {
position: absolute !important; position: absolute !important;
width: 100%; width: 100%;
bottom: 0.2cm; bottom: 0.2cm;
background-color: white; background-color: white;
} }
.icon-spacer { .icon-spacer {
margin-right: 0.3cm; margin-right: 0.3cm;
margin-left: 0.3cm; margin-left: 0.3cm;
} }
/*mobile Landscape */ /*mobile Landscape */
@media only screen and (min-device-height: 0px) and (max-device-height: 515px) and (orientation: landscape) { @media only screen and (min-device-height: 0px) and (max-device-height: 515px) and (orientation: landscape) {
.social-media-container { .social-media-container {
display: none; display: none;
} }
} }
.info-container {
.info-container {
overflow-y: scroll; overflow-y: scroll;
width: 100%; width: 100%;
position: absolute; position: absolute;
top: 2.6cm; top: 2.6cm;
bottom: 0.2cm; bottom: 0.2cm;
padding-bottom: 4.5cm; padding-bottom: 4.5cm;
} }
@media only screen and (orientation: landscape) { @media only screen and (orientation: landscape) {
.info-container { .info-container {
padding-bottom: 0.2cm; padding-bottom: 0.2cm;
} }
} }
.member { .member {
border-bottom-color: var(--ion-color-medium) !important; border-bottom-color: var(--ion-color-medium) !important;
border-bottom-width: 0.02cm; border-bottom-width: 0.02cm;
border-bottom-style: solid; border-bottom-style: solid;
/* margin-left: 0.4cm; */ /* margin-left: 0.4cm; */
} }
.selected-member { .selected-member {
border-bottom-color: var(--ion-color-secondary) !important; border-bottom-color: var(--ion-color-secondary) !important;
border-bottom-width: 0.02cm; border-bottom-width: 0.02cm;
border-bottom-style: solid; border-bottom-style: solid;
margin-left: 0.2cm; margin-left: 0.2cm;
} }
.sidebar-menu .header-div {
background: var(--primary);
background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%, var(--secondary) 59%, var(--customnavy) 100%);
background: -webkit-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%, var(--secondary) 59%, var(--customnavy) 100%);
background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%, var(--secondary) 59%, var(--customnavy) 100%);
color: var(--light);
text-transform: capitalize;
height: 120px;
position: relative;
display: block;
margin-bottom: 40px;
}
.list-md .item-block .item-inner,
.list-ios .item-block .item-inner {
border-color: var(--primary);
border-bottom: 0px;
}
.list-md>.item-block:last-child .item-inner,
.list-ios>.item-block:last-child .item-inner {
border-bottom: 0px;
}
button.menu-item.item.item-block.item-md,
button.menu-item.item.item-block.item-ios {
border-bottom: 1px solid var(--cusgray);
color: var(--customnavy);
}
.TxtPlace {
margin: 0;
padding: 40px 0 10px 0;
text-align: center;
}
.menuFooter {
position: fixed;
bottom: 0px;
text-align: center;
margin: auto;
width: 100%;
}
.menuFooter div {
width: 80px;
// height: 80px;
margin: auto;
}
.menuFooter .CompanyImg {
width: 100%;
height: 100%;
}
.companyTxt {
font-size: 12px;
color: var(--customnavy);
text-align: center;
}

@ -20,7 +20,7 @@ export class AppComponent implements OnInit, AfterViewInit {
start: any = false; start: any = false;
menuList: any = []; menuList: any = [];
User_name_Emp: string = ""; User_name_Emp: string = "";
user_image: string = ""; user_image: string = "../assets/imgs/profile.png"
menuSide: string = "left"; menuSide: string = "left";
notBadge: number; notBadge: number;
companyUrl: string = "../assets/imgs/CS.png"; companyUrl: string = "../assets/imgs/CS.png";

@ -94,7 +94,7 @@ export class ForgotComponent implements OnInit,OnDestroy {
private checkActivationCode(readedCode?) { private checkActivationCode(readedCode?) {
const request = new CheckActivationCodeRequest(); const request = new CheckActivationCodeRequest();
request.LogInTokenID = this.checkUserResult.LogInTokenID; request.LogInTokenID = this.checkUserResult.LogInTokenID;
request.PatientOutSA = this.checkUserResult.PatientOutSA ? 1 : 0; //request.PatientOutSA = this.checkUserResult.PatientOutSA ? 1 : 0;
request.PatientMobileNumber = this.countryCode.number; request.PatientMobileNumber = this.countryCode.number;
request.ZipCode = CountryCode.localCode(this.countryCode.code); request.ZipCode = CountryCode.localCode(this.countryCode.code);
request.activationCode = readedCode; request.activationCode = readedCode;

@ -30,11 +30,10 @@ export class LoginComponent implements OnInit, OnDestroy {
isSupportAr:boolean=false; isSupportAr:boolean=false;
isAppleStore:boolean=false; isAppleStore:boolean=false;
memberLogin: any = {}; memberLogin: any = {};
private password: string; private password: string;
private language: string; private language: string;
private username : string; private username : string;
private currentLang : any = 2; private currentLang : any =1;
private patientOutSA: boolean; private patientOutSA: boolean;
private loginTokenID: string; private loginTokenID: string;
private isMobileFingerPrint: boolean; private isMobileFingerPrint: boolean;
@ -56,12 +55,6 @@ export class LoginComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
console.log(this.currentLang);
//this.setIdPattern();
// setTimeout(() => {
// this.checkIfLoggedInBefore();
// // this.splash.hide();
// }, 100);
} }

@ -90,6 +90,7 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { RateService } from './services/rate/rate.service'; import { RateService } from './services/rate/rate.service';
import { PaymentComponent } from './ui/payment/payment.component'; import { PaymentComponent } from './ui/payment/payment.component';
import { PaymentService } from './ui/payment/service/payment.service'; import { PaymentService } from './ui/payment/service/payment.service';
import { MenuService } from './services/menu/menuservice.service';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
@ -237,8 +238,8 @@ import { PaymentService } from './ui/payment/service/payment.service';
RatingService, RatingService,
InAppBrowser, InAppBrowser,
RateService, RateService,
PaymentService PaymentService,
MenuService
] ]
}) })
export class HmgCommonModule { } export class HmgCommonModule { }

@ -1,66 +1,74 @@
import { Injectable } from '@angular/core'; import { Injectable } from "@angular/core";
import { Request } from '../models/request'; import { Request } from "../models/request";
import { TranslatorService } from '../translator/translator.service'; import { TranslatorService } from "../translator/translator.service";
import { ConnectorService } from '../connector/connector.service'; import { ConnectorService } from "../connector/connector.service";
import { Observable, throwError } from 'rxjs'; import { Observable, throwError } from "rxjs";
import { CheckPatientRegisterationRequest } from './models/check-patient-registeration.request'; import { CheckPatientRegisterationRequest } from "./models/check-patient-registeration.request";
import { LoginRequest } from './models/login.request'; import { LoginRequest } from "./models/login.request";
import { Response } from '../models/response'; import { Response } from "../models/response";
import { AuthenticatedUser } from './models/authenticated-user'; import { AuthenticatedUser } from "./models/authenticated-user";
import { CommonService } from '../common/common.service'; import { CommonService } from "../common/common.service";
import { CheckUserAuthenticationRequest } from './models/check-user-auth.request'; import { CheckUserAuthenticationRequest } from "./models/check-user-auth.request";
import { CheckActivationCodeRequest } from './models/check-activation-code.request'; import { CheckActivationCodeRequest } from "./models/check-activation-code.request";
import { CheckUserAuthenticationResponse } from './models/check-user-auth.response'; import { CheckUserAuthenticationResponse } from "./models/check-user-auth.response";
import { CheckActivationCodeResponse } from './models/check-activation-code.response'; import { CheckActivationCodeResponse } from "./models/check-activation-code.response";
import { NativeStorage } from '@ionic-native/native-storage/ngx'; import { NativeStorage } from "@ionic-native/native-storage/ngx";
import { CheckRegisterationCodeRequest } from './models/check-registeration-code.request'; import { CheckRegisterationCodeRequest } from "./models/check-registeration-code.request";
import { RegisterInformationRequest } from './models/register-information.request'; import { RegisterInformationRequest } from "./models/register-information.request";
import { ForgotFileIDResponse } from './models/forgot-File-ID.response'; import { ForgotFileIDResponse } from "./models/forgot-File-ID.response";
import { EmailRequest } from '../models/email-request'; import { EmailRequest } from "../models/email-request";
import { EmailInput } from '../../ui/email/models/email-input'; import { EmailInput } from "../../ui/email/models/email-input";
import { UserLocalNotificationService } from '../user-local-notification/user-local-notification.service'; import { UserLocalNotificationService } from "../user-local-notification/user-local-notification.service";
import { GetLoginInfoRequest } from './models/get-login-info.request'; import { GetLoginInfoRequest } from "./models/get-login-info.request";
import { GetLoginInfoResponse } from './models/get-login-info.response'; import { GetLoginInfoResponse } from "./models/get-login-info.response";
import { analyzeAndValidateNgModules } from '@angular/compiler'; import { analyzeAndValidateNgModules } from "@angular/compiler";
import { Events } from '@ionic/angular'; import { Events } from "@ionic/angular";
import { InternationalMobileComponent } from '../../ui/mobile-number/international-mobile/international-mobile.component'; import { InternationalMobileComponent } from "../../ui/mobile-number/international-mobile/international-mobile.component";
import { SMSCheckRequest } from './models/smscheck.request'; import { SMSCheckRequest } from "./models/smscheck.request";
import { SMSCheckResponse } from './models/smscheck.response'; import { SMSCheckResponse } from "./models/smscheck.response";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: "root"
}) })
export class AuthenticationService { export class AuthenticationService {
public static MOBILE_USER = 102; public static MOBILE_USER = 102;
/* login methods */ /* login methods */
public static loginURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication'; public static loginURL =
public static checkUserAuthURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication'; "Services/Authentication.svc/REST/CheckPatientAuthentication";
public static checkUserAuthURL =
"Services/Authentication.svc/REST/CheckPatientAuthentication";
public static login = 'Services/ERP.svc/REST/MemberLogin'; public static login = "Services/ERP.svc/REST/MemberLogin";
public static activationCodeURL = 'Services/Authentication.svc/REST/CheckActivationCode'; public static activationCodeURL =
public static getLoginInfoURL = 'Services/Authentication.svc/REST/GetMobileLoginInfo'; "Services/Authentication.svc/REST/CheckActivationCode";
public static getLoginInfoURL =
"Services/Authentication.svc/REST/GetMobileLoginInfo";
public static smsCheck='Services/ERP.svc/REST/CheckActivationCode'; public static smsCheck = "Services/ERP.svc/REST/CheckActivationCode";
public static smsCheckForget='Services/ERP.svc/REST/CheckPublicActivationCode'; public static smsCheckForget =
public static smsSendCode='Services/ERP.svc/REST/SendPublicActivationCode'; "Services/ERP.svc/REST/CheckPublicActivationCode";
public static smsSendCode = "Services/ERP.svc/REST/SendPublicActivationCode";
/* register methods */ /* register methods */
public static checkPatientForRegisterationURL = 'Services/Authentication.svc/REST/CheckPatientForRegisteration'; public static checkPatientForRegisterationURL =
public static sendSmsForRegisterURL = 'Services/Authentication.svc/REST/SendSMSForPatientRegisteration'; "Services/Authentication.svc/REST/CheckPatientForRegisteration";
public static registerTempUserURL = 'Services/Authentication.svc/REST/RegisterTempPatientWithoutSMS'; public static sendSmsForRegisterURL =
"Services/Authentication.svc/REST/SendSMSForPatientRegisteration";
public static sendSMSForgotFileNoURL = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber'; public static registerTempUserURL =
public static forgotFileIDURL = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo'; "Services/Authentication.svc/REST/RegisterTempPatientWithoutSMS";
public static sendSMSForgotFileNoURL =
"Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber";
public static forgotFileIDURL =
"Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo";
public static user: AuthenticatedUser; public static user: AuthenticatedUser;
public static LOGIN_EVENT = 'user-login-event'; public static LOGIN_EVENT = "user-login-event";
public static FAMILY_LOGIN_EVENT = 'family-login-event'; public static FAMILY_LOGIN_EVENT = "family-login-event";
public static AUTHENTICATED_USER_KEY = 'save-authenticated-user'; public static AUTHENTICATED_USER_KEY = "save-authenticated-user";
// private static user: AuthenticatedUser; // private static user: AuthenticatedUser;
constructor( constructor(
@ -70,18 +78,19 @@ export class AuthenticationService {
public nativeStorage: NativeStorage, public nativeStorage: NativeStorage,
public localNotifications: UserLocalNotificationService, public localNotifications: UserLocalNotificationService,
private events: Events private events: Events
) { } ) {}
public authenticateRequest(request: Request, automaticLogin = true): Request { public authenticateRequest(request: Request, automaticLogin = true): Request {
this.setPublicFields(request); this.setPublicFields(request);
const user = this.getAuthenticatedUser(); const user = this.getAuthenticatedUser();
if (user) { if (user) {
/*user with eye prescriptions*/ /*user with eye prescriptions*/
// request.PatientID = user.PatientID; request.P_SESSION_ID = user.P_SESSION_ID;
// request.TokenID = user.TokenID; request.MobileNumber = user.EMPLOYEE_MOBILE_NUMBER;
// request.PatientOutSA = user.PatientOutSA ? 1 : 0; request.LogInTokenID = user.LogInTokenID;
// request.PatientTypeID = user.PatientTypeID; request.TokenID = user.TokenID;
request.P_USER_NAME = user.EMPLOYEE_NUMBER;
request.UserName = user.EMPLOYEE_NUMBER;
if (AuthenticationService.requireRelogin) { if (AuthenticationService.requireRelogin) {
this.sessionTimeOutDialog(); this.sessionTimeOutDialog();
} }
@ -103,13 +112,16 @@ export class AuthenticationService {
request.Channel = 31; request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode(); 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.SessionID = "any thing"; // ??? required for not authorized login funny
request.MobileType = "android"; request.MobileType = "android";
//request.isDentalAllowedBackend = false; //request.isDentalAllowedBackend = false;
return request; return request;
} }
public authenticateAndSetPersonalInformation(request: EmailRequest, examinationInfo?: any): EmailRequest { public authenticateAndSetPersonalInformation(
request: EmailRequest,
examinationInfo?: any
): EmailRequest {
// if not authenticated will be redirected to login // if not authenticated will be redirected to login
this.authenticateRequest(request); this.authenticateRequest(request);
const user = this.getAuthenticatedUser(); const user = this.getAuthenticatedUser();
@ -123,53 +135,67 @@ export class AuthenticationService {
// request.PatientTypeID = user.PatientTypeID; // request.PatientTypeID = user.PatientTypeID;
if (examinationInfo) { if (examinationInfo) {
if (examinationInfo.SetupID) { request.SetupID = examinationInfo.SetupID; } if (examinationInfo.SetupID) {
if (examinationInfo.ProjectName) { request.ProjectName = examinationInfo.ProjectName; } request.SetupID = examinationInfo.SetupID;
if (examinationInfo.ClinicName) { request.ClinicName = examinationInfo.ClinicDescription; } }
if (examinationInfo.DoctorName) { request.DoctorName = examinationInfo.DoctorName; } if (examinationInfo.ProjectName) {
if (examinationInfo.ProjectID) { request.ProjectID = examinationInfo.ProjectID; } request.ProjectName = examinationInfo.ProjectName;
if (examinationInfo.InvoiceNo) { request.InvoiceNo = examinationInfo.InvoiceNo; } }
if (examinationInfo.ClinicName) {
request.ClinicName = examinationInfo.ClinicDescription;
}
if (examinationInfo.DoctorName) {
request.DoctorName = examinationInfo.DoctorName;
}
if (examinationInfo.ProjectID) {
request.ProjectID = examinationInfo.ProjectID;
}
if (examinationInfo.InvoiceNo) {
request.InvoiceNo = examinationInfo.InvoiceNo;
}
if (examinationInfo.OrderDate) { if (examinationInfo.OrderDate) {
request.OrderDate = this.cs.getDateISO(this.cs.evaluteDateAsObject(examinationInfo.OrderDate)); request.OrderDate = this.cs.getDateISO(
this.cs.evaluteDateAsObject(examinationInfo.OrderDate)
);
} }
} }
} }
return request; return request;
} }
public getAuthenticatedRequest(login = true): Request { public getAuthenticatedRequest(login = true): Request {
const request = new Request(); const request = new Request();
this.authenticateRequest(request, login); this.authenticateRequest(request, login);
return request; return request;
} }
public getPublicRequest(): Request { public getPublicRequest(): Request {
const request = new Request(); const request = new Request();
this.setPublicFields(request); this.setPublicFields(request);
return request; return request;
} }
public login(
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> { request: LoginRequest,
onError: any,
errorLabel: string
): Observable<Response> {
request.PatientID = 0; request.PatientID = 0;
request.TokenID = ''; request.TokenID = "";
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;
request.isRegister = false; request.isRegister = false;
return this.con.post(AuthenticationService.loginURL, request, onError, errorLabel); return this.con.post(
AuthenticationService.loginURL,
request,
onError,
errorLabel
);
} }
public isAuthenticated(): boolean { public isAuthenticated(): boolean {
return AuthenticationService.user != null; return AuthenticationService.user != null;
} }
/** /**
* this fucntion load from user information if he logged in before * this fucntion load from user information if he logged in before
* and save user into memory and local storage * and save user into memory and local storage
@ -180,49 +206,47 @@ export class AuthenticationService {
* 1- user stored in local storage without token * 1- user stored in local storage without token
* @param result check activation code result * @param result check activation code result
*/ */
public setAuthenticatedUser(result: CheckActivationCodeResponse): Observable<boolean> { public setAuthenticatedUser(
result: CheckActivationCodeResponse
): Observable<boolean> {
return Observable.create(observer => { return Observable.create(observer => {
this.loadAuthenticatedUser().subscribe((loadedUser: AuthenticatedUser) => { this.loadAuthenticatedUser().subscribe(
(loadedUser: AuthenticatedUser) => {
AuthenticationService.requireRelogin = false; AuthenticationService.requireRelogin = false;
this.startIdleMonitoring(); this.startIdleMonitoring();
const user = this.updateAuthenticatedUser(result, loadedUser); const user = this.updateAuthenticatedUser(result, loadedUser);
/* we store in hd without token but with token in memory*/ /* we store in hd without token but with token in memory*/
this.saveUserInStorage(user).subscribe((success: boolean) => { this.saveUserInStorage(user).subscribe((success: boolean) => {
AuthenticationService.user = user; AuthenticationService.user = user;
this.publishUserChangeEvent(); this.publishUserChangeEvent();
observer.next(true); observer.next(true);
observer.complete(); observer.complete();
}); });
}
);
}); });
});
} }
public resetAuthenticatedUser(user: AuthenticatedUser ) { public resetAuthenticatedUser(user: AuthenticatedUser) {
AuthenticationService.user = user; AuthenticationService.user = user;
AuthenticationService.requireRelogin = false; AuthenticationService.requireRelogin = false;
this.startIdleMonitoring(); this.startIdleMonitoring();
this.publishUserChangeEvent(); this.publishUserChangeEvent();
} }
public setAuthenticatedMemberFamilyUser(result: CheckActivationCodeResponse) { public setAuthenticatedMemberFamilyUser(result: CheckActivationCodeResponse) {
const authUser = new AuthenticatedUser(); const authUser = new AuthenticatedUser();
AuthenticationService.requireRelogin = false; AuthenticationService.requireRelogin = false;
this.startIdleMonitoring(); this.startIdleMonitoring();
const user = this.updateAuthenticatedUser(result, authUser); const user = this.updateAuthenticatedUser(result, authUser);
// user["hello"]= "ok"; // user["hello"]= "ok";
/* we store in hd without token but with token in memory*/ /* we store in hd without token but with token in memory*/
AuthenticationService.user = user; AuthenticationService.user = user;
this.publishFamilyMemeberUserChangeEvent(); this.publishFamilyMemeberUserChangeEvent();
} }
public updateLoggedInUser(newUser: AuthenticatedUser): Observable<boolean> { public updateLoggedInUser(newUser: AuthenticatedUser): Observable<boolean> {
return Observable.create(observer => { return Observable.create(observer => {
/* we store in hd without token but with token in memory*/ /* we store in hd without token but with token in memory*/
@ -233,9 +257,7 @@ export class AuthenticationService {
observer.next(success); observer.next(success);
observer.complete(); observer.complete();
}); });
}); });
} }
public setDeviceToken(token: string) { public setDeviceToken(token: string) {
@ -248,26 +270,49 @@ export class AuthenticationService {
} }
} }
public registerTempUser(request: RegisterInformationRequest, onError: any, errorLabel: string) public registerTempUser(
: Observable<CheckActivationCodeResponse> { request: RegisterInformationRequest,
onError: any,
errorLabel: string
): Observable<CheckActivationCodeResponse> {
this.setPublicFields(request); this.setPublicFields(request);
request.TokenID = ''; request.TokenID = "";
return this.con.post(AuthenticationService.registerTempUserURL, request, onError, errorLabel); return this.con.post(
AuthenticationService.registerTempUserURL,
request,
onError,
errorLabel
);
} }
public getLoginInfo(request: GetLoginInfoRequest, onError: any, errorLabel: string) public getLoginInfo(
: Observable<GetLoginInfoResponse> { request: GetLoginInfoRequest,
onError: any,
errorLabel: string
): Observable<GetLoginInfoResponse> {
this.setPublicFields(request); this.setPublicFields(request);
return this.con.post(AuthenticationService.getLoginInfoURL, request, onError, errorLabel); return this.con.post(
AuthenticationService.getLoginInfoURL,
request,
onError,
errorLabel
);
} }
/** /**
*update new authenticated user from previously stored and loaded user *update new authenticated user from previously stored and loaded user
*/ */
private updateAuthenticatedUser(result: CheckActivationCodeResponse, loadedUser: AuthenticatedUser): AuthenticatedUser { private updateAuthenticatedUser(
result: CheckActivationCodeResponse,
loadedUser: AuthenticatedUser
): AuthenticatedUser {
const user = result.MemberInformationList[0]; const user = result.MemberInformationList[0];
user.P_SESSION_ID = result.P_SESSION_ID;
user.MobileNumber = result.EMPLOYEE_MOBILE_NUMBER;
user.TokenID = result.TokenID;
user.LogInTokenID = this.cs.sharedService.getSharedData(
"logindata"
).LogInTokenID;
return user; return user;
} }
@ -284,12 +329,12 @@ export class AuthenticationService {
* we store in localstorage without token but we keep it in the static member * we store in localstorage without token but we keep it in the static member
*/ */
private saveUserInStorage(user: AuthenticatedUser): Observable<boolean> { private saveUserInStorage(user: AuthenticatedUser): Observable<boolean> {
return Observable.create(observer => { return Observable.create(observer => {
if (user) { if (user) {
// const TokenID = user.TokenID; // const TokenID = user.TokenID;
// user.TokenID = null; // user.TokenID = null;
this.nativeStorage.setItem(AuthenticationService.AUTHENTICATED_USER_KEY, user) this.nativeStorage
.setItem(AuthenticationService.AUTHENTICATED_USER_KEY, user)
.then( .then(
() => { () => {
//user.TokenID = TokenID; //user.TokenID = TokenID;
@ -307,9 +352,7 @@ export class AuthenticationService {
observer.next(false); observer.next(false);
observer.complete(); observer.complete();
} }
}); });
} }
/** /**
@ -320,7 +363,9 @@ export class AuthenticationService {
this.clearUserSession(); this.clearUserSession();
return Observable.create(observer => { return Observable.create(observer => {
this.publishUserChangeEvent(); this.publishUserChangeEvent();
this.nativeStorage.remove(AuthenticationService.AUTHENTICATED_USER_KEY).then( this.nativeStorage
.remove(AuthenticationService.AUTHENTICATED_USER_KEY)
.then(
() => { () => {
observer.next(true); observer.next(true);
observer.complete(); observer.complete();
@ -328,16 +373,25 @@ export class AuthenticationService {
() => { () => {
observer.next(false); observer.next(false);
observer.complete(); observer.complete();
}); }
);
}); });
} }
private publishUserChangeEvent() { private publishUserChangeEvent() {
this.events.publish(AuthenticationService.LOGIN_EVENT, this.getAuthenticatedUser(), Date.now()); this.events.publish(
AuthenticationService.LOGIN_EVENT,
this.getAuthenticatedUser(),
Date.now()
);
} }
private publishFamilyMemeberUserChangeEvent() { private publishFamilyMemeberUserChangeEvent() {
this.events.publish(AuthenticationService.FAMILY_LOGIN_EVENT, this.getAuthenticatedUser(), Date.now()); this.events.publish(
AuthenticationService.FAMILY_LOGIN_EVENT,
this.getAuthenticatedUser(),
Date.now()
);
} }
public clearUserSession() { public clearUserSession() {
@ -346,10 +400,10 @@ export class AuthenticationService {
public loadAuthenticatedUser(): Observable<AuthenticatedUser> { public loadAuthenticatedUser(): Observable<AuthenticatedUser> {
return Observable.create(observer => { return Observable.create(observer => {
this.nativeStorage
this.nativeStorage.getItem(AuthenticationService.AUTHENTICATED_USER_KEY) .getItem(AuthenticationService.AUTHENTICATED_USER_KEY)
.then( .then(
(user) => { user => {
observer.next(user); observer.next(user);
observer.complete(); observer.complete();
}, },
@ -376,80 +430,125 @@ export class AuthenticationService {
return AuthenticationService.user; return AuthenticationService.user;
} }
public checkUserAuthentication(
public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string) request: CheckUserAuthenticationRequest,
: Observable<CheckUserAuthenticationResponse> { onError: any,
errorLabel: string
): Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request); this.setPublicFields(request);
return this.con.post(AuthenticationService.login, request, onError, errorLabel); return this.con.post(
AuthenticationService.login,
request,
onError,
errorLabel
);
} }
public checkActivationCode(request: CheckActivationCodeRequest, onError: any, errorLabel: string) public checkActivationCode(
: Observable<CheckActivationCodeResponse> { request: CheckActivationCodeRequest,
onError: any,
errorLabel: string
): Observable<CheckActivationCodeResponse> {
this.setPublicFields(request); this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel); return this.con.post(
AuthenticationService.activationCodeURL,
request,
onError,
errorLabel
);
} }
public checkSMS(request: SMSCheckRequest, onError: any, errorLabel: string) public checkSMS(
: Observable<SMSCheckResponse> { request: SMSCheckRequest,
this.setPublicFields(request); onError: any,
return this.con.post(AuthenticationService.smsCheck, request, onError, errorLabel); errorLabel: string
): Observable<SMSCheckResponse> {
//this.setPublicFields(request);
return this.con.post(
AuthenticationService.smsCheck,
request,
onError,
errorLabel
);
} }
/* /*
client side: client side:
id no , mobile no , zip code id no , mobile no , zip code
*/ */
public checkPatientForRegisteration(request: CheckPatientRegisterationRequest, onError: any, errorLabel: string)
: Observable<Response> {
this.setPublicFields(request);
request.TokenID = '';
request.PatientID = 0;
request.isRegister = false;
return this.con.post(AuthenticationService.checkPatientForRegisterationURL, request, onError, errorLabel);
}
/* /*
client side: client side:
id no , mobile no , zip code id no , mobile no , zip code
*/ */
public sendSmsForPatientRegisteration(request: CheckPatientRegisterationRequest, onError: any, errorLabel: string) public sendSmsForPatientRegisteration(
: Observable<CheckUserAuthenticationResponse> { request: CheckPatientRegisterationRequest,
onError: any,
errorLabel: string
): Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request); this.setPublicFields(request);
request.TokenID = ''; request.TokenID = "";
request.PatientID = 0;
request.isRegister = false; request.isRegister = false;
return this.con.post(AuthenticationService.sendSmsForRegisterURL, request, onError, errorLabel); return this.con.post(
AuthenticationService.sendSmsForRegisterURL,
request,
onError,
errorLabel
);
} }
public checkRegisterationActivationCode(request: CheckRegisterationCodeRequest, onError: any, errorLabel: string) public checkRegisterationActivationCode(
: Observable<Response> { request: CheckRegisterationCodeRequest,
onError: any,
errorLabel: string
): Observable<Response> {
this.setPublicFields(request); this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel); return this.con.post(
AuthenticationService.activationCodeURL,
request,
onError,
errorLabel
);
} }
public sendSMSForForgotFileNumber(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string) public sendSMSForForgotFileNumber(
: Observable<CheckUserAuthenticationResponse> { request: CheckUserAuthenticationRequest,
onError: any,
errorLabel: string
): Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request); this.setPublicFields(request);
request.TokenID = ''; request.TokenID = "";
request.PatientIdentificationID = ''; // request.PatientIdentificationID = '';
request.PatientID = 0; // request.PatientID = 0;
//request.SearchType = 2; //request.SearchType = 2;
//request.isRegister = false; //request.isRegister = false;
return this.con.post(AuthenticationService.sendSMSForgotFileNoURL, request, onError, errorLabel); return this.con.post(
AuthenticationService.sendSMSForgotFileNoURL,
request,
onError,
errorLabel
);
} }
public forgotFileIdActivation(request: CheckActivationCodeRequest, onError: any, errorLabel: string) public forgotFileIdActivation(
: Observable<ForgotFileIDResponse> { request: CheckActivationCodeRequest,
onError: any,
errorLabel: string
): Observable<ForgotFileIDResponse> {
this.setPublicFields(request); this.setPublicFields(request);
request.TokenID = ''; request.TokenID = "";
request.PatientIdentificationID = ''; request.PatientIdentificationID = "";
request.PatientID = 0; // request.PatientID = 0;
request.SearchType = 2; request.SearchType = 2;
request.isRegister = false; request.isRegister = false;
return this.con.post(AuthenticationService.forgotFileIDURL, request, onError, errorLabel); return this.con.post(
AuthenticationService.forgotFileIDURL,
request,
onError,
errorLabel
);
} }
public isSAUDIIDValid(id: string): boolean { public isSAUDIIDValid(id: string): boolean {
if (!id) { if (!id) {
return false; return false;
@ -470,48 +569,44 @@ export class AuthenticationService {
} }
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
if ((i % 2) === 0) { if (i % 2 === 0) {
const a = id.charAt(i); const a = id.charAt(i);
const x = Number(a) * 2; const x = Number(a) * 2;
let b = x.toString(); let b = x.toString();
if (b.length === 1) { if (b.length === 1) {
b = '0' + b; b = "0" + b;
} }
sum += Number(b.charAt(0)) + Number(b.charAt(1)); sum += Number(b.charAt(0)) + Number(b.charAt(1));
} else { } else {
sum += Number(id.charAt(i)); sum += Number(id.charAt(i));
} }
} }
return ((sum % 10) === 0); return sum % 10 === 0;
}
} catch (err) {
} }
} catch (err) {}
return false; return false;
} }
public checkUserHasEmailDialog(): Observable<void> { public checkUserHasEmailDialog(): Observable<void> {
return Observable.create(observer => { return Observable.create(observer => {
if (this.isAuthenticatedUserHasRealEmail()) { if (this.isAuthenticatedUserHasRealEmail()) {
const message = this.ts.trPK('general', 'send-email') const message = this.ts
.replace('[0]', this.getAuthenticatedUser().EmailAddress); .trPK("general", "send-email")
this.cs.presentConfirmDialog(message, .replace("[0]", this.getAuthenticatedUser().EmailAddress);
() => { this.cs.presentConfirmDialog(message, () => {
observer.next(); observer.next();
observer.complete(); observer.complete();
}); });
} else { } else {
this.cs.presentConfirmDialog(this.ts.trPK('login', 'enter-email'), this.cs.presentConfirmDialog(
this.ts.trPK("login", "enter-email"),
() => { () => {
//this.cs.openPatientProfile(); //this.cs.openPatientProfile();
observer.complete(); observer.complete();
}); }
);
} }
}); });
} }
/* /*
@ -529,9 +624,12 @@ export class AuthenticationService {
} }
private sessionTimeOutDialog() { private sessionTimeOutDialog() {
this.cs.presentConfirmDialog(this.ts.trPK('general', 'idle-relogin'), () => { this.cs.presentConfirmDialog(
this.ts.trPK("general", "idle-relogin"),
() => {
// this.cs.openUserLogin(); // this.cs.openUserLogin();
}); }
);
} }
/* /*
@ -561,20 +659,19 @@ export class AuthenticationService {
if (!AuthenticationService.eventsRegistered) { if (!AuthenticationService.eventsRegistered) {
AuthenticationService.eventsRegistered = true; AuthenticationService.eventsRegistered = true;
// every time we have and event // every time we have and event
this.registerDocumentEvents(['mousedown', 'touchstart', 'click', 'keyup'], () => { this.registerDocumentEvents(
["mousedown", "touchstart", "click", "keyup"],
() => {
// if user still logged in and session not expired // if user still logged in and session not expired
if (AuthenticationService.user && !AuthenticationService.requireRelogin) { if (
AuthenticationService.user &&
!AuthenticationService.requireRelogin
) {
// reset and start idling timer // reset and start idling timer
this.detectIdle(); this.detectIdle();
} }
});
} }
);
}
} }
} }

@ -2,73 +2,77 @@ import { PatientUserModel } from './PatientUserModel';
import { TestBed } from '@angular/core/testing'; import { TestBed } from '@angular/core/testing';
export class AuthenticatedUser extends PatientUserModel { export class AuthenticatedUser extends PatientUserModel {
ACTUAL_TERMINATION_DATE: string TokenID:string;
ASSIGNMENT_END_DATE: string ACTUAL_TERMINATION_DATE: string;
ASSIGNMENT_ID: number ASSIGNMENT_END_DATE: string;
ASSIGNMENT_NUMBER: string ASSIGNMENT_ID: number;
ASSIGNMENT_START_DATE: string ASSIGNMENT_NUMBER: string;
ASSIGNMENT_STATUS_TYPE_ID: number ASSIGNMENT_START_DATE: string;
ASSIGNMENT_TYPE: string ASSIGNMENT_STATUS_TYPE_ID: number;
BUSINESS_GROUP_ID: number ASSIGNMENT_TYPE: string;
BUSINESS_GROUP_NAME: string BUSINESS_GROUP_ID: number;
CURRENT_EMPLOYEE_FLAG: string BUSINESS_GROUP_NAME: string;
EMPLOYEE_DISPLAY_NAME: string CURRENT_EMPLOYEE_FLAG: string;
EMPLOYEE_EMAIL_ADDRESS:string EMPLOYEE_DISPLAY_NAME: string;
EMPLOYEE_IMAGE:string EMPLOYEE_EMAIL_ADDRESS:string;
EMPLOYEE_MOBILE_NUMBER: string EMPLOYEE_IMAGE:string;
EMPLOYEE_NAME:string EMPLOYEE_MOBILE_NUMBER: string;
EMPLOYEE_NUMBER: string EMPLOYEE_NAME:string;
EMPLOYEE_WORK_NUMBER:string EMPLOYEE_NUMBER: string;
EMPLOYMENT_CATEGORY: string EMPLOYEE_WORK_NUMBER:string;
EMPLOYMENT_CATEGORY_MEANING: string EMPLOYMENT_CATEGORY: string;
FREQUENCY: string EMPLOYMENT_CATEGORY_MEANING: string;
FREQUENCY_MEANING: string FREQUENCY: string;
FROM_ROW_NUM: number FREQUENCY_MEANING: string;
GRADE_ID: number FROM_ROW_NUM: number;
GRADE_NAME: string GRADE_ID: number;
HIRE_DATE: string GRADE_NAME: string;
JOB_ID: number HIRE_DATE: string;
JOB_NAME: string JOB_ID: number;
LEDGER_ID: number JOB_NAME: string;
LOCATION_ID: number LEDGER_ID: number;
LOCATION_NAME: string LOCATION_ID: number;
MANUAL_TIMECARD_FLAG: string LOCATION_NAME: string;
MANUAL_TIMECARD_MEANING: string MANUAL_TIMECARD_FLAG: string;
NATIONALITY_CODE: string MANUAL_TIMECARD_MEANING: string;
NATIONALITY_MEANING: string NATIONALITY_CODE: string;
NATIONAL_IDENTIFIER:string NATIONALITY_MEANING: string;
NORMAL_HOURS: string NATIONAL_IDENTIFIER:string;
NO_OF_ROWS: number NORMAL_HOURS: string;
ORGANIZATION_ID: number NO_OF_ROWS: number;
ORGANIZATION_NAME: string ORGANIZATION_ID: number;
PAYROLL_CODE: string ORGANIZATION_NAME: string;
PAYROLL_ID: number PAYROLL_CODE: string;
PAYROLL_NAME: string PAYROLL_ID: number;
PERSON_ID: number PAYROLL_NAME: string;
PERSON_TYPE:string PERSON_ID: number;
PERSON_TYPE_ID: number PERSON_TYPE:string;
PER_INFORMATION_CATEGORY: string PERSON_TYPE_ID: number;
POSITION_ID: number PER_INFORMATION_CATEGORY: string;
POSITION_NAME: string POSITION_ID: number;
PRIMARY_FLAG: string POSITION_NAME: string;
ROW_NUM:number PRIMARY_FLAG: string;
SUPERVISOR_ASSIGNMENT_ID: string ROW_NUM:number;
SUPERVISOR_DISPLAY_NAME: string SUPERVISOR_ASSIGNMENT_ID: string;
SUPERVISOR_EMAIL_ADDRESS: string SUPERVISOR_DISPLAY_NAME: string;
SUPERVISOR_ID: number SUPERVISOR_EMAIL_ADDRESS: string;
SUPERVISOR_MOBILE_NUMBER: string SUPERVISOR_ID: number;
SUPERVISOR_NAME: string SUPERVISOR_MOBILE_NUMBER: string;
SUPERVISOR_NUMBER: string SUPERVISOR_NAME: string;
SUPERVISOR_WORK_NUMBER: string SUPERVISOR_NUMBER: string;
SWIPES_EXEMPTED_FLAG: string SUPERVISOR_WORK_NUMBER: string;
SWIPES_EXEMPTED_MEANING: string SWIPES_EXEMPTED_FLAG: string;
SYSTEM_PERSON_TYPE: string SWIPES_EXEMPTED_MEANING: string;
TK_EMAIL_ADDRESS: string SYSTEM_PERSON_TYPE: string;
TK_EMPLOYEE_DISPLAY_NAME: string TK_EMAIL_ADDRESS: string;
TK_EMPLOYEE_NAME: string TK_EMPLOYEE_DISPLAY_NAME: string;
TK_EMPLOYEE_NUMBER: string TK_EMPLOYEE_NAME: string;
TK_PERSON_ID: number TK_EMPLOYEE_NUMBER: string;
TO_ROW_NUM: number TK_PERSON_ID: number;
UNIT_NUMBER: string TO_ROW_NUM: number;
USER_STATUS: string UNIT_NUMBER: string;
USER_STATUS: string;
P_SESSION_ID:number;
MobileNumber:string;
LogInTokenID:string;
} }

@ -4,5 +4,10 @@ import { AuthenticatedUser } from './authenticated-user';
export class CheckActivationCodeResponse extends Response { export class CheckActivationCodeResponse extends Response {
AuthenticationTokenID: string; AuthenticationTokenID: string;
P_SESSION_ID:number;
MobileNumber:string;
LogInTokenID:string;
EMPLOYEE_MOBILE_NUMBER:string;
TokenID:string;
MemberInformationList:AuthenticatedUser[]; MemberInformationList:AuthenticatedUser[];
} }

@ -1,6 +1,6 @@
import { Request } from '../../models/request'; import { Request } from '../../models/request';
export class SMSCheckRequest extends Request { export class SMSCheckRequest extends Request {
LogInTokenID?: string ; LogInTokenID: string ;
activationCode?: string; activationCode?: string;
} }

@ -3,5 +3,12 @@ import { AuthenticatedUser } from './authenticated-user';
export class SMSCheckResponse extends Response { export class SMSCheckResponse extends Response {
AuthenticationTokenID: string; AuthenticationTokenID: string;
MemberInformationList:AuthenticatedUser[]; MemberInformationList:AuthenticatedUser[];
public TokenID: string;
public SessionID: string;
public MobileType: string;
public BookedBy?: number;
public P_SESSION_ID: number;
public MobileNumber : string;
public LogInTokenID : string;
public EMPLOYEE_MOBILE_NUMBER:string;
} }

@ -54,8 +54,8 @@ export class GeofencingService {
const req = new InsertLocationRequest(); const req = new InsertLocationRequest();
req.PointsID = id; req.PointsID = id;
req.GeoType = type; req.GeoType = type;
req.PatientID = userData.PatientID; //req.PatientID = userData.PatientID;
req.PatientOutSA = userData.PatientOutSA; //req.PatientOutSA = userData.PatientOutSA;
this.auth.setPublicFields(req); this.auth.setPublicFields(req);
this.con.postNoLoad(GeofencingService.loggingUrl, req, () => { this.con.postNoLoad(GeofencingService.loggingUrl, req, () => {
zone.pendingRequest = type; // failed to log, setup pending request zone.pendingRequest = type; // failed to log, setup pending request

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { MenuserviceService } from './menuservice.service';
describe('MenuserviceService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: MenuserviceService = TestBed.get(MenuserviceService);
expect(service).toBeTruthy();
});
});

@ -0,0 +1,50 @@
import {Injectable} from '@angular/core';
import {Http, Response, Headers, } from "@angular/http";
import {AuthenticationService} from "../authentication/authentication.service";
import { Observable } from 'rxjs';
import {MenuEntries} from './models/menu-entries.request';
import {Request} from '../models/request';
import {MenuResponse} from './models/menu-response'
import { ConnectorService } from '../connector/connector.service';
@Injectable()
export class MenuService {
public static getMenu ='Services/ERP.svc/REST/GET_MENU';
public static getMenuEntries = 'Services/ERP.svc/REST/GET_MENU_ENTRIES';
public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES';
public static getNotCount='Services/ERP.svc/REST/GET_OPEN_NOTIFICATIONS_NUM';
public static disableSession="Services/ERP.svc/REST/DisableSession";
public static detectLanguage='Services/ERP.svc/REST/Get_LanguageAvailable';
constructor(
public authService: AuthenticationService,
public con:ConnectorService
) { }
public getMenu(onError?: any, errorLabel?: string): Observable<MenuResponse> {
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(MenuService.getMenu, request, onError, errorLabel);
}
public getMenuEntires(menuEntries:any, onError?: any, errorLabel?: string): Observable<MenuResponse> {
const request = menuEntries;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.getMenuEntries, request, onError, errorLabel);
}
public getNotificationCount(req:any, onError?: any, errorLabel?: string): Observable<any> {
const request = req;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.getNotCount, request, onError, errorLabel);
}
public disableSession(req:any, onError?: any, errorLabel?: string): Observable<any> {
const request = req;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.disableSession, request, onError, errorLabel);
}
public getAppLanguages(req:any, onError?: any, errorLabel?: string): Observable<any> {
const request = req;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.detectLanguage, request, onError, errorLabel);
}
}

@ -0,0 +1,7 @@
export class ListMenu {
public MENU_ID:number;
public MENU_NAME:string;
public MENU_TYPE:string;
public RESP_ID:number;
public SUB_MENU_NAME:string;
}

@ -0,0 +1,6 @@
import { Request } from '../models/request';
export class MenuEntries extends Request {
public P_MENU_TYPE:string;
public P_SELECTED_EMPLOYEE_NUMBER:string;
public P_SELECTED_RESP_ID:number
}

@ -0,0 +1,9 @@
import { ListMenu } from './list.menu';
import { MenuEntry } from './menu.entry';
export class MenuResponse {
public static SHARED_DATA = 'menu_response';
public static SHARED_SEL_EMP= 'sel_empolyee';
public static SHARED_SEL_RESP_ID= 'sel_resp_id';
public List_Menu:ListMenu;
public GetMenuEntriesList:MenuEntry;
}

@ -0,0 +1,13 @@
export class MenuEntry {
public MENU_NAME:string;
public ADD_BUTTON:string;
public DELETE_BUTTON:string;
public UPDATE_BUTTON:string;
public ENTRY_SEQUENCE:number;
public FUNCTION_NAME:string;
public LVL:number;
public MENU_ENTRY_TYPE:string;
public PARENT_MENU_NAME:string;
public PROMPT:string;
public REQUEST_TYPE:string;
}

@ -0,0 +1,18 @@
export class Request {
public P_USER_NAME: string;
public LanguageID: number;
//public IPAdress: string;
public P_SESSION_ID: number;
public VersionID: number;
public Channel: number;
public P_PASSWORD: string;
public P_MOBILE_NUMBER: string;
public P_EMAIL_ADDRESS: string;
public TokenID:string;
public P_NOTIFICATION_ID:number;
public MobileNumber: string;
public UserName:string;
public LogInTokenID:string;
public MobileType:string;
}

@ -1,19 +1,16 @@
export class Request { export class Request {
public ClinicID: number;
public PatientOutSA: number;
public PatientID: number;
public ProjectID: number;
public LanguageID: number; public LanguageID: number;
public IPAdress: string; public IPAdress: string;
public VersionID: number; public VersionID: number;
public Channel: number; public Channel: number;
public PatientTypeID: number;
public isDentalAllowedBackend: boolean; public isDentalAllowedBackend: boolean;
public IsIrisPrescription: boolean; public IsIrisPrescription: boolean;
public TokenID: string; public TokenID: string;
public SessionID: string;
public MobileType: string; public MobileType: string;
public PatientIdentificationID: string;
public PatientMobileNumber: string;
public BookedBy?: number; public BookedBy?: number;
public P_SESSION_ID: number;
public MobileNumber : string;
public LogInTokenID : string;
public P_USER_NAME:string;
public UserName:string;
} }

@ -174,7 +174,7 @@ export class TranslatorService {
} }
private setCurrentLanguageToDefault() { private setCurrentLanguageToDefault() {
TranslatorService.CURRENT_LANGUAGE = TranslatorService.AR; TranslatorService.CURRENT_LANGUAGE = TranslatorService.EN;
} }
public setCurrentLanguage(language: string) { public setCurrentLanguage(language: string) {
TranslatorService.CURRENT_LANGUAGE = language; TranslatorService.CURRENT_LANGUAGE = language;

@ -12,14 +12,14 @@
<ion-badge id="homeBadgeBtn" item-end>{{notBadge}}</ion-badge> <ion-badge id="homeBadgeBtn" item-end>{{notBadge}}</ion-badge>
</button> </button>
<div class="centerDiv" (click)="openPersonalInfo()"> <div class="centerDiv" (click)="openPersonalInfo()">
<p class="TxtPlace">{{"home.hello" | translate}}, {{User_name_Emp}}</p> <p class="TxtPlace">{{"userData.hello" | translate}}, {{User_name_Emp}}</p>
<div class="profileDiv"><ion-img class="profileImg" src="{{user_image}}"></ion-img></div> <div class="profileDiv"><ion-img class="profileImg" src="{{user_image}}"></ion-img></div>
</div> </div>
</div> </div>
<div> <div>
<div> <div>
<p class="dash-header text-caps">{{"home.dashboard" | translate}}</p> <p class="dash-header text-caps">{{"userData.dashboard" | translate}}</p>
</div> </div>
<div> <div>
<ion-grid class="cus-grid"> <ion-grid class="cus-grid">

@ -1,46 +1,59 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from "@angular/core";
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { MenuController } from '@ionic/angular'; import { MenuController } from "@ionic/angular";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response"; import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response";
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user'; import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service";
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
@Component({ @Component({
selector: 'app-home', selector: "app-home",
templateUrl: './home.page.html', templateUrl: "./home.page.html",
styleUrls: ['./home.page.scss'], styleUrls: ["./home.page.scss"]
}) })
export class HomePage implements OnInit { export class HomePage implements OnInit {
userData: any ={}; userData: any = {};
user_image : any = "../assets/imgs/profile.png"; user_image: any = "../assets/imgs/profile.png";
constructor(public ts: TranslatorService, public menu: MenuController, public authService: AuthenticationService ) { } menuList: any = [];
constructor(
public ts: TranslatorService,
public menu: MenuController,
public authService: AuthenticationService,
public menuService: MenuService,
public common: CommonService
) {}
ngOnInit() { ngOnInit() {
this.getUserDetails(); this.getUserDetails();
this.getMenu();
} }
private openMenu(){
private openMenu() {
this.menu.toggle(); this.menu.toggle();
} }
private getUserDetails(){ private getUserDetails() {
const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { const user = this.authService
.loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => {
if (user) { if (user) {
this.userData=user; this.userData = user;
console.log(user); console.log(user);
}else{ } else {
console.log(user); console.log(user);
} }
}) });
}
private getMenu() {
this.menuService.getMenu().subscribe((result: MenuResponse) => {
this.handleMenuResult(result);
});
}
private handleMenuResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.List_Menu)) {
this.menuList = result.List_Menu;
}
}
} }
// private getMenu(){
// this.menuService.getMenu().
// subscribe((result: MenuResponse) => {
// this.handleMenuResult(result);
// });
// }
// private handleMenuResult(result){
// if (this.common.validResponse(result)) {
// if (this.common.hasData(result.List_Menu)) {
// this.menuList = result.List_Menu;
// }
// }
} }

@ -139,10 +139,10 @@ ion-header ion-icon.icon.icon-ios.ion-ios-add{
color: (--darkgray); color: (--darkgray);
} }
.toolbar-background { .toolbar-background {
background: (--primary); background: var(--primary);
background: -moz-linear-gradient(45deg, (--primary) 0%, (--secondary) 36%,(--secondary) 59%, (--customnavy) 100%); background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: -webkit-linear-gradient(45deg, (--primary) 0%, (--secondary) 36%,(--secondary) 59%, (--customnavy) 100%); background: -webkit-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: linear-gradient(45deg, (--primary) 0%, (--secondary) 36%,(--secondary) 59%, (--customnavy) 100%); background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='var(--primary)', endColorstr='--var(customnavy)',GradientType=1 ); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='var(--primary)', endColorstr='--var(customnavy)',GradientType=1 );
} }
/***************button bckground***************/ /***************button bckground***************/

Loading…
Cancel
Save