diff --git a/Mohem/src/app/app-routing.module.ts b/Mohem/src/app/app-routing.module.ts index 11b5d4ea..028af542 100644 --- a/Mohem/src/app/app-routing.module.ts +++ b/Mohem/src/app/app-routing.module.ts @@ -1,30 +1,31 @@ -import { NgModule } from '@angular/core'; -import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; +import { NgModule } from '@angular/core'; +import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; + + +const routes: Routes = [ + { path: '', redirectTo: 'authentication/login', pathMatch: 'full' }, + { + path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule'}, + { path: 'home', loadChildren: './home/home.module#HomePageModule' }, + { path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' }, + { path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' }, + { path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' }, + { path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' }, + { path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' }, + { path: 'eit', loadChildren: './eit/eit.module#EITPageModule' }, + { path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' }, + { path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' }, + { path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' }, + { path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' }, { path: 'time-card', loadChildren: './time-card/time-card.module#TimeCardPageModule' } - -const routes: Routes = [ - { path: '', redirectTo: 'authentication/login', pathMatch: 'full' }, - { - path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule'}, - { path: 'home', loadChildren: './home/home.module#HomePageModule' }, - { path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' }, - { path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' }, - { path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' }, - { path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' }, - { path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' }, - { path: 'eit', loadChildren: './eit/eit.module#EITPageModule' }, - { path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' }, - { path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' }, - { path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' }, - { path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' } - -]; - -@NgModule({ - imports: [ - /*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/ - RouterModule.forRoot(routes), - ], - exports: [RouterModule] -}) -export class AppRoutingModule { } + +]; + +@NgModule({ + imports: [ + /*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/ + RouterModule.forRoot(routes), + ], + exports: [RouterModule] +}) +export class AppRoutingModule { } diff --git a/Mohem/src/app/eit/add-eit/add-eit.component.ts b/Mohem/src/app/eit/add-eit/add-eit.component.ts index aae9420a..52ff04f1 100644 --- a/Mohem/src/app/eit/add-eit/add-eit.component.ts +++ b/Mohem/src/app/eit/add-eit/add-eit.component.ts @@ -1,34 +1,34 @@ -import { CommonService } from 'src/app/hmg-common/services/common/common.service'; -import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; -import { MenuEntry } from 'src/app/hmg-common/services/menu/models/menu.entry'; -import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; -import { EitRequest } from '../models/eit.request'; -import { ModalController } from '@ionic/angular'; -import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; -import { EITTransactionsRequest } from '../models/EITTransactionsReq'; -import { EitService } from '../services/eit.service'; -import { TextAreaInput } from 'src/app/uI-elements/text-area.input'; -import { NumberInput } from 'src/app/uI-elements/number.input'; -import { TextInput } from 'src/app/uI-elements/text.input'; -import { SelectInput } from 'src/app/uI-elements/select.input'; -import { DateInput } from 'src/app/uI-elements/date.input'; -import { TimeInput } from 'src/app/uI-elements/time.input'; -import { DateTimeInput } from 'src/app/uI-elements/date-time.input'; -import { ButtonInput } from 'src/app/uI-elements/button.input'; -import { HiddenInput } from 'src/app/uI-elements/hidden.input'; -import * as moment from 'moment'; -import { DatePicker } from '@ionic-native/date-picker/ngx'; -import { EIT_ACTION } from '../models/submit.eit.action'; -import { AddEitResponse } from '../models/add.eit.response'; +import { CommonService } from "src/app/hmg-common/services/common/common.service"; +import { Component, OnInit, ViewChild, ElementRef } from "@angular/core"; +import { MenuEntry } from "src/app/hmg-common/services/menu/models/menu.entry"; +import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; +import { EitRequest } from "../models/eit.request"; +import { ModalController } from "@ionic/angular"; +import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; +import { EITTransactionsRequest } from "../models/EITTransactionsReq"; +import { EitService } from "../services/eit.service"; +import { TextAreaInput } from "src/app/uI-elements/text-area.input"; +import { NumberInput } from "src/app/uI-elements/number.input"; +import { TextInput } from "src/app/uI-elements/text.input"; +import { SelectInput } from "src/app/uI-elements/select.input"; +import { DateInput } from "src/app/uI-elements/date.input"; +import { TimeInput } from "src/app/uI-elements/time.input"; +import { DateTimeInput } from "src/app/uI-elements/date-time.input"; +import { ButtonInput } from "src/app/uI-elements/button.input"; +import { HiddenInput } from "src/app/uI-elements/hidden.input"; +import * as moment from "moment"; +import { DatePicker } from "@ionic-native/date-picker/ngx"; +import { EIT_ACTION } from "../models/submit.eit.action"; +import { AddEitResponse } from "../models/add.eit.response"; +import { element } from '@angular/core/src/render3'; @Component({ - selector: 'app-add-eit', - templateUrl: './add-eit.component.html', - styleUrls: ['./add-eit.component.scss'], + selector: "app-add-eit", + templateUrl: "./add-eit.component.html", + styleUrls: ["./add-eit.component.scss"] }) export class AddEitComponent implements OnInit { - - @ViewChild('containerDiv') containerDiv: ElementRef; + @ViewChild("containerDiv") containerDiv: ElementRef; ////*new add*///// getPassNotificationDetails: any; @@ -53,7 +53,7 @@ export class AddEitComponent implements OnInit { // private parentChilds: any[]; getPassMnuEntryObj: MenuEntry; selMenu: MenuResponse; - eitSubmitAction: number = 0;//not submit + eitSubmitAction: number = 0; //not submit private eitRequest: EitRequest; private validateEitObj: any = []; private ExtraObj: any = {}; @@ -66,11 +66,26 @@ export class AddEitComponent implements OnInit { private updatedValues: any = []; addEITData: any; - constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService, public datePicker: DatePicker) { - this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); - this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); + constructor( + public modalController: ModalController, + public cs: CommonService, + private ts: TranslatorService, + private eitService: EitService, + public datePicker: DatePicker + ) { + this.selEmp = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_SEL_EMP, + false + ); + this.respID = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_SEL_RESP_ID, + false + ); this.selMenu = new MenuResponse(); - this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + this.selMenu = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_DATA, + false + ); this.addEITData = this.cs.sharedService.getSharedData("AddEITData", false); this.eitRequest = new EitRequest(); @@ -82,7 +97,7 @@ export class AddEitComponent implements OnInit { // this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); this.getPassdirfromNotifiPage = this.addEITData.dirfromNotificationPage; if (this.getPassdirfromNotifiPage) { - this.functionName = this.getPassNotificationDetails.FUNCTION_NAME;//;this.getPassNotificationDetails.NOTIFICATION_NAME; + this.functionName = this.getPassNotificationDetails.FUNCTION_NAME; //;this.getPassNotificationDetails.NOTIFICATION_NAME; this.menuType = "E"; this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER; this.respID = -999; @@ -98,15 +113,16 @@ export class AddEitComponent implements OnInit { this.menuType = this.selMenu.List_Menu.MENU_TYPE; this.validateEitObj = this.addEITData.submitEITObjList; this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; - this.eitSubmitAction = this.cs.sharedService.getSharedData(EITTransactionsRequest.SUBMIT_EIT_ACTION); + this.eitSubmitAction = this.cs.sharedService.getSharedData( + EITTransactionsRequest.SUBMIT_EIT_ACTION + ); } } - ngOnInit() { - } + ngOnInit() {} ngAfterViewInit() { - console.log('ngAfterViewInit'); + console.log("ngAfterViewInit"); // console.log(this.containerDiv.nativeElement); this.getEitDffStructure(); // this.addFieldToDOM(this.buttonInput, 'btnSubmit', this.cs.presentAlert('Clicked!'), true) @@ -119,8 +135,7 @@ export class AddEitComponent implements OnInit { P_MENU_TYPE: this.menuType, P_SELECTED_RESP_ID: this.respID // P_USER_NAME:this.userName - - } + }; this.eitService.getEITDFFStrutre(body).subscribe((result: any) => { this.handleEitDffStructureResult(result); }); @@ -134,35 +149,81 @@ export class AddEitComponent implements OnInit { } private drawEitFields(feildsList) { - const containerId = 'containerDiv'; + const containerId = "containerDiv"; this.eitVALSettoCall = []; for (let i = 0; i < feildsList.length; i++) { let defaultVal: string = ""; let defaultValText: string = ""; - defaultVal = feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME ? feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME : ""; - defaultValText = feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME ? feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME : ""; - - if (feildsList[i].DISPLAY_FLAG != "N") { //check if the field should be displayed - if (feildsList[i].VALIDATION_TYPE == "N") {//text , date , time - if (feildsList[i].FORMAT_TYPE == "C") {// character + defaultVal = feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME + ? feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME + : ""; + defaultValText = feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME + ? feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME + : ""; + + if (feildsList[i].DISPLAY_FLAG != "N") { + //check if the field should be displayed + if (feildsList[i].VALIDATION_TYPE == "N") { + //text , date , time + if (feildsList[i].FORMAT_TYPE == "C") { + // character // if(feildsList[i].DEFAULT_TYPE=="C"||feildsList[i].DEFAULT_TYPE==""){// default type constant - this.textInput = new TextInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, defaultVal, containerId, defaultValText, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultValText, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){// profile/ sql // this.textInput = new TextInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED); // } - } - else if (feildsList[i].FORMAT_TYPE == "N") {// number + } else if (feildsList[i].FORMAT_TYPE == "N") { + // number // if(feildsList[i].DEFAULT_TYPE=="C"||feildsList[i].DEFAULT_TYPE==""){ - this.numberInput = new NumberInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, defaultVal, containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); + this.numberInput = new NumberInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){ // this.numberInput = new NumberInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED); // } - } - else if (feildsList[i].FORMAT_TYPE == "X") {// standard date - if (feildsList[i].DEFAULT_TYPE == "C" || feildsList[i].DEFAULT_TYPE == "D" || feildsList[i].DEFAULT_TYPE == "P" || feildsList[i].DEFAULT_TYPE == "S") {//constant - this.dateInput = new DateInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, this.cs.reverseFormatDate(defaultVal), containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); + } else if (feildsList[i].FORMAT_TYPE == "X") { + // standard date + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + //constant + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + this.cs.reverseFormatDate(defaultVal), + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); } else { - this.dateInput = new DateInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, "", containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); } // else if(feildsList[i].DEFAULT_TYPE=="D"){//current date // // this.dateInput = new DateInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,"currentDate",containerId,feildsList[i].MOBILE_ENABLED); @@ -171,18 +232,43 @@ export class AddEitComponent implements OnInit { // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){// sql and profile // this.dateInput = new DateInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED); // } - } - else if (feildsList[i].FORMAT_TYPE == "Y") {// standard date time - if (feildsList[i].DEFAULT_TYPE == "C" || feildsList[i].DEFAULT_TYPE == "D" || feildsList[i].DEFAULT_TYPE == "P" || feildsList[i].DEFAULT_TYPE == "S") { - this.datetimeInput = new DateTimeInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, this.cs.reverseFormatStandardDate(defaultVal), containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); + } else if (feildsList[i].FORMAT_TYPE == "Y") { + // standard date time + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + this.datetimeInput = new DateTimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + this.cs.reverseFormatStandardDate(defaultVal), + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); } else { - this.datetimeInput = new DateTimeInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, "", containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); + this.datetimeInput = new DateTimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); } - const elem = document.getElementById(feildsList[i].APPLICATION_COLUMN_NAME); - elem.addEventListener("click", (e) => { - if (feildsList[i].MOBILE_ENABLED != 'Y') - return false; - this.showDateTimePicker(feildsList[i].APPLICATION_COLUMN_NAME, feildsList[i].MAXIMUM_SIZE); + const elem = document.getElementById( + feildsList[i].APPLICATION_COLUMN_NAME + ); + elem.addEventListener("click", e => { + if (feildsList[i].MOBILE_ENABLED != "Y") return false; + this.showDateTimePicker( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i].MAXIMUM_SIZE + ); e.stopImmediatePropagation(); }); // else if(feildsList[i].DEFAULT_TYPE=="D"){ @@ -190,18 +276,43 @@ export class AddEitComponent implements OnInit { // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){ // this.datetimeInput = new DateTimeInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED); // } - } - else if (feildsList[i].FORMAT_TYPE == "I") {//time - if (feildsList[i].DEFAULT_TYPE == "C" || feildsList[i].DEFAULT_TYPE == "D" || feildsList[i].DEFAULT_TYPE == "P" || feildsList[i].DEFAULT_TYPE == "S") { - this.timeInput = new TimeInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, defaultVal, containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); + } else if (feildsList[i].FORMAT_TYPE == "I") { + //time + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + this.timeInput = new TimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); } else { - this.timeInput = new TimeInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, "", containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); + this.timeInput = new TimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); } - const elem = document.getElementById(feildsList[i].APPLICATION_COLUMN_NAME); - elem.addEventListener("click", (e) => { - if (feildsList[i].MOBILE_ENABLED != 'Y') - return false; - this.showTimePicker(feildsList[i].APPLICATION_COLUMN_NAME, feildsList[i].MAXIMUM_SIZE); + const elem = document.getElementById( + feildsList[i].APPLICATION_COLUMN_NAME + ); + elem.addEventListener("click", e => { + if (feildsList[i].MOBILE_ENABLED != "Y") return false; + this.showTimePicker( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i].MAXIMUM_SIZE + ); e.stopImmediatePropagation(); }); // else if(feildsList[i].DEFAULT_TYPE=="T"){ @@ -211,19 +322,40 @@ export class AddEitComponent implements OnInit { // } } } else { - if (feildsList[i].READ_ONLY == 'Y') { - this.textInput = new TextInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, defaultVal, containerId, defaultVal, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); + if (feildsList[i].READ_ONLY == "Y") { + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultVal, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); } else { // dropdown list missing open in differnt page //check this validation since he doesnt check the other default_type //if(feildsList[i].DEFAULT_TYPE=="P" || feildsList[i].DEFAULT_TYPE=="S"){ - this.selectInput = new SelectInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, defaultVal, containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); + this.selectInput = new SelectInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); // }else{ // this.selectInput = new SelectInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,"",containerId,feildsList[i].MOBILE_ENABLED); // } // this.getValueSet(feildsList[i].SEGMENT_NAME); - this.fillDropdownList(feildsList[i].SEGMENT_NAME, feildsList[i].E_SERVICES_VS, feildsList[i].E_SERVICES_DV); - // this.eitVALSettoCall.push(feildsList[i]); + this.fillDropdownList( + feildsList[i].SEGMENT_NAME, + feildsList[i].E_SERVICES_VS, + feildsList[i].E_SERVICES_DV + ); + // this.eitVALSettoCall.push(feildsList[i]); } } //const elem = document.getElementById(feildsList[i].APPLICATION_COLUMN_NAME); @@ -231,20 +363,31 @@ export class AddEitComponent implements OnInit { // this.getValueSet(feildsList[i].SEGMENT_NAME); // e.stopImmediatePropagation(); // }); - this.bindHtmlElemEvents(feildsList[i].APPLICATION_COLUMN_NAME, feildsList[i]); + this.bindHtmlElemEvents( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i] + ); } else { // if(feildsList[i].VALIDATION_TYPE=="N"){ - this.hiddenInput = new HiddenInput(defaultVal, feildsList[i].APPLICATION_COLUMN_NAME, defaultValText, containerId); + this.hiddenInput = new HiddenInput( + defaultVal, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultValText, + containerId + ); // }else{ // this.selectInput = new SelectInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,defaultVal,containerId,feildsList[i].MOBILE_ENABLED,feildsList[i].DISPLAY_FLAG); // this.fillDropdownList(feildsList[i].SEGMENT_NAME,feildsList[i].E_SERVICES_VS,feildsList[i].E_SERVICES_DV); // } - this.bindHtmlElemEvents(feildsList[i].APPLICATION_COLUMN_NAME, feildsList[i]); + this.bindHtmlElemEvents( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i] + ); } } // this.callValueSet(); // let msg:string=""; - // msg=this.translate.translate("confirmAddEit.start"); + // msg=this.translate.translate("confirmAddEit.start"); // this.buttonInput = new ButtonInput("EIT_Btn_Submit", this.translate.translate('general.submit'), containerId, ""); // const elem = document.getElementById("EIT_Btn_Submit"); // elem.addEventListener("click", (e) => { @@ -255,24 +398,28 @@ export class AddEitComponent implements OnInit { } } - addFieldToDOM(fieldObject: any, fieldId: any, clickListenerEvent: any, hasClickListener: boolean) { - console.log('AddFieldToDOM'); - const elemDiv = document.createElement('div'); - elemDiv.className = ''; + addFieldToDOM( + fieldObject: any, + fieldId: any, + clickListenerEvent: any, + hasClickListener: boolean + ) { + console.log("AddFieldToDOM"); + const elemDiv = document.createElement("div"); + elemDiv.className = ""; elemDiv.innerHTML = fieldObject.getTemplate(); - console.log(this.containerDiv.nativeElement) + console.log(this.containerDiv.nativeElement); this.containerDiv.nativeElement.appendChild(elemDiv); // document.getElementById('containerDiv').appendChild(elemDiv); if (hasClickListener) { let elem = document.getElementById(fieldId); - elem.addEventListener("click", (e) => { + elem.addEventListener("click", e => { clickListenerEvent(e); e.stopImmediatePropagation(); }); } - } closemodal() { @@ -284,30 +431,30 @@ export class AddEitComponent implements OnInit { let elem = document.getElementById(elemID) as HTMLDivElement; let date: any; let value = elem.innerHTML; - if (value) - date = moment(value, "YYYY/MM/DD HH:mm:ss").toDate(); - else - date = new Date(); - this.datePicker.show({ - date: date, - is24Hour: true, - mode: 'datetime' - }).then( - date => { - let dateString: string = moment(date).format("YYYY/MM/DD HH:mm:ss"); - //remove seconds if the maximum size is 17 - if (maxSize == 17) { - elem.innerHTML = dateString.substring(0, 16); - elem.dataset.dtvalue = dateString.substring(0, 16); - } else { - elem.innerHTML = dateString; - elem.dataset.dtvalue = dateString; - } - //elem.innerHTML = dateString; - // elem.dataset.dtvalue = dateString; - }, - err => console.log('Error occurred while getting date: ', err) - ); + if (value) date = moment(value, "YYYY/MM/DD HH:mm:ss").toDate(); + else date = new Date(); + this.datePicker + .show({ + date: date, + is24Hour: true, + mode: "datetime" + }) + .then( + date => { + let dateString: string = moment(date).format("YYYY/MM/DD HH:mm:ss"); + //remove seconds if the maximum size is 17 + if (maxSize == 17) { + elem.innerHTML = dateString.substring(0, 16); + elem.dataset.dtvalue = dateString.substring(0, 16); + } else { + elem.innerHTML = dateString; + elem.dataset.dtvalue = dateString; + } + //elem.innerHTML = dateString; + // elem.dataset.dtvalue = dateString; + }, + err => console.log("Error occurred while getting date: ", err) + ); } public showTimePicker(elemID, maxSize) { let elem = document.getElementById(elemID) as HTMLDivElement; @@ -319,34 +466,39 @@ export class AddEitComponent implements OnInit { } else { date = new Date(); } - this.datePicker.show({ - date: date, - is24Hour: true, - mode: 'time' - }).then( - date => { - let dateString: string = moment(date).format("HH:mm:ss"); - //remove seconds if the maximum size is 5 - if (maxSize == 5) { - elem.innerHTML = dateString.substring(0, 5); - elem.dataset.dtvalue = dateString.substring(0, 5); - } else { - elem.innerHTML = dateString; - elem.dataset.dtvalue = dateString; - } - }, - err => console.log('Error occurred while getting date: ', err) - ); + this.datePicker + .show({ + date: date, + is24Hour: true, + mode: "time" + }) + .then( + date => { + let dateString: string = moment(date).format("HH:mm:ss"); + //remove seconds if the maximum size is 5 + if (maxSize == 5) { + elem.innerHTML = dateString.substring(0, 5); + elem.dataset.dtvalue = dateString.substring(0, 5); + } else { + elem.innerHTML = dateString; + elem.dataset.dtvalue = dateString; + } + }, + err => console.log("Error occurred while getting date: ", err) + ); } fillDropdownList(segmentName, optionList: any = [], DV: any = "") { - let elemID: any = "" + let elemID: any = ""; let eitObj: any; if (optionList.length > 0) { for (let i = 0; i < this.eitResponse.length; i++) { if (this.eitResponse[i].SEGMENT_NAME == segmentName) { eitObj = this.eitResponse[i]; - if (this.eitResponse[i].READ_ONLY == 'Y' || this.eitResponse[i].DISPLAY_FLAG == 'N') { + if ( + this.eitResponse[i].READ_ONLY == "Y" || + this.eitResponse[i].DISPLAY_FLAG == "N" + ) { return false; } elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME; @@ -360,19 +512,17 @@ export class AddEitComponent implements OnInit { // { // select.remove(i); // } - if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == 'N') { + if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == "N") { var firstoption = document.createElement("option"); firstoption.text = this.ts.trPK("general", "choose"); firstoption.value = ""; select.add(firstoption); } for (let i = 0; i < optionList.length; i++) { - var option = document.createElement("option"); option.text = optionList[i].VALUE_COLUMN_NAME; option.value = optionList[i].ID_COLUMN_NAME; select.add(option); - } if (select.dataset.hiddenval) { select.value = select.dataset.hiddenval; @@ -389,14 +539,13 @@ export class AddEitComponent implements OnInit { console.log(elem); console.log(obj); const elemType = elem.tagName; - let changeEvent = 'ionChange'; + let changeEvent = "ionChange"; - if (elemType == 'SELECT') - changeEvent = 'change'; + if (elemType == "SELECT") changeEvent = "change"; try { // elem.addEventListener("change", (e) => { - elem.addEventListener(changeEvent, (e) => { + elem.addEventListener(changeEvent, e => { //console.log("elem change "+elem.id); //let x=e.currentTarget as HTMLInputElement; //let isEmpty:boolean=false; @@ -404,7 +553,10 @@ export class AddEitComponent implements OnInit { // isEmpty=true; //emptyChildElement elem.classList.remove("requiredClassElm"); - if (obj.CHILD_SEGMENTS_VS_Splited && obj.CHILD_SEGMENTS_VS_Splited.length > 0) { + if ( + obj.CHILD_SEGMENTS_VS_Splited && + obj.CHILD_SEGMENTS_VS_Splited.length > 0 + ) { let listArray: any = obj.CHILD_SEGMENTS_VS_Splited; listArray.forEach(element => { //if(isEmpty) @@ -413,7 +565,10 @@ export class AddEitComponent implements OnInit { this.getValueSet(element); }); } - if (obj.CHILD_SEGMENTS_DV_Splited && obj.CHILD_SEGMENTS_DV_Splited.length > 0) { + if ( + obj.CHILD_SEGMENTS_DV_Splited && + obj.CHILD_SEGMENTS_DV_Splited.length > 0 + ) { let listArray: any = obj.CHILD_SEGMENTS_DV_Splited; listArray.forEach(element => { // if(isEmpty){ @@ -421,7 +576,14 @@ export class AddEitComponent implements OnInit { // }else{ for (let i = 0; i < this.eitResponse.length; i++) { if (this.eitResponse[i].SEGMENT_NAME == element) { - this.getDefaultValue(this.eitResponse[i], this.eitResponse[i].DESC_FLEX_NAME, this.eitResponse[i].DESC_FLEX_CONTEXT_CODE, this.eitResponse[i].SEGMENT_NAME, this.eitResponse[i].PARENT_SEGMENTS_VS_SplitedVS, this.eitResponse[i].PARENT_SEGMENTS_DV_Splited); + this.getDefaultValue( + this.eitResponse[i], + this.eitResponse[i].DESC_FLEX_NAME, + this.eitResponse[i].DESC_FLEX_CONTEXT_CODE, + this.eitResponse[i].SEGMENT_NAME, + this.eitResponse[i].PARENT_SEGMENTS_VS_SplitedVS, + this.eitResponse[i].PARENT_SEGMENTS_DV_Splited + ); } } // } @@ -435,7 +597,14 @@ export class AddEitComponent implements OnInit { } } - public getDefaultValue(obj, descFlexName, descFlexContextCode, segmentName, parentValue, ParentsList) { + public getDefaultValue( + obj, + descFlexName, + descFlexContextCode, + segmentName, + parentValue, + ParentsList + ) { let dependenciesList: any = []; let parentVal: any = null; let isStandardDate: boolean = false; @@ -443,48 +612,52 @@ export class AddEitComponent implements OnInit { let isStandardTime: boolean = false; let isHidden: boolean = false; let isReadOnlyList: boolean = false; + let isSelectElement: boolean = false; isStandardDate = this.isStandardDate(obj); isStandardTimeDate = this.isStandardDateTime(obj); isStandardTime = this.isStandardTime(obj); - if (obj.DISPLAY_FLAG == 'N') - isHidden = true; - if (obj.VALIDATION_TYPE != 'N' && obj.READ_ONLY == 'Y') { + if (obj.DISPLAY_FLAG == "N") isHidden = true; + if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "Y") { isReadOnlyList = true; } + if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "N") { + isSelectElement = true; + } //if(parentValue!=""){ parentVal= this.getDependenciesParams(parentValue)[0].ID_COLUMN_NAME;} //if(ParentsList!=""){dependenciesList =this.getDependenciesParams(ParentsList); } - if (parentValue != "" && (obj.VALIDATION_TYPE == 'D' || obj.VALIDATION_TYPE == 'Y')) { + if ( + parentValue != "" && + (obj.VALIDATION_TYPE == "D" || obj.VALIDATION_TYPE == "Y") + ) { let parvalue = this.getDependenciesParams(parentValue); - if (parvalue && parvalue[0]) - parentVal = parvalue[0].ID_COLUMN_NAME; + if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME; else { parentVal = null; } - if (!parentVal) { return false }; + if (!parentVal) { + return false; + } } if (ParentsList != "") { - if (parentValue) - ParentsList.concat(parentValue); + if (parentValue) ParentsList.concat(parentValue); dependenciesList = this.getDependenciesParams(ParentsList); - if (!dependenciesList) { return false }; + if (!dependenciesList) { + return false; + } } - //if (dependenciesList==false){return false}; const body = { - P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, P_MENU_TYPE: this.menuType, - P_SELECTED_RESP_ID: this.respID,//-999, + P_SELECTED_RESP_ID: this.respID, //-999, P_DESC_FLEX_NAME: descFlexName, P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode, P_SEGMENT_NAME: segmentName, P_PARENT_VALUE: parentVal, - GetValueSetValuesTBL: dependenciesList, - } - - + GetValueSetValuesTBL: dependenciesList + }; this.eitService.getDefaultValue(body).subscribe((result: any) => { let elem = this.getElementByName(segmentName); @@ -497,10 +670,10 @@ export class AddEitComponent implements OnInit { let val = obj.value; let text = obj.text; if (isStandardDate) { - console.log('isStandardDate'); + console.log("isStandardDate"); elem.value = this.cs.reverseFormatDate(val); } else if (isStandardTimeDate) { - console.log('isStandardTimeDate'); + console.log("isStandardTimeDate"); if (val) { elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val); elem.innerHTML = this.cs.reverseFormatStandardDate(val); @@ -509,7 +682,7 @@ export class AddEitComponent implements OnInit { elem.innerHTML = ""; } } else if (isStandardTime) { - console.log('isStandardTime'); + console.log("isStandardTime"); if (val) { elem.dataset.dtvalue = val; elem.innerHTML = val; @@ -518,26 +691,39 @@ export class AddEitComponent implements OnInit { elem.innerHTML = ""; } } else { - console.log('else - ' + elem.value); + if (isSelectElement) { + let elem = this.getSelectElementByName(segmentName); + elem = document.getElementById(elem), + // var firstoption = document.createElement("option"); + // firstoption.text = text; + // firstoption.value = val; + // elem.add(firstoption); + elem.value = val; + elem.text=text; + alert(elem.length); + }else{ + console.log("else - " + elem.value); elem.value = val; elem.innerText = text; - elem.setAttribute('value', val); - console.log('else - ' + elem.value); + elem.setAttribute("value", val); + console.log("else - " + elem.value); + } } if (isHidden || isReadOnlyList) { - if (val) - elem.dataset.colmText = val; - else - elem.dataset.colmText = ""; + if (val) elem.dataset.colmText = val; + else elem.dataset.colmText = ""; elem.value = text; } - var event = new Event('ionChange'); + var event = new Event("ionChange"); elem.dispatchEvent(event); }); } handleDefaultValueResult(result) { - let data = { text: result.GetDefaultValueList.P_VALUE_COLUMN_NAME, value: result.GetDefaultValueList.P_ID_COLUMN_NAME } + let data = { + text: result.GetDefaultValueList.P_VALUE_COLUMN_NAME, + value: result.GetDefaultValueList.P_ID_COLUMN_NAME + }; return data; } @@ -552,12 +738,18 @@ export class AddEitComponent implements OnInit { for (let i = 0; i < this.eitResponse.length; i++) { if (this.eitResponse[i].SEGMENT_NAME == parentValue[0].Name) { if (this.eitResponse[i].VALIDATION_TYPE == "N") { - let val = (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME) as HTMLInputElement).value; + let val = (document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; return val; } else { - let x = (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)) as HTMLSelectElement; + let x = document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; if (x.options.length > 0) { - let val = x.options[x.selectedIndex] ? x.options[x.selectedIndex].value : null; + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : null; return val; } else { return ""; @@ -571,9 +763,8 @@ export class AddEitComponent implements OnInit { } public getValueSet(segmentName) { - let descFlexName: any = ""; - let descFlexContextCode: any = "" + let descFlexContextCode: any = ""; let parentValue: any = []; let ParentsList: any = []; let parentVal: any = null; @@ -592,18 +783,24 @@ export class AddEitComponent implements OnInit { } if (parentValue != "" && (validationType == "D" || validationType == "Y")) { let parvalue = this.getDependenciesParams(parentValue); - if (parvalue && parvalue[0]) - parentVal = parvalue[0].ID_COLUMN_NAME; + if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME; else { parentVal = null; } - if (!parentVal) { return false }; + if (!parentVal) { + return false; + } + } + if (ParentsList != "") { + dependenciesList = this.getDependenciesParams(ParentsList); + if (!dependenciesList) { + return false; + } } - if (ParentsList != "") { dependenciesList = this.getDependenciesParams(ParentsList); if (!dependenciesList) { return false }; } const body = { P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, P_MENU_TYPE: this.menuType, - P_SELECTED_RESP_ID: this.respID,//-999, + P_SELECTED_RESP_ID: this.respID, //-999, P_DESC_FLEX_NAME: descFlexName, P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode, P_SEGMENT_NAME: segmentName, @@ -611,7 +808,7 @@ export class AddEitComponent implements OnInit { GetValueSetValuesTBL: dependenciesList, P_PAGE_NUM: 1, P_PAGE_LIMIT: 1000 - } + }; this.eitService.getSetValue(body).subscribe((result: any) => { if (result.GetValueSetValuesList != null) { @@ -627,14 +824,23 @@ export class AddEitComponent implements OnInit { for (let i = 0; i < parentsList.length; i++) { for (let j = 0; j < this.eitResponse.length; j++) { if (this.eitResponse[j].SEGMENT_NAME == parentsList[i].Name) { - if (this.eitResponse[j].DISPLAY_FLAG != 'N') { + if (this.eitResponse[j].DISPLAY_FLAG != "N") { if (this.eitResponse[j].VALIDATION_TYPE == "N") { let idColName: string; let val: any; - if (this.eitResponse[j].FORMAT_TYPE == "Y" || this.eitResponse[j].FORMAT_TYPE == "I") {//standard date time or //time - let elem = document.getElementById(this.eitResponse[j].APPLICATION_COLUMN_NAME) as HTMLDivElement; + if ( + this.eitResponse[j].FORMAT_TYPE == "Y" || + this.eitResponse[j].FORMAT_TYPE == "I" + ) { + //standard date time or //time + let elem = document.getElementById( + this.eitResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLDivElement; val = elem.dataset.dtvalue; - if ((val == undefined || val == "") && parentsList[i].IsRequired == "REQUIRED") { + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { //alert(parentsList[i].Name +" Is required"); return false; } @@ -642,60 +848,116 @@ export class AddEitComponent implements OnInit { if (this.eitResponse[j].FORMAT_TYPE == "Y") idColName = this.cs.formatStandardDate(val); } else { - val = (document.getElementById(this.eitResponse[j].APPLICATION_COLUMN_NAME) as HTMLInputElement).value; - if ((val == undefined || val == "") && parentsList[i].IsRequired == "REQUIRED") { + val = (document.getElementById( + this.eitResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { //alert(parentsList[i].Name +" Is required"); return false; } idColName = val; - if (this.eitResponse[j].FORMAT_TYPE == "X") {//date + if (this.eitResponse[j].FORMAT_TYPE == "X") { + //date // idColName = this.cs.formatDate(val); idColName = this.cs.formatDateNew(val); } } - parentArr.push({ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, VALUE_COLUMN_NAME: val, DESCRIPTION: "", ID_COLUMN_NAME: idColName, FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME }) + parentArr.push({ + SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: val, + DESCRIPTION: "", + ID_COLUMN_NAME: idColName, + FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME + }); break; } else { - if (this.eitResponse[j].READ_ONLY != 'Y') { - let x = (document.getElementById(this.eitResponse[j].APPLICATION_COLUMN_NAME)) as HTMLSelectElement; - let text = x.options[x.selectedIndex] ? x.options[x.selectedIndex].text : ""; - let val = x.options[x.selectedIndex] ? x.options[x.selectedIndex].value : undefined; - if ((val == undefined || val == "") && parentsList[i].IsRequired == "REQUIRED") { + if (this.eitResponse[j].READ_ONLY != "Y") { + let x = document.getElementById( + this.eitResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + let text = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].text + : ""; + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : undefined; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { //alert(parentsList[i].Name +" Is required"); return false; - } else { } - if (text == undefined) { text = ""; } - parentArr.push({ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, VALUE_COLUMN_NAME: text, DESCRIPTION: "", ID_COLUMN_NAME: val, FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME }) + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME + }); break; } else { - let x = (document.getElementById(this.eitResponse[j].APPLICATION_COLUMN_NAME)) as HTMLInputElement; + let x = document.getElementById( + this.eitResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; let text = x.value; let val = x.dataset.colmText; - if ((val == undefined || val == "") && parentsList[i].IsRequired == "REQUIRED") { + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { //alert(parentsList[i].Name +" Is required"); return false; - } else { } - if (text == undefined) { text = ""; } - parentArr.push({ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, VALUE_COLUMN_NAME: text, DESCRIPTION: "", ID_COLUMN_NAME: val, FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME }) + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME + }); break; } } } else { - let x = (document.getElementById(this.eitResponse[j].APPLICATION_COLUMN_NAME)) as HTMLInputElement; + let x = document.getElementById( + this.eitResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; let text = x.value; let val = x.dataset.colmText; - if ((val == undefined || val == "") && parentsList[i].IsRequired == "REQUIRED") { + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { //alert(parentsList[i].Name +" Is required"); return false; - } else { } - if (text == undefined) { text = ""; } - parentArr.push({ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, VALUE_COLUMN_NAME: text, DESCRIPTION: "", ID_COLUMN_NAME: val, FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME }) + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME + }); break; } - } } - } return parentArr; } @@ -704,13 +966,13 @@ export class AddEitComponent implements OnInit { let elem = this.getElementByName(segmentName); elem.value = null; elem.innerHTML = ""; - if (("dtvalue" in elem.dataset)) { + if ("dtvalue" in elem.dataset) { elem.dataset.dtvalue = ""; } - if (("colmText" in elem.dataset)) { + if ("colmText" in elem.dataset) { elem.dataset.colmText = ""; } - var event = new Event('change'); + var event = new Event("change"); elem.dispatchEvent(event); elem.classList.remove("requiredClassElm"); } @@ -718,7 +980,9 @@ export class AddEitComponent implements OnInit { getRequiredFilds() { for (let i = 0; i < this.eitResponse.length; i++) { if (this.eitResponse[i].REQUIRED_FLAG == "Y") { - let elemVal = (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME) as HTMLInputElement).value; + let elemVal = (document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; if (elemVal == "") { //alert(this.eitResponse[i].SEGMENT_NAME+" is required"); break; @@ -728,7 +992,7 @@ export class AddEitComponent implements OnInit { } getElementByName(segmentName) { - let elemID: any = "" + let elemID: any = ""; for (let i = 0; i < this.eitResponse.length; i++) { if (this.eitResponse[i].SEGMENT_NAME == segmentName) { elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME; @@ -738,10 +1002,28 @@ export class AddEitComponent implements OnInit { return document.getElementById(elemID) as HTMLInputElement; } + getSelectElementByName(segmentName) { + let elemID: any = ""; + for (let i = 0; i < this.eitResponse.length; i++) { + if (this.eitResponse[i].SEGMENT_NAME == segmentName) { + elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME; + break; + } + } + return elemID; + } + isStandardDate(obj: any): boolean { let isSt: boolean = false; - if (obj.FORMAT_TYPE == "X") {// standard date - if (obj.DEFAULT_TYPE == "C" || obj.DEFAULT_TYPE == "D" || obj.DEFAULT_TYPE == "P" || obj.DEFAULT_TYPE == "S") {//constant + if (obj.FORMAT_TYPE == "X") { + // standard date + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant isSt = true; } } @@ -749,8 +1031,15 @@ export class AddEitComponent implements OnInit { } isStandardDateTime(obj: any): boolean { let isSt: boolean = false; - if (obj.FORMAT_TYPE == "Y") {// standard date time - if (obj.DEFAULT_TYPE == "C" || obj.DEFAULT_TYPE == "D" || obj.DEFAULT_TYPE == "P" || obj.DEFAULT_TYPE == "S") {//constant + if (obj.FORMAT_TYPE == "Y") { + // standard date time + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant isSt = true; } } @@ -758,8 +1047,15 @@ export class AddEitComponent implements OnInit { } isStandardTime(obj: any): boolean { let isSt: boolean = false; - if (obj.FORMAT_TYPE == "I") {// standard date time - if (obj.DEFAULT_TYPE == "C" || obj.DEFAULT_TYPE == "D" || obj.DEFAULT_TYPE == "P" || obj.DEFAULT_TYPE == "S") {//constant + if (obj.FORMAT_TYPE == "I") { + // standard date time + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant isSt = true; } } @@ -768,7 +1064,8 @@ export class AddEitComponent implements OnInit { isStandardDateVal(obj: any): boolean { let isSt: boolean = false; - if (obj.FORMAT_TYPE == "X") {// standard date + if (obj.FORMAT_TYPE == "X") { + // standard date // if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant isSt = true; // } @@ -777,7 +1074,8 @@ export class AddEitComponent implements OnInit { } isStandardDateTimeVal(obj: any): boolean { let isSt: boolean = false; - if (obj.FORMAT_TYPE == "Y") {// standard date time + if (obj.FORMAT_TYPE == "Y") { + // standard date time //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant isSt = true; //} @@ -786,7 +1084,8 @@ export class AddEitComponent implements OnInit { } isStandardTimeVal(obj: any): boolean { let isSt: boolean = false; - if (obj.FORMAT_TYPE == "I") {// standard time + if (obj.FORMAT_TYPE == "I") { + // standard time //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant isSt = true; //} @@ -804,11 +1103,17 @@ export class AddEitComponent implements OnInit { val = this.validateEitObj[i].DATE_VALUE; else if (this.validateEitObj[i].NUMBER_VALUE) val = this.validateEitObj[i].NUMBER_VALUE; - const elem = document.getElementById(this.validateEitObj[i].APPLICATION_COLUMN_NAME) as HTMLInputElement; + const elem = document.getElementById( + this.validateEitObj[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; //obj.transactionNo=this.validateEitObj[i].TRANSACTION_NUMBER; if (elem) { if (val) { - let feldDetails = this.eitResponse.find(x => x.APPLICATION_COLUMN_NAME == this.validateEitObj[i].APPLICATION_COLUMN_NAME); + let feldDetails = this.eitResponse.find( + x => + x.APPLICATION_COLUMN_NAME == + this.validateEitObj[i].APPLICATION_COLUMN_NAME + ); if (feldDetails) { let isStandardDate = this.isStandardDateVal(feldDetails); let isStandardDateTime = this.isStandardDateTimeVal(feldDetails); @@ -823,16 +1128,23 @@ export class AddEitComponent implements OnInit { elem.dataset.dtvalue = val; } else { elem.value = val; - elem.setAttribute('value', elem.value); + elem.setAttribute("value", elem.value); } - if ((feldDetails.DISPLAY_FLAG == 'N') || (feldDetails.VALIDATION_TYPE != "N" && feldDetails.READ_ONLY == 'Y')) { + if ( + feldDetails.DISPLAY_FLAG == "N" || + (feldDetails.VALIDATION_TYPE != "N" && + feldDetails.READ_ONLY == "Y") + ) { elem.dataset.colmText = val; elem.value = this.validateEitObj[i].SEGMENT_VALUE_DSP; - elem.setAttribute('value', elem.value); + elem.setAttribute("value", elem.value); } } - elem.dataset.hiddenval = val;//hide the value to set it after calling get value set - if (feldDetails.CHILD_SEGMENTS_VS_Splited && feldDetails.CHILD_SEGMENTS_VS_Splited.length > 0) { + elem.dataset.hiddenval = val; //hide the value to set it after calling get value set + if ( + feldDetails.CHILD_SEGMENTS_VS_Splited && + feldDetails.CHILD_SEGMENTS_VS_Splited.length > 0 + ) { let listArray: any = feldDetails.CHILD_SEGMENTS_VS_Splited; listArray.forEach(element => { this.getValueSet(element); @@ -842,9 +1154,14 @@ export class AddEitComponent implements OnInit { // elem.dispatchEvent(event); } } else { - if (this.validateEitObj[i].APPLICATION_COLUMN_NAME == "PEI_OBJECT_VERSION_NUMBER") + if ( + this.validateEitObj[i].APPLICATION_COLUMN_NAME == + "PEI_OBJECT_VERSION_NUMBER" + ) obj.peiObjVer = this.validateEitObj[i].NUMBER_VALUE; - else if (this.validateEitObj[i].APPLICATION_COLUMN_NAME == "PEI_EXTRA_INFO_ID") + else if ( + this.validateEitObj[i].APPLICATION_COLUMN_NAME == "PEI_EXTRA_INFO_ID" + ) obj.peiExtraInfoID = this.validateEitObj[i].NUMBER_VALUE; } } @@ -852,7 +1169,7 @@ export class AddEitComponent implements OnInit { } public getElementsValues(): any { - this.updatedValues = [];//fill updated list + this.updatedValues = []; //fill updated list let valuseArr: any = []; let varcharValue: any = null; let numbervalue: any = 0; @@ -867,22 +1184,42 @@ export class AddEitComponent implements OnInit { dateValue = null; /*********set transaction No of the updated object ********/ if (this.getPassdirfromNotifiPage) { - let updatedObj = this.validateEitObj.find(x => x.APPLICATION_COLUMN_NAME == this.eitResponse[i].APPLICATION_COLUMN_NAME); + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitResponse[i].APPLICATION_COLUMN_NAME + ); let y = updatedObj; transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop } if (this.eitResponse[i].DISPLAY_FLAG != "N") { if (this.eitResponse[i].VALIDATION_TYPE == "N") { - let elem = document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME) as HTMLInputElement; - let elemVal = (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME) as HTMLInputElement).value; + let elem = document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let elemVal = (document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; textValue = elemVal; //let elemVal= (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)).value; - if (this.eitResponse[i].FORMAT_TYPE == "X" && this.eitResponse[i].DISPLAY_FLAG != "N") {//date + if ( + this.eitResponse[i].FORMAT_TYPE == "X" && + this.eitResponse[i].DISPLAY_FLAG != "N" + ) { + //date elemVal = this.cs.formatDate(elemVal); - } else if (this.eitResponse[i].FORMAT_TYPE == "Y" && this.eitResponse[i].DISPLAY_FLAG != "N") {//standard date time + } else if ( + this.eitResponse[i].FORMAT_TYPE == "Y" && + this.eitResponse[i].DISPLAY_FLAG != "N" + ) { + //standard date time elemVal = elem.dataset.dtvalue; elemVal = this.cs.formatStandardDate(elemVal); - } else if (this.eitResponse[i].FORMAT_TYPE == "I" && this.eitResponse[i].DISPLAY_FLAG != "N") {//time + } else if ( + this.eitResponse[i].FORMAT_TYPE == "I" && + this.eitResponse[i].DISPLAY_FLAG != "N" + ) { + //time elemVal = elem.dataset.dtvalue; } if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !elemVal) { @@ -892,28 +1229,30 @@ export class AddEitComponent implements OnInit { } else { elem.classList.remove("requiredClassElm"); } - if (elemVal) - varcharValue = elemVal; - valuseArr.push( - { - TRANSACTION_NUMBER: transNo, - NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME, - VARCHAR2_VALUE: varcharValue, - NUMBER_VALUE: numbervalue, - DATE_VALUE: dateValue - } - ) - } - else { - let x = (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)) as HTMLSelectElement; - if (this.eitResponse[i].READ_ONLY == 'Y') { + if (elemVal) varcharValue = elemVal; + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } else { + let x = document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + if (this.eitResponse[i].READ_ONLY == "Y") { let text = x.value; let val = x.dataset.colmText; varcharValue = val; textValue = text; } else { - let val = x.options[x.selectedIndex] ? x.options[x.selectedIndex].value : null; - let txt = x.options[x.selectedIndex] ? x.options[x.selectedIndex].text : null; + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : null; + let txt = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].text + : null; varcharValue = val; textValue = txt; } @@ -925,18 +1264,18 @@ export class AddEitComponent implements OnInit { x.classList.remove("requiredClassElm"); } - valuseArr.push( - { - TRANSACTION_NUMBER: transNo, - NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME, - VARCHAR2_VALUE: varcharValue, - NUMBER_VALUE: numbervalue, - DATE_VALUE: dateValue - } - ); - }//end else + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } //end else } else { - let x = (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)) as HTMLSelectElement; + let x = document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; let val = x.dataset.colmText; textValue = x.value; if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !val) { @@ -946,21 +1285,22 @@ export class AddEitComponent implements OnInit { } else { x.classList.remove("requiredClassElm"); } - if (val) - varcharValue = val; - valuseArr.push( - { - TRANSACTION_NUMBER: transNo, - NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME, - VARCHAR2_VALUE: varcharValue, - NUMBER_VALUE: numbervalue, - DATE_VALUE: dateValue - } - ); + if (val) varcharValue = val; + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); } if (this.getPassdirfromNotifiPage) { - let updatedObj = this.validateEitObj.find(x => x.APPLICATION_COLUMN_NAME == this.eitResponse[i].APPLICATION_COLUMN_NAME); + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitResponse[i].APPLICATION_COLUMN_NAME + ); let y = updatedObj; y.VARCHAR2_VALUE = varcharValue; y.NUMBER_VALUE = numbervalue; @@ -970,7 +1310,11 @@ export class AddEitComponent implements OnInit { this.updatedValues.push(y); } else { if (this.validateEitObj && this.eitSubmitAction == EIT_ACTION.UPDATE) { - let updatedObj = this.validateEitObj.find(x => x.APPLICATION_COLUMN_NAME == this.eitResponse[i].APPLICATION_COLUMN_NAME); + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitResponse[i].APPLICATION_COLUMN_NAME + ); let y = updatedObj; y.VARCHAR2_VALUE = varcharValue; y.NUMBER_VALUE = numbervalue; @@ -985,7 +1329,8 @@ export class AddEitComponent implements OnInit { NUMBER_VALUE: numbervalue, DATE_VALUE: dateValue, SEGMENT_VALUE_DSP: textValue, - APPLICATION_COLUMN_NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME, + APPLICATION_COLUMN_NAME: this.eitResponse[i] + .APPLICATION_COLUMN_NAME, DATATYPE: this.eitResponse[i].DATATYPE, DESC_FLEX_CONTEXT_CODE: this.eitResponse[i].DESC_FLEX_CONTEXT_CODE, DESC_FLEX_NAME: this.eitResponse[i].DESC_FLEX_NAME, @@ -997,30 +1342,72 @@ export class AddEitComponent implements OnInit { this.updatedValues.push(y); } } - }// end for + } // end for if (this.getPassdirfromNotifiPage) { - let updatedObj1 = this.validateEitObj.find(x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION"); - let updatedObj2 = this.validateEitObj.find(x => x.APPLICATION_COLUMN_NAME === "PEI_EXTRA_INFO_ID"); - let updatedObj3 = this.validateEitObj.find(x => x.APPLICATION_COLUMN_NAME === "PEI_OBJECT_VERSION_NUMBER"); + let updatedObj1 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION" + ); + let updatedObj2 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_EXTRA_INFO_ID" + ); + let updatedObj3 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_OBJECT_VERSION_NUMBER" + ); this.updatedValues.push(updatedObj1); this.updatedValues.push(updatedObj2); this.updatedValues.push(updatedObj3); - valuseArr = this.fillExtraInformation(valuseArr, updatedObj1.VARCHAR2_VALUE, updatedObj2.NUMBER_VALUE, updatedObj3.NUMBER_VALUE, transNo); + valuseArr = this.fillExtraInformation( + valuseArr, + updatedObj1.VARCHAR2_VALUE, + updatedObj2.NUMBER_VALUE, + updatedObj3.NUMBER_VALUE, + transNo + ); } else { if (this.eitSubmitAction == EIT_ACTION.ADD) { - this.updatedValues = this.fillExtraValuesUpdated(this.updatedValues, "NEW_ROW", -1, 0, transNo); - valuseArr = this.fillExtraInformation(valuseArr, "NEW_ROW", -1, 0, transNo); + this.updatedValues = this.fillExtraValuesUpdated( + this.updatedValues, + "NEW_ROW", + -1, + 0, + transNo + ); + valuseArr = this.fillExtraInformation( + valuseArr, + "NEW_ROW", + -1, + 0, + transNo + ); } else if (this.eitSubmitAction == EIT_ACTION.UPDATE) { - valuseArr = this.fillExtraInformation(valuseArr, "UPDATE_ROW", this.ExtraObj.peiExtraInfoID, this.ExtraObj.peiObjVer, transNo); + valuseArr = this.fillExtraInformation( + valuseArr, + "UPDATE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); } else if (this.eitSubmitAction == EIT_ACTION.DELETE) { - valuseArr = this.fillExtraInformation(valuseArr, "DELETE_ROW", this.ExtraObj.peiExtraInfoID, this.ExtraObj.peiObjVer, transNo); + valuseArr = this.fillExtraInformation( + valuseArr, + "DELETE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); } } return valuseArr; - }// end getElementsValues - - fillExtraValuesUpdated(values: any, peiAction: string, peiExtraInfoID: number, peiObjVer: number, transNo: number): any { + } // end getElementsValues + + fillExtraValuesUpdated( + values: any, + peiAction: string, + peiExtraInfoID: number, + peiObjVer: number, + transNo: number + ): any { let obj1 = { TRANSACTION_NUMBER: transNo, VARCHAR2_VALUE: peiAction, @@ -1048,7 +1435,7 @@ export class AddEitComponent implements OnInit { DISPLAY_FLAG: "N", SEGMENT_NAME: "", SEGMENT_PROMPT: "" - } + }; let obj3 = { APPLICATION_COLUMN_NAME: "PEI_EXTRA_INFO_ID", DATATYPE: "NUMBER", @@ -1062,46 +1449,51 @@ export class AddEitComponent implements OnInit { SEGMENT_VALUE_DSP: "", TRANSACTION_NUMBER: transNo, VARCHAR2_VALUE: null - } + }; values.push(obj1); values.push(obj2); values.push(obj3); return values; } - fillExtraInformation(values: any, peiAction: string, peiExtraInfoID: number, peiObjVer: number, transNo: number): any { - values.push( - { - TRANSACTION_NUMBER: transNo, - NAME: "PEI_ACTION", - VARCHAR2_VALUE: peiAction, - NUMBER_VALUE: null, - DATE_VALUE: null - }); - values.push( - { - TRANSACTION_NUMBER: transNo, - NAME: "PEI_EXTRA_INFO_ID", - VARCHAR2_VALUE: null, - NUMBER_VALUE: peiExtraInfoID, - DATE_VALUE: null - }); - values.push( - { - TRANSACTION_NUMBER: transNo, - NAME: "PEI_OBJECT_VERSION_NUMBER", - VARCHAR2_VALUE: null, - NUMBER_VALUE: peiObjVer, - DATE_VALUE: null - }); + fillExtraInformation( + values: any, + peiAction: string, + peiExtraInfoID: number, + peiObjVer: number, + transNo: number + ): any { + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_ACTION", + VARCHAR2_VALUE: peiAction, + NUMBER_VALUE: null, + DATE_VALUE: null + }); + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_EXTRA_INFO_ID", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiExtraInfoID, + DATE_VALUE: null + }); + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_OBJECT_VERSION_NUMBER", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiObjVer, + DATE_VALUE: null + }); return values; } submitEit() { let list = this.eitRequest.EITTransactionTBL; this.eitRequest.EITTransactionTBL = this.fixTransactionNo(list); - this.eitService.submitEit(this.eitRequest).subscribe((result: AddEitResponse) => { - this.handleSubmitEitResult(result); - }); + this.eitService + .submitEit(this.eitRequest) + .subscribe((result: AddEitResponse) => { + this.handleSubmitEitResult(result); + }); } fixTransactionNo(transactionTBL: any): any[] { @@ -1134,7 +1526,10 @@ export class AddEitComponent implements OnInit { } handleSubmitEitResult(result) { if (this.cs.validResponse(result)) { - this.cs.sharedService.setSharedData(this.eitRequest, EitRequest.SHARED_DATA); + this.cs.sharedService.setSharedData( + this.eitRequest, + EitRequest.SHARED_DATA + ); this.cs.sharedService.setSharedData(result, AddEitResponse.SHARED_DATA); //this.addrespList=result.SubmitEITTransactionList; // this.itemKey=this.addrespList.P_ITEM_KEY; @@ -1144,7 +1539,10 @@ export class AddEitComponent implements OnInit { // // this.sharedData.setSharedData(result.SubmitEITTransactionList.P_TRANSACTION_ID,"TransactionIDResubmit"); // // this.sharedData.setSharedData(this.eitRequest,EitRequest.SHARED_DATA); - this.cs.sharedService.setSharedData({ isResubmit: false }, 'confirmAddEITData') + this.cs.sharedService.setSharedData( + { isResubmit: false }, + "confirmAddEITData" + ); this.cs.openConfirmEitPage(); // this.navCtrl.push("ConfirmAddEitPage", { isResubmit: false }); } @@ -1157,22 +1555,27 @@ export class AddEitComponent implements OnInit { this.eitRequest = { P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, P_MENU_TYPE: this.menuType, - P_SELECTED_RESP_ID: this.respID,//this.selMenu.List_Menu.RESP_ID,//-999, + P_SELECTED_RESP_ID: this.respID, //this.selMenu.List_Menu.RESP_ID,//-999, P_FUNCTION_NAME: this.functionName, P_DESC_FLEX_CONTEXT_CODE: this.eitResponse[0].DESC_FLEX_CONTEXT_CODE, EITTransactionTBL: this.arrValues - } + }; - this.eitService.validateEITTransaction(this.eitRequest).subscribe((result: any) => { - this.handleEITValidateTr(result); - }); + this.eitService + .validateEITTransaction(this.eitRequest) + .subscribe((result: any) => { + this.handleEITValidateTr(result); + }); } } private handleEITValidateTr(result) { let data: any = { eitRequest: {}, updated: [] }; if (this.cs.validResponse(result)) { // public static SHARED_DATA = 'login-request'; - this.cs.sharedService.setSharedData(this.eitRequest, EitRequest.SHARED_DATA); + this.cs.sharedService.setSharedData( + this.eitRequest, + EitRequest.SHARED_DATA + ); if (this.getPassdirfromNotifiPage) { let data: any = { eitRequest: {}, updated: [] }; data.eitRequest = this.eitRequest; @@ -1192,5 +1595,4 @@ export class AddEitComponent implements OnInit { data = { eitRequest: {}, updated: [] }; } } - } diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index 78b4f46e..5b50f3f5 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -23,8 +23,9 @@ export class ConnectorService { public static timeOut = 30 * 1000; // public static host = 'http://10.50.100.113:6060/'; // development service - //public static host = "https://uat.hmgwebservices.com/"; +//public static host = "https://uat.hmgwebservices.com/"; public static host = 'https://hmgwebservices.com/'; + //public static host = 'http://10.200.204.11:4444/'; // production service // public static host = 'http://10.50.100.198:6060/'; // public static host = 'http://10.50.100.113:6060/'; // development service /* public static host = 'http://10.50.100.198:6060/'; diff --git a/Mohem/src/app/notification/service/work-list.main.service.ts b/Mohem/src/app/notification/service/work-list.main.service.ts index 958925a5..39ec6908 100644 --- a/Mohem/src/app/notification/service/work-list.main.service.ts +++ b/Mohem/src/app/notification/service/work-list.main.service.ts @@ -16,6 +16,7 @@ import { PRNotificatonBodyResponse } from "../models/PRNotificationBodyRes"; import { StaticInjector } from "@angular/core/src/di/injector"; import { POItemHistoryRes } from "../models/POItemHistoryRes"; import { MOItemHistoryRes } from "../models/MOItemHistoryRes"; +import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes'; @Injectable() export class WorklistMainService { @@ -38,6 +39,9 @@ export class WorklistMainService { "Services/ERP.svc/REST/NOTIFICATION_ACTIONS"; public static getNotificationRespondAtt = "Services/ERP.svc/REST/NOTIFICATION_GET_RESPOND_ATTRIBUTES"; + public static getQutationAnalysisUrl = + "Services/ERP.svc/REST/GET_QUOTATION_ANALYSIS"; + constructor( public api: ConnectorService, public authService: AuthenticationService @@ -148,6 +152,21 @@ export class WorklistMainService { ); } + public getQutationAnalysis( + qutationAnalysis: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = qutationAnalysis; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getQutationAnalysisUrl, + request, + onError, + errorLabel + ); + } + public getNotificationButtons( WorkListButtonRequest: any, onError?: any, diff --git a/Mohem/src/app/time-card/service/models/DayHoursTypeDetailsList.ts b/Mohem/src/app/time-card/service/models/DayHoursTypeDetailsList.ts new file mode 100644 index 00000000..4c412561 --- /dev/null +++ b/Mohem/src/app/time-card/service/models/DayHoursTypeDetailsList.ts @@ -0,0 +1,42 @@ +export class DayHoursTypeDetailsList { + public RTP_ID: number; + public ASSIGNMENT_ID: number; + public SCHEDULE_DATE: Date; + public SCHEDULED_HRS: string; + public SCHEDULED_PLANNED_OT_HRS: string; + public SCHEDULED_ON_CALL_HRS: string; + public ACTUAL_HRS: string; + public PLANNED_OT_HRS: string; + public ON_CALL_HRS: string; + public EXCESS_HRS: string; + public COMP_OFF_HRS: string; + public COMP_OFF_H_HRS: string; + public COMP_OFF_N_HRS: string; + public COMP_OFF_W_HRS: string; + public TIMEBACK_HRS: string; + public SHORTAGE_HRS: string; + public LATE_IN_HRS: string; + public EARLY_OUT_HRS: string; + public APPROVED_TIMEBACK_HRS: string; + public REMARKS: string; + public ABSENCE_ATTENDANCE_TYPE_ID: number; + public PERSON_EXTRA_INFO_ID: number; + public DAY_TYPE: string; + public MISSING_SWIPE_FLAG: string; + public EXCESS_FLAG: string; + public COMP_OFF_FLAG: string; + public TIMEBACK_FLAG: string; + public SHORTAGE_FLAG: string; + public LATE_IN_FLAG: string; + public EARLY_OUT_FLA: string; + public APPR_TIMEBACK_FLAG: string; + public PLANNED_OT_HRS_FLAG: string; + public ANALAYZED_FLAG: string; + public NON_SCHEDULED_FLAG: string; + public ROW_NUM: number; + public NO_OF_ROWS: number; + public FROM_ROW_NUM: number; + public TO_ROW_NUM: number; + public CALENDAR_ENTRY_ID: number; + public ABSENCE_ATTENDANCE_ID: number; +} diff --git a/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts b/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts new file mode 100644 index 00000000..987dc09c --- /dev/null +++ b/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts @@ -0,0 +1,24 @@ +import { Request } from "src/app/hmg-common/services/models/request"; +import { DateTimeInput } from "src/app/uI-elements/date-time.input"; + +export class GetDayAndHoursDetailsRequest extends Request { + public P_SELECTED_EMPLOYEE_NUMBER: string; + public P_MENU_TYPE: string; + public P_SELECTED_RESP_ID: number; + public P_SCHEDULE_DATE_FROM: DateTimeInput; + public P_SCHEDULE_DATE_TO: DateTimeInput; + public P_EXCESS_FLAG: string; + public P_TIMEBACK_FLAG: string; + public P_COMP_OFF_FLAG: string; + public P_NON_SCHEDULED_FLAG: string; + public P_LATE_IN_FLAG: string; + public P_EARLY_OUT_FLAG: string; + public P_SHORTAGE_FLAG: string; + public P_MISSING_SWIPE_FLAG: string; + public P_ANALAYZED_FLAG: string; + public P_APPR_TIMEBACK_FLAG: string; + public P_SHT_TYPE: string; + public P_ACTUAL_WOB_SEC: string; + public P_PAGE_NUM: number; + public P_PAGE_LIMIT: number; +} diff --git a/Mohem/src/app/time-card/service/models/get-day-hours-type-details.response.ts b/Mohem/src/app/time-card/service/models/get-day-hours-type-details.response.ts new file mode 100644 index 00000000..918c8435 --- /dev/null +++ b/Mohem/src/app/time-card/service/models/get-day-hours-type-details.response.ts @@ -0,0 +1,6 @@ +import { Response } from "src/app/hmg-common/services/models/response"; +import { DayHoursTypeDetailsList } from './DayHoursTypeDetailsList'; + +export class GetDayAndHoursDetailsResponse extends Response { + public GetDayHoursTypeDetailsList: DayHoursTypeDetailsList[]; +} \ No newline at end of file diff --git a/Mohem/src/app/time-card/service/models/get-shift-detail.request.ts b/Mohem/src/app/time-card/service/models/get-shift-detail.request.ts new file mode 100644 index 00000000..84bdfc10 --- /dev/null +++ b/Mohem/src/app/time-card/service/models/get-shift-detail.request.ts @@ -0,0 +1,7 @@ +import { Request } from "src/app/hmg-common/services/models/request"; + +export class GetShiftDetailRequest extends Request { + public P_RTP_ID: number; + public P_PAGE_NUM: number; + public P_PAGE_LIMIT: number; +} diff --git a/Mohem/src/app/time-card/service/models/get-shift-detail.response.ts b/Mohem/src/app/time-card/service/models/get-shift-detail.response.ts new file mode 100644 index 00000000..9cf246a2 --- /dev/null +++ b/Mohem/src/app/time-card/service/models/get-shift-detail.response.ts @@ -0,0 +1,6 @@ +import { Response } from "src/app/hmg-common/services/models/response"; +import { ScheduleShiftsDetailsList } from "./scheduleShiftsDetailsList"; + +export class GetShiftDetailResponse extends Response { + public GetScheduleShiftsDetailsList: ScheduleShiftsDetailsList[]; +} diff --git a/Mohem/src/app/time-card/service/models/get-shift-type.response.ts b/Mohem/src/app/time-card/service/models/get-shift-type.response.ts new file mode 100644 index 00000000..9372b09c --- /dev/null +++ b/Mohem/src/app/time-card/service/models/get-shift-type.response.ts @@ -0,0 +1,5 @@ +import { Response } from "src/app/hmg-common/services/models/response"; +import { ShiftTypeList } from "./shiftTypeList"; +export class GetShiftTypeResponse extends Response { + public GetShiftTypesList: ShiftTypeList[]; +} diff --git a/Mohem/src/app/time-card/service/models/get-swipes-request.ts b/Mohem/src/app/time-card/service/models/get-swipes-request.ts new file mode 100644 index 00000000..006f16e3 --- /dev/null +++ b/Mohem/src/app/time-card/service/models/get-swipes-request.ts @@ -0,0 +1,9 @@ +import { Request } from "src/app/hmg-common/services/models/request"; +import { DateTimeInput } from "src/app/uI-elements/date-time.input"; + +export class GetSwipesRequest extends Request { + public P_SELECTED_EMPLOYEE_NUMBER: string; + public P_SCHEDULE_DATE: DateTimeInput; + public P_PAGE_NUM: number; + public P_PAGE_LIMIT: number; +} diff --git a/Mohem/src/app/time-card/service/models/get-swipes-response.ts b/Mohem/src/app/time-card/service/models/get-swipes-response.ts new file mode 100644 index 00000000..47252123 --- /dev/null +++ b/Mohem/src/app/time-card/service/models/get-swipes-response.ts @@ -0,0 +1,6 @@ +import { Response } from "src/app/hmg-common/services/models/response"; +import { SwipesList } from './swipesList'; + +export class GetSwipesResponse extends Response { + public GetSwipesList: SwipesList[]; +} diff --git a/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts b/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts new file mode 100644 index 00000000..7e5036f0 --- /dev/null +++ b/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts @@ -0,0 +1,22 @@ +import { Request } from "src/app/hmg-common/services/models/request"; +import { DateTimeInput } from "src/app/uI-elements/date-time.input"; + +export class GetTimeCardSummaryRequest extends Request { + public P_SELECTED_EMPLOYEE_NUMBER: string; + public P_MENU_TYPE: string; + public P_SELECTED_RESP_ID: number; + public P_SCHEDULE_DATE_FROM: DateTimeInput; + public P_SCHEDULE_DATE_TO: DateTimeInput; + public P_EXCESS_FLAG: string; + public P_TIMEBACK_FLAG: string; + public P_COMP_OFF_FLAG: string; + public P_NON_SCHEDULED_FLAG: string; + public P_LATE_IN_FLAG: string; + public P_EARLY_OUT_FLAG: string; + public P_SHORTAGE_FLAG: string; + public P_MISSING_SWIPE_FLAG: string; + public P_ANALAYZED_FLAG: string; + public P_APPR_TIMEBACK_FLAG: string; + public P_SHT_TYPE: string; + public P_ACTUAL_WOB_SEC: string; +} diff --git a/Mohem/src/app/time-card/service/models/get-time-card-summary.response.ts b/Mohem/src/app/time-card/service/models/get-time-card-summary.response.ts new file mode 100644 index 00000000..c2f48f96 --- /dev/null +++ b/Mohem/src/app/time-card/service/models/get-time-card-summary.response.ts @@ -0,0 +1,6 @@ +import { Response } from "src/app/hmg-common/services/models/response"; +import { TimeCardSummaryList } from './timeCardSummaryList'; + +export class GetTimeCardSummaryResponse extends Response { + public GetTimeCardSummaryList: TimeCardSummaryList[]; +} \ No newline at end of file diff --git a/Mohem/src/app/time-card/service/models/scheduleShiftsDetailsList.ts b/Mohem/src/app/time-card/service/models/scheduleShiftsDetailsList.ts new file mode 100644 index 00000000..9ed56506 --- /dev/null +++ b/Mohem/src/app/time-card/service/models/scheduleShiftsDetailsList.ts @@ -0,0 +1,32 @@ +export class ScheduleShiftsDetailsList { + public st: string; + + public RTP_ID: number; + public ASSIGNMENT_ID: number; + public RTP_SCHEDULE_ID: number; + public SCHEDULE_DATE: Date; + public SEQ_NO: number; + public SHT_NAME: string; + public SHT_CODE: string; + public SHT_TYPE: string; + public SHT_TYPE_DESC: string; + public BREAK_NAME: string; + public ACTUAL_WOB_HRS: string; + public SHT_ACTUAL_START_DATETIME: string; + public SHT_ACTUAL_START_TIME: string; + public SHT_ACTUAL_END_DATETIME: string; + public SHT_ACTUAL_END_TIME: string; + public APPROVED_START_DATETIME: string; + public APPROVED_START_TIME: string; + public APPROVED_START_REASON: string; + public APPROVED_START_REASON_DESC: string; + public APPROVED_END_DATETIME: string; + public APPROVED_END_TIME: string; + public APPROVED_END_REASON: string; + public APPROVED_END_REASON_DESC: string; + public SHT_ACTUAL_HRS: string; + public ROW_NUM: number; + public NO_OF_ROWS: number; + public FROM_ROW_NUM: number; + public TO_ROW_NUM: number; +} diff --git a/Mohem/src/app/time-card/service/models/shiftTypeList.ts b/Mohem/src/app/time-card/service/models/shiftTypeList.ts new file mode 100644 index 00000000..1514c671 --- /dev/null +++ b/Mohem/src/app/time-card/service/models/shiftTypeList.ts @@ -0,0 +1,4 @@ +export class ShiftTypeList { + public SHT_TYPE: string; + public SHT_TYPE_DESC: string; +} diff --git a/Mohem/src/app/time-card/service/models/swipesList.ts b/Mohem/src/app/time-card/service/models/swipesList.ts new file mode 100644 index 00000000..73a3b0f0 --- /dev/null +++ b/Mohem/src/app/time-card/service/models/swipesList.ts @@ -0,0 +1,15 @@ +export class SwipesList { + public SWIPE_DATE: number; + public SWIPE_TIME: number; + public SWIPE_STATUS: string; + public MACHINE_LOCATION: string; + public UNIT_NAME: string; + public UNIT_NUMBER: string; + public EXCLUDE_FLAG: string; + public RETURN_MESSAGE: string; + public RETURN_STATUS: string; + public NO_OF_ROWS: number; + public ROW_NUM: number; + public FROM_ROW_NUM: number; + public TO_ROW_NUM: number; +} diff --git a/Mohem/src/app/time-card/service/models/timeCardSummaryList.ts b/Mohem/src/app/time-card/service/models/timeCardSummaryList.ts new file mode 100644 index 00000000..674ee60f --- /dev/null +++ b/Mohem/src/app/time-card/service/models/timeCardSummaryList.ts @@ -0,0 +1,37 @@ +export class TimeCardSummaryList { + public ASSIGNMENT_ID: number; + public COMP_OFF_W_HRS: number; + public ATTENDED_DAYS: number; + public COMP_OFF_N_HRS: number; + public COMP_OFF_H_HRS: number; + public EXCESS_HRS: number; + public ON_CALL_HRS: number; + public LATE_IN_HRS: number; + public EARLY_OUT_HRS: number; + public UNCOVERD_SHORTAGE_HRS: number; + public DESIRED_SCHEDULED_HRS: number; + public PERIOD_DAYS: number; + public SHORTAGE_HRS: number; + public OFF_DAYS: number; + public APPROVED_TIMEBACK_HRS: number; + public TIMEBACK_HRS: number; + public PLANNED_OTHRS: number; + public ACTUAL_HRS: number; + public SCHEDULED_ON_CALL_HRS: number; + public SCHEDULED_PLANNED_OT_HRS: number; + public SCHEDULED_HRS: number; + public NOT_ANALYZED_DAYS: number; + public LEAVES_HOLIDAYS_HRS: number; + public HALF_DAY_LEAVE: number; + public UNPAID_LEAVE: number; + public PAID_LEAVE: number; + public BUSINESS_TRIP: number; + public SHORTAGE_SCHEDULE_HRS: number; + public SCHEDULE_DAYS: number; + public NON_SCHEDULE_DAYS: number; + public ABSENT_DAYS: number; + public SICK_LEAVE: number; + public UNAUTHORIZED_LEAVE: number; + public PUBLIC_HOLIDAY: number; + public TIME_BACK_BALANCE: number; +} diff --git a/Mohem/src/app/time-card/service/time-card.service.spec.ts b/Mohem/src/app/time-card/service/time-card.service.spec.ts new file mode 100644 index 00000000..28641dbd --- /dev/null +++ b/Mohem/src/app/time-card/service/time-card.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { TimeCardService } from './time-card.service'; + +describe('TimeCardService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: TimeCardService = TestBed.get(TimeCardService); + expect(service).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/time-card/service/time-card.service.ts b/Mohem/src/app/time-card/service/time-card.service.ts new file mode 100644 index 00000000..7e8f2cc3 --- /dev/null +++ b/Mohem/src/app/time-card/service/time-card.service.ts @@ -0,0 +1,104 @@ +import { Injectable } from "@angular/core"; +import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; +import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service"; +import { Request } from "src/app/hmg-common/services/models/request"; + +import { Observable } from "rxjs"; +import { GetShiftTypeResponse } from "./models/get-shift-type.response"; +import { GetDayAndHoursDetailsResponse } from "./models/get-day-hours-type-details.response"; +import { GetTimeCardSummaryResponse } from "./models/get-time-card-summary.response"; +import { GetShiftDetailResponse } from "./models/get-shift-detail.response"; +import { GetSwipesResponse } from "./models/get-swipes-response"; + +@Injectable({ + providedIn: "root" +}) +export class TimeCardService { + public static getShiftTypeUrl = "Services/ERP.svc/REST/GET_SHIFT_TYPES"; + public static getTimeCardSummaryUrl = + "Services/ERP.svc/REST/GET_TIME_CARD_SUMMARY"; + public static getDayHourDetailsUrl = + "Services/ERP.svc/REST/GET_DAY_HOURS_TYPE_DETAILS"; + public static getShiftDetailUrl = + "Services/ERP.svc/REST/GET_SCHEDULE_SHIFTS_DETAILS"; + public static getSwipeUrl = "Services/ERP.svc/REST/GET_SWIPES"; + + constructor( + public con: ConnectorService, + private authService: AuthenticationService + ) {} + + public getShiftType( + onError?: any, + errorLabel?: string + ): Observable { + const request = new Request(); + this.authService.authenticateRequest(request); + return this.con.post( + TimeCardService.getShiftTypeUrl, + request, + onError, + errorLabel + ); + } + + public getTimeCardSummary( + timeCardSummaryReq, + onError?: any, + errorLabel?: string + ): Observable { + const request = timeCardSummaryReq; + this.authService.authenticateRequest(request); + return this.con.post( + TimeCardService.getTimeCardSummaryUrl, + request, + onError, + errorLabel + ); + } + + public getDayHoursTypeDetails( + dayHoursDetailsReq, + onError?: any, + errorLabel?: string + ): Observable { + const request = dayHoursDetailsReq; + this.authService.authenticateRequest(request); + return this.con.post( + TimeCardService.getDayHourDetailsUrl, + request, + onError, + errorLabel + ); + } + + public getShiftDetail( + shiftDetailReq, + onError?: any, + errorLabel?: string + ): Observable { + const request = shiftDetailReq; + this.authService.authenticateRequest(request); + return this.con.post( + TimeCardService.getShiftDetailUrl, + request, + onError, + errorLabel + ); + } + + public getSwipes( + getSwipeReq, + onError?: any, + errorLabel?: string + ): Observable { + const request = getSwipeReq; + this.authService.authenticateRequest(request); + return this.con.post( + TimeCardService.getSwipeUrl, + request, + onError, + errorLabel + ); + } +} diff --git a/Mohem/src/app/time-card/time-card.module.ts b/Mohem/src/app/time-card/time-card.module.ts new file mode 100644 index 00000000..4e1ae971 --- /dev/null +++ b/Mohem/src/app/time-card/time-card.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 { TimeCardPage } from './time-card.page'; + +const routes: Routes = [ + { + path: '', + component: TimeCardPage + } +]; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + RouterModule.forChild(routes) + ], + declarations: [TimeCardPage] +}) +export class TimeCardPageModule {} diff --git a/Mohem/src/app/time-card/time-card.page.html b/Mohem/src/app/time-card/time-card.page.html new file mode 100644 index 00000000..5a318c63 --- /dev/null +++ b/Mohem/src/app/time-card/time-card.page.html @@ -0,0 +1,9 @@ + + + time-card + + + + + + diff --git a/Mohem/src/app/time-card/time-card.page.scss b/Mohem/src/app/time-card/time-card.page.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/time-card/time-card.page.spec.ts b/Mohem/src/app/time-card/time-card.page.spec.ts new file mode 100644 index 00000000..c2ac9d5e --- /dev/null +++ b/Mohem/src/app/time-card/time-card.page.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TimeCardPage } from './time-card.page'; + +describe('TimeCardPage', () => { + let component: TimeCardPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TimeCardPage ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TimeCardPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/time-card/time-card.page.ts b/Mohem/src/app/time-card/time-card.page.ts new file mode 100644 index 00000000..8ea81f5d --- /dev/null +++ b/Mohem/src/app/time-card/time-card.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-time-card', + templateUrl: './time-card.page.html', + styleUrls: ['./time-card.page.scss'], +}) +export class TimeCardPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/app document/phase 2 documents/.~lock.ESS API Integration V 0 34.doc# b/app document/phase 2 documents/.~lock.ESS API Integration V 0 34.doc# new file mode 100644 index 00000000..a07d115e --- /dev/null +++ b/app document/phase 2 documents/.~lock.ESS API Integration V 0 34.doc# @@ -0,0 +1 @@ +,HMG/Mohamed.Mekawy,CS-1F-MOHAMED,24.10.2019 14:24,file:///C:/Users/mohamed.mekawy/AppData/Roaming/LibreOffice/4; \ No newline at end of file