diff --git a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.html b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.html index fcbfcce3..583e139f 100644 --- a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.html +++ b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.html @@ -145,7 +145,7 @@
- +
diff --git a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts index 3971e868..844e4bc2 100644 --- a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts +++ b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts @@ -17,52 +17,52 @@ import { FileUploader } from 'ng2-file-upload'; styleUrls: ['./hr-request-form.component.scss'], }) export class HrRequestFormComponent implements OnInit { - public EmpName : string; - public EmpNum : string; - public EmpGroup : string; - public EmpMobile : string; - public EmpJob : string; - public EmpOrgName : string; - public EmpPayrol : string; - public EmpPosition : string; - public EmpEmail: string; - public EmpCatMeaning:string; - public EmpGRADENAME : string; - public EmpLocation : string; - public EmpImg : string; + public EmpName: string; + public EmpNum: string; + public EmpGroup: string; + public EmpMobile: string; + public EmpJob: string; + public EmpOrgName: string; + public EmpPayrol: string; + public EmpPosition: string; + public EmpEmail: string; + public EmpCatMeaning: string; + public EmpGRADENAME: string; + public EmpLocation: string; + public EmpImg: string; public userImage: any = '../assets/imgs/profile.png'; public loginData = new LoginModel(); public searchKeySelect = 'Complaints'; myColor: string = 'secondary'; public showRequestDetails = false; - public proID= "CS" + public proID = "CS" public inquiry: string; - public HR : string; - public complaints:string; - public Projectresult:any; - public EmpRelations:any; - public Hr:any; - public Payroll:any; - public GovRelation:any; - public projName:any; - public topicName:any; + public HR: string; + public complaints: string; + public Projectresult: any; + public EmpRelations: any; + public Hr: any; + public Payroll: any; + public GovRelation: any; + public projName: any; + public topicName: any; public departTypeList: any; - public topicTypeList:any; - public sectionTypeList:any; - public projectDetial:any; - public projectDep:any; - public sectionDep:any; + public topicTypeList: any; + public sectionTypeList: any; + public projectDetial: any; + public projectDep: any; + public sectionDep: any; public projectCode; - public SelectedServiceType:any; - public depType:any; - public secType:any; - public topicType:any; + public SelectedServiceType: any; + public depType: any; + public secType: any; + public topicType: any; indexLastObj: any; addAttachRequest: any = []; TransactionID: any; - public teckitDetial:any; - public teckitInfo:any; - public Description:any; + public teckitDetial: any; + public teckitInfo: any; + public Description: any; public selectedFile: any; filterAllowedType: any = [ "application/pdf", @@ -75,330 +75,329 @@ export class HrRequestFormComponent implements OnInit { ]; public direction: string; - constructor( - public ts: TranslatorService, - public cs: CommonService, - public authService: AuthenticationService, - public sharedData: SharedDataService, - public events: Events, - public MowadhafiService: MowadhafiService, - private location: Location, - private menu: MenuController, - - - ) { - this.direction = TranslatorService.getCurrentLanguageName(); - } + constructor( + public ts: TranslatorService, + public cs: CommonService, + public authService: AuthenticationService, + public sharedData: SharedDataService, + public events: Events, + public MowadhafiService: MowadhafiService, + private location: Location, + private menu: MenuController, + + + ) { + this.direction = TranslatorService.getCurrentLanguageName(); + } ngOnInit() { this.projectCode = this.cs.sharedService.getSharedData("projcet-code"); this.getTicketsByEmployee(); this.getTicketTypes(); this.getProject(); - this.getCreateTicket(); - - + //this.getCreateTicket(); + + } goback() { this.location.back(); - - } - - showSelectedField(){} - - getTicketTypes(){ - const request = { - EmployeeNumber:"", - - }; - this.MowadhafiService.getTicketTypes(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> - { - this.handlegetTicketTypesResult(result); - - }) } - handlegetTicketTypesResult(result){ - this.HR = result.Mohemm_Itg_TicketTypesList[0].typeName; - this.complaints = result.Mohemm_Itg_TicketTypesList[1].typeName; - this.inquiry = result.Mohemm_Itg_TicketTypesList[2].typeName; - } - - -getProject(){ - const request = { - EmployeeNumber:"", - ItgProjectCode: this.projectCode - - }; - this.MowadhafiService.getProject(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> - { - this.handlegetProjectResult(result); - - }) } - handlegetProjectResult(result){ - this.Projectresult=result.Mohemm_Itg_ProjectsList; - this.getProjectDepartments(); - } - - -getProjectDepartments(){ - const request = { - EmployeeNumber:"", - ItgProjectId:this.Projectresult[0].projectId, - - - }; - this.MowadhafiService.getProjectDepartments(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> - { - this.handlegetProjectDepartmentsResult(result); - - }) } - handlegetProjectDepartmentsResult(result){ - this.departTypeList= result.Mohemm_ITG_ProjectDepartmentsList; - this.getDepartmentSections(); - - } - -getDepartmentSections(){ - const request = { - EmployeeNumber:"", - ItgProjectDepartmentId:this.departTypeList.projectDepartmentId, - - - }; - this.MowadhafiService.getDepartmentSections(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> - { - this.handlegetDepartmentSectionsResult(result); - - }) } - handlegetDepartmentSectionsResult(result){ - this.sectionTypeList= result.Mohemm_ITG_DepartmentSectionsList; - - this.getSectionTopics(); - } - -getSectionTopics(){ - const request = { - EmployeeNumber:"", - ItgDepartmentSectionId:this.sectionTypeList.departmentSectionId, - - }; - this.MowadhafiService.getSectionTopics(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> - { - this.handlegetSectionTopicsResult(result); - - }) } - handlegetSectionTopicsResult(result){ - // this.topicName=result.Mohemm_ITG_SectionTopicsList[0].topicName - this.topicTypeList= result.Mohemm_ITG_SectionTopicsList; - - - } - - - - // getTicketDetails(){ - // const request = { - // EmployeeNumber:'', - // ItgTicketId:this.teckitDetial.ticketId, - - // }; - // this.MowadhafiService.getTicketDetails(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> - // { - // this.handlegetTicketDetailsResult(result); - - // }) } - // handlegetTicketDetailsResult(result){ - - // let res; - // if(this.cs.validResponse(result)){ - // res = JSON.parse(result.Mohemm_ITG_ResponseItem); - // console.log(res); - // this.teckitInfo = res.result.data; - - // } - - // } - - getTicketsByEmployee() { - const request = { - // TokenID:"xxx", - EmployeeNumber: "", - ItgPageSize: 10, - ItgPageNo: 1 - - }; - this.MowadhafiService.getTicketsByEmployee(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { - this.handlegetTicketsByEmployeeResult(result); - - }) - } - - handlegetTicketsByEmployeeResult(result){ - let x; - if(this.cs.validResponse(result)){ - x = JSON.parse(result.Mohemm_ITG_ResponseItem); - console.log(x); - this.teckitInfo=x.result.data; - // for (let i = 0; i < this.ticketsInfo.length; i++) { - // console.log(i + ' : ' + this.ticketsInfo[i].ticketTypeName) - - // } - console.log("getTicketsByEmployee()-------------------------------------------------------"); - console.log(this.teckitInfo); - console.log("Type Id" + this.teckitInfo[0].ticketTypeId); - - } + + } + + showSelectedField() { } + + getTicketTypes() { + const request = { + EmployeeNumber: "", + + }; + this.MowadhafiService.getTicketTypes(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.handlegetTicketTypesResult(result); + + }) + } + handlegetTicketTypesResult(result) { + this.HR = result.Mohemm_Itg_TicketTypesList[0].typeName; + this.complaints = result.Mohemm_Itg_TicketTypesList[1].typeName; + this.inquiry = result.Mohemm_Itg_TicketTypesList[2].typeName; + } + + + getProject() { + const request = { + EmployeeNumber: "", + ItgProjectCode: this.projectCode + + }; + this.MowadhafiService.getProject(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.handlegetProjectResult(result); + + }) + } + handlegetProjectResult(result) { + this.Projectresult = result.Mohemm_Itg_ProjectsList; + this.getProjectDepartments(); + } + + + getProjectDepartments() { + const request = { + EmployeeNumber: "", + ItgProjectId: this.Projectresult[0].projectId, + + + }; + this.MowadhafiService.getProjectDepartments(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.handlegetProjectDepartmentsResult(result); + + }) + } + handlegetProjectDepartmentsResult(result) { + this.departTypeList = result.Mohemm_ITG_ProjectDepartmentsList; + this.getDepartmentSections(); + + } + + getDepartmentSections() { + const request = { + EmployeeNumber: "", + ItgProjectDepartmentId: this.departTypeList.projectDepartmentId, + + + }; + this.MowadhafiService.getDepartmentSections(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.handlegetDepartmentSectionsResult(result); + + }) + } + handlegetDepartmentSectionsResult(result) { + this.sectionTypeList = result.Mohemm_ITG_DepartmentSectionsList; + + this.getSectionTopics(); + } + + getSectionTopics() { + const request = { + EmployeeNumber: "", + ItgDepartmentSectionId: this.sectionTypeList.departmentSectionId, + + }; + this.MowadhafiService.getSectionTopics(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.handlegetSectionTopicsResult(result); + + }) + } + handlegetSectionTopicsResult(result) { + // this.topicName=result.Mohemm_ITG_SectionTopicsList[0].topicName + this.topicTypeList = result.Mohemm_ITG_SectionTopicsList; + + + } + + + + // getTicketDetails(){ + // const request = { + // EmployeeNumber:'', + // ItgTicketId:this.teckitDetial.ticketId, + + // }; + // this.MowadhafiService.getTicketDetails(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> + // { + // this.handlegetTicketDetailsResult(result); + + // }) } + // handlegetTicketDetailsResult(result){ + + // let res; + // if(this.cs.validResponse(result)){ + // res = JSON.parse(result.Mohemm_ITG_ResponseItem); + // console.log(res); + // this.teckitInfo = res.result.data; + + // } + + // } + + getTicketsByEmployee() { + const request = { + // TokenID:"xxx", + EmployeeNumber: "", + ItgPageSize: 10, + ItgPageNo: 1 + + }; + this.MowadhafiService.getTicketsByEmployee(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.handlegetTicketsByEmployeeResult(result); + + }) + } + + handlegetTicketsByEmployeeResult(result) { + let x; + if (this.cs.validResponse(result)) { + x = JSON.parse(result.Mohemm_ITG_ResponseItem); + console.log(x); + this.teckitInfo = x.result.data; + // for (let i = 0; i < this.ticketsInfo.length; i++) { + // console.log(i + ' : ' + this.ticketsInfo[i].ticketTypeName) + + // } + console.log("getTicketsByEmployee()-------------------------------------------------------"); + console.log(this.teckitInfo); + console.log("Type Id" + this.teckitInfo[0].ticketTypeId); + } + } - getCreateTicket(){ - // const request = { - // // EmployeeNumber:"", - // // ticketTypeId:this.teckitInfo[0].ticketTypeId, - // // projectId:this.teckitInfo[0].projectId, - // // departmentId:this.teckitInfo[0].departmentId, - // // sectionId:this.teckitInfo[0].sectionId, - // // sectionTopicId:this.teckitInfo[0].topicId, - // // description:this.teckitInfo[0].description, - // // fileColl:this. - // // employeeNumber:this.teckitInfo[0].employeeNumber, - // // ticketStatus:this.teckitInfo[0].ticketStatusName, - - - - // // channelId:this.teckitInfo.channelId, - - - - // }; - var request = new FormData(); - request.append('EmployeeNumber',"" ); - - request.append('ticketTypeId', this.teckitInfo[0].ticketTypeId ); - request.append('projectId',this.teckitInfo[0].projectId); - request.append('departmentId',this.teckitInfo[0].departmentId ); - request.append('sectionId',this. teckitInfo[0].sectionId ); - request.append('sectionTopicId', this.teckitInfo[0].topicId ); - request.append('description',this.teckitInfo[0].description ); - request.append('fileColl',this.selectedFile[0],this.selectedFile[0].name ); - request.append('employeeNumber',this.teckitInfo[0].employeeNumber ); - request.append('ticketStatus',this.teckitInfo[0].ticketStatusName ); - - - //request.append('file', this.uploadForm.get('profile').value); - - - - this.MowadhafiService.getCreateTicket(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> - { - this.handlegetCreateTicketResult(result); - - }) } - handlegetCreateTicketResult(result){ - - - } - - - - - -public cancelRequest() { - this.cs.openMyRequestPage(); - // this.menu.toggle(); -} + getCreateTicket() { + // const request = { + // // EmployeeNumber:"", + // // ticketTypeId:this.teckitInfo[0].ticketTypeId, + // // projectId:this.teckitInfo[0].projectId, + // // departmentId:this.teckitInfo[0].departmentId, + // // sectionId:this.teckitInfo[0].sectionId, + // // sectionTopicId:this.teckitInfo[0].topicId, + // // description:this.teckitInfo[0].description, + // // fileColl:this. + // // employeeNumber:this.teckitInfo[0].employeeNumber, + // // ticketStatus:this.teckitInfo[0].ticketStatusName, -/*******************Add attchement Functions*************/ -public uploader: FileUploader = new FileUploader({ - allowedMimeType: [ - "application/pdf", - "image/jpeg", - "image/png", - "text/plain", - "image/jpg", - "application/vnd.ms-excel", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" - ], - maxFileSize: 10 * 1024 * 1024, - formatDataFunctionIsAsync: true, - formatDataFunction: async item => { - return new Promise((resolve, reject) => { - resolve({ - name: item._file.name, - length: item._file.size, - contentType: item._file.type, - date: new Date() - }); - }); + + // // channelId:this.teckitInfo.channelId, + + + + // }; + var request = new FormData(); + + request.append('ticketTypeId', '1'); + request.append('projectId', '11'); + request.append('departmentId', '1'); + request.append('sectionId', '1'); + request.append('sectionTopicId', '1'); + request.append('description', this.Description); + //request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name); + request.append('employeeNumber', '13777'); + request.append('ticketStatus', 'new'); + request.append('channel', '31'); + + //request.append('file', this.uploadForm.get('profile').value); + + + + this.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.handlegetCreateTicketResult(result); + + }) } -}); + handlegetCreateTicketResult(result) { -onFileSelectedclick(event){ - //event.target.value = ''; - this.selectedFile = event; -} + } -onFileSelected(input) { - if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) { - let msg: string = ""; - msg = this.ts.trPK("general", "noFileSelect"); - this.cs.presentAlert(msg); - return; - } // todo: show alert that you tried uploading wrong files - else { - const file = input.target.files[0]; - // console.log(file); - this.getBase64(file).then(data => - this.pushObject(data, file.name, file.type) - ); + + public cancelRequest() { + this.cs.openMyRequestPage(); + // this.menu.toggle(); } -} -getBase64(file) { - return new Promise((resolve, reject) => { - const reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = () => resolve(reader.result); - reader.onerror = error => reject(error); + /*******************Add attchement Functions*************/ + public uploader: FileUploader = new FileUploader({ + allowedMimeType: [ + "application/pdf", + "image/jpeg", + "image/png", + "text/plain", + "image/jpg", + "application/vnd.ms-excel", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + maxFileSize: 10 * 1024 * 1024, + formatDataFunctionIsAsync: true, + formatDataFunction: async item => { + return new Promise((resolve, reject) => { + resolve({ + name: item._file.name, + length: item._file.size, + contentType: item._file.type, + date: new Date() + }); + }); + } }); -} -pushObject(fileData, name, type) { - // console.log("before push: "+ this.index); - this.indexLastObj++; - try { - let array = name.split("."); - let attachType: string = array[array.length - 1]; - - this.addAttachRequest.push({ - AttachmentID: this.indexLastObj, - P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1], - P_FILE_DATA: fileData.split(",")[1], - P_FILE_NAME: name, //.split('.')[0], - P_TRANSACTION_ID: this.TransactionID + + // onFileSelected(event) { + // //event.target.value = ''; + // this.selectedFile = event; + // } + + + onFileSelected(input) { + if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) { + let msg: string = ""; + msg = this.ts.trPK("general", "noFileSelect"); + this.cs.presentAlert(msg); + return; + } // todo: show alert that you tried uploading wrong files + else { + const file = input.target.files[0]; + this.selectedFile = input.target.files; + // console.log(file); + + this.getBase64(file).then(data => + this.pushObject(data, file.name, file.type) + ); + } + } + + + getBase64(file) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); }); - } catch (e) {} -} + } -removeFile(objectitem) { - let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem); - this.uploader.queue.splice(objIndex1, 1); - let objIndex = this.addAttachRequest.findIndex( - item => item.AttachmentID == objectitem.AttachmentID - ); - this.addAttachRequest.splice(objIndex, 1); -} + pushObject(fileData, name, type) { + // console.log("before push: "+ this.index); + this.indexLastObj++; + try { + let array = name.split("."); + let attachType: string = array[array.length - 1]; + + this.addAttachRequest.push({ + AttachmentID: this.indexLastObj, + P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1], + P_FILE_DATA: fileData.split(",")[1], + P_FILE_NAME: name, //.split('.')[0], + P_TRANSACTION_ID: this.TransactionID + }); + } catch (e) { } + } + + removeFile(objectitem) { + let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem); + this.uploader.queue.splice(objIndex1, 1); + let objIndex = this.addAttachRequest.findIndex( + item => item.AttachmentID == objectitem.AttachmentID + ); + this.addAttachRequest.splice(objIndex, 1); + } -submitRequest(){ + submitRequest() { -} + } } diff --git a/Mohem/src/app/mowadhafi/mowadhafi.service.ts b/Mohem/src/app/mowadhafi/mowadhafi.service.ts index aec9838f..e56485b3 100644 --- a/Mohem/src/app/mowadhafi/mowadhafi.service.ts +++ b/Mohem/src/app/mowadhafi/mowadhafi.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; - +import { HttpClient, HttpHeaders } from '@angular/common/http'; @Injectable({ providedIn: 'root' }) @@ -9,102 +9,113 @@ export class MowadhafiService { public static EMPLOYEE_SHARED_DATA = 'employee'; public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES'; public static getSuborinateStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS'; - public static getUserInfo ='Services/ERP.svc/REST/Get_UserInformation'; - public static getTicketTypes ='Services/COCWS.svc/REST/Mohemm_ITG_GetTicketTypes'; - public static getProject ='Services/COCWS.svc/REST/Mohemm_ITG_GetProjects'; - public static getProjectDepartments ='Services/COCWS.svc/REST/Mohemm_ITG_GetProjectDepartments'; - public static getDepartmentSections ='Services/COCWS.svc/REST/Mohemm_ITG_GetDepartmentSections'; - public static getSectionTopics ='Services/COCWS.svc/REST/Mohemm_ITG_GetSectionTopics'; - public static getTicketsByEmployee ='Services/COCWS.svc/REST/Mohemm_ITG_GetTicketsByEmployee'; - public static getTicketStatisticsByEmp ='Services/COCWS.svc/REST/Mohemm_ITG_GetTicketStatisticsByEmployee'; - public static getTicketTransaction ='Services/COCWS.svc/REST/Mohemm_ITG_GetTicketTransaction'; - public static getTicketDetails ='Services/COCWS.svc/REST/Mohemm_ITG_GetTicketDetails'; + public static getUserInfo = 'Services/ERP.svc/REST/Get_UserInformation'; + public static getTicketTypes = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketTypes'; + public static getProject = 'Services/COCWS.svc/REST/Mohemm_ITG_GetProjects'; + public static getProjectDepartments = 'Services/COCWS.svc/REST/Mohemm_ITG_GetProjectDepartments'; + public static getDepartmentSections = 'Services/COCWS.svc/REST/Mohemm_ITG_GetDepartmentSections'; + public static getSectionTopics = 'Services/COCWS.svc/REST/Mohemm_ITG_GetSectionTopics'; + public static getTicketsByEmployee = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketsByEmployee'; + public static getTicketStatisticsByEmp = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketStatisticsByEmployee'; + public static getTicketTransaction = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketTransaction'; + public static getTicketDetails = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketDetails'; public static getCreateTicket = 'Services/COCWS.svc/REST/Mohemm_ITG_CreateTicket'; - + constructor( public con: ConnectorService, - private authService: AuthenticationService + private authService: AuthenticationService, + public http: HttpClient ) { } - public getEmployeeSubordinates(absence: any, onError?: any, errorLabel?: string){ + public getEmployeeSubordinates(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); return this.con.post(MowadhafiService.getMyTeam, request, onError, errorLabel); } - public getSuborinatesAttStatus(absence: any, onError?: any, errorLabel?: string){ + public getSuborinatesAttStatus(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); return this.con.post(MowadhafiService.getSuborinateStatus, request, onError, errorLabel); } - public getUserInfo(absence: any, onError?: any, errorLabel?: string){ + public getUserInfo(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); return this.con.post(MowadhafiService.getUserInfo, request, onError, errorLabel); } - public getTicketTypes(absence: any, onError?: any, errorLabel?: string){ + public getTicketTypes(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); - request.EmployeeNumber = request.P_USER_NAME; + request.EmployeeNumber = request.P_USER_NAME; console.log(request); return this.con.post(MowadhafiService.getTicketTypes, request, onError, errorLabel); } - public getProject(absence: any, onError?: any, errorLabel?: string){ + public getProject(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); - request.EmployeeNumber = request.P_USER_NAME; + request.EmployeeNumber = request.P_USER_NAME; // request.ItgProjectCode = request.projectCode; return this.con.post(MowadhafiService.getProject, request, onError, errorLabel); } - public getProjectDepartments(absence: any, onError?: any, errorLabel?: string){ + public getProjectDepartments(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); - request.EmployeeNumber = request.P_USER_NAME; + request.EmployeeNumber = request.P_USER_NAME; return this.con.post(MowadhafiService.getProjectDepartments, request, onError, errorLabel); } - public getDepartmentSections(absence: any, onError?: any, errorLabel?: string){ + public getDepartmentSections(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); - request.EmployeeNumber = request.P_USER_NAME; + request.EmployeeNumber = request.P_USER_NAME; return this.con.post(MowadhafiService.getDepartmentSections, request, onError, errorLabel); } - public getSectionTopics(absence: any, onError?: any, errorLabel?: string){ + public getSectionTopics(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); - request.EmployeeNumber = request.P_USER_NAME; + request.EmployeeNumber = request.P_USER_NAME; return this.con.post(MowadhafiService.getSectionTopics, request, onError, errorLabel); } - public getTicketsByEmployee(absence: any, onError?: any, errorLabel?: string){ + public getTicketsByEmployee(absence: any, onError?: any, errorLabel?: string) { let request = absence; this.authService.authenticateRequest(request); - request.EmployeeNumber = request.P_USER_NAME; + request.EmployeeNumber = request.P_USER_NAME; return this.con.post(MowadhafiService.getTicketsByEmployee, request, onError, errorLabel); } - public getTicketStatisticsByEmp(absence: any, onError?: any, errorLabel?: string){ + public getTicketStatisticsByEmp(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); return this.con.post(MowadhafiService.getTicketStatisticsByEmp, request, onError, errorLabel); } - public getTicketTransaction(absence: any, onError?: any, errorLabel?: string){ + public getTicketTransaction(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); request.EmployeeNumber = request.P_USER_NAME; return this.con.post(MowadhafiService.getTicketTransaction, request, onError, errorLabel); } - public getTicketDetails(absence: any, onError?: any, errorLabel?: string){ + public getTicketDetails(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); - request.EmployeeNumber = request.P_USER_NAME; + request.EmployeeNumber = request.P_USER_NAME; return this.con.post(MowadhafiService.getTicketDetails, request, onError, errorLabel); } - public getCreateTicket(absence: any, onError?: any, errorLabel?: string){ + public getCreateTicket(absence: any, onError?: any, errorLabel?: string) { const request = absence; this.authService.authenticateRequest(request); - request.EmployeeNumber = request.P_USER_NAME; - return this.con.post(MowadhafiService.getCreateTicket, request, onError, errorLabel); + request.EmployeeNumber = request.P_USER_NAME; + const HttpUploadOptions = { + headers: new HttpHeaders({ "Content-Type": "multipart/form-data", }) + } + // return this.con.post(MowadhafiService.getCreateTicket, request, onError, errorLabel); + + return this.http.post(ConnectorService.host + MowadhafiService.getCreateTicket, absence, { + reportProgress: true, + observe: 'events' + } + ) } + } \ No newline at end of file