update home
parent
fe7e62bbe6
commit
b967536b26
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||||
}
|
}
|
||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue