import { Injectable } from "@angular/core"; import { HttpClient, HttpHeaders } from "@angular/common/http"; import { Config } from '../../_helpers/config.class'; import { AuthenticationService } from "../../_services/authentication.service"; import { ChequeModule } from "./cheque.module"; import { toDate } from "@angular/common/src/i18n/format_date"; @Injectable() export class ChequeService { headers: HttpHeaders = new HttpHeaders(); constructor(private http: HttpClient, _authenticationService: AuthenticationService) { this.headers.set('Content-Type', 'application/x-www-form-urlencoded'); this.headers.set('Authorization', 'Bearer ' + _authenticationService.getToken()); } public saveBankCheque(obj: any) { let fd = new FormData(); fd.append('Obj', JSON.stringify(obj)); return this.http.post(`${Config.getControllerUrl('ChequeManagement', 'SaveBankCheque')}`, fd); } public getBankList() { return this.http.post(`${Config.getControllerUrl('ChequeManagement', 'GetChequeBankList')}`, null); } public getChequeStatusesByChequeType(id: any) { return this.http.post(`${Config.getControllerUrl('ChequeManagement', 'GetChequeStatusesByChequeType')}`, { Id: id }); } public saveBankChequeTransaction(obj: any) { let fd = new FormData(); // let file = obj.Attachement; fd.append('file', obj.Attachement); obj.Attachement = ''; fd.append('Obj', JSON.stringify(obj)); console.log(fd); debugger; return this.http.post(`${Config.getControllerUrl('ChequeManagement', 'SaveBankChequeTransaction')}`, fd); } public getAlreadyUsedChequeNumbersForCheque(id) { return this.http.post(`${Config.getControllerUrl('ChequeManagement', 'GetChequeNumberByBankId')}`, { Id: id }); } public getBankChequeById(id) { return this.http.post(`${Config.getControllerUrl('ChequeManagement', 'GetBankChequeById')}`, { Id: id }); } public getChequeTransactionList(skip: number, pageSize: number, fromDate: Date, toDate: Date, flag: string, flag2: string) { return this.http.post(`${Config.getControllerUrl('ChequeManagement', 'GetChequeTransactionList')}`, { Skip: skip, PageSize: pageSize, FromDate: fromDate, Todate: toDate, Flag: flag, Flag2: flag2 }); } public getChequeTransactionById(id) { return this.http.post(`${Config.getControllerUrl('ChequeManagement', 'GetChequeTransactionById')}`, { Id: id }); } // public getEmployeeList(skip: number, pageSize: number, query: string, hfId: string, geoLvlCode: string, hfType: string, stockId: number) { // return this.http.post(, { Skip: skip, PageSize: pageSize, Query: query, HfId: hfId, GeoLvlCode: geoLvlCode, HfType: hfType, StockId: stockId }); // } }