netadsubscriptionreport.component.ts
4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
//import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/Rx';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/filter';
import { NetAdSubscriptionReports } from '../Reports/reportdatamodel';
import { ReportService } from '../Reports/report.service';
import { GlobalService } from '../../Shared/global';
import { BsModalService } from 'ngx-bootstrap/modal';
import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
import { DatePipe } from '@angular/common';
import { BsDatepickerModule } from 'ngx-bootstrap';
import { Http, Response } from '@angular/http';
declare var $: any;
@Component({
templateUrl: './netadsubscriptionreport.component.html'
})
export class NetAdSubscriptionReport implements OnInit {
public lstNetAdSubscriptionReport: any;
public lstLicenceType: any;
NetAdSubscriptionReportForm: FormGroup;
NetAdSubscriptionReports: NetAdSubscriptionReports[];
numberOfNetAdSubscriptionReport: number;
limit: number;
page: number = 1;
error;
modalAlerts: string;
divClass: string = '';
topPos: string = '2000px';
selectedRow: number = 0;
datePipe: DatePipe = new DatePipe('en-US');
bsValue1: Date = new Date();
bsValue2: Date = new Date();
selectedId: number = 0;
modalRef: BsModalRef;
date = new Date();
previousdate = new Date();
constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService) { }
ngOnInit(): void {
let NetAdSubscriptionReport = new NetAdSubscriptionReports();
this.previousdate.setDate(this.previousdate.getDate() - 365);
this.NetAdSubscriptionReportForm = this.fb.group({
sFromDate: [this.previousdate],
sToDate: [this.date],
iLicenseTypeId: [0],
iStartPrice: [0],
iEndPrice: [0],
});
this.GetLicenceType();
//this.GetSubscriptionReport();
$('#fixed_hdr2').fxdHdrCol({
fixedCols: 0,
width: "100%",
height: 300,
colModal: [
{ width: 180, align: 'center' },
{ width: 230, align: 'center' },
{ width: 150, align: 'Center' },
{ width: 150, align: 'Center' },
{ width: 350, align: 'Center' },
{ width: 500, align: 'Center' },
{ width: 130, align: 'Center' },
{ width: 120, align: 'center' },
{ width: 280, align: 'Center' },
{ width: 180, align: 'center' },
{ width: 200, align: 'center' },
{ width: 170, align: 'center' },
{ width: 80, align: 'center' },
{ width: 150, align: 'center' },
{ width: 150, align: 'center' },
{ width: 180, align: 'Center' },
//{ width: 400, align: 'Center' },
//{ width: 150, align: 'center' },
//{ width: 110, align: 'center' },
],
sort: true
});
document.getElementById("fixed_table_rc").remove();
var testScript = document.createElement("script");
testScript.setAttribute("id", "fixed_table_rc");
testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js");
testScript.setAttribute("type", "text/javascript");
document.body.appendChild(testScript);
//this.GetSubscriptionCancellationReport();
}
GetLicenceType() {
this.reportservice.GetLicenceType().subscribe(st => { this.lstLicenceType = st; }, error => this.error = <any>error);
}
GetNetAdSummaryReport(this) {
this.NewSubscription = this.NetAdSubscriptionReportForm.value;
var obj = this.NewSubscription;
this.reportservice.GetNetAdSummaryReport(obj).subscribe((NetAdSubscriptionReports: NetAdSubscriptionReports[]) => { this.lstNetAdSubscriptionReport = NetAdSubscriptionReports; this.numberOfNetAdSubscriptionReport = this.lstNetAdSubscriptionReport.length; this.limit = this.lstSubscriptionReport.length; }, error => this.error = <any>error);
}
}