import { Component, OnInit } from '@angular/core';
import { BsModalService } from 'ngx-bootstrap/modal';
import { AjaxService } from '../../../../../core/service/ajax.service';
import { FramePageComponent } from '../../../../frame/core/page/frame.page';
import { TicketDownloadReportDetailComponent } from '../ticket-download-report-detail/ticket-download-report-detail.component';

@Component({
  selector: 'app-ticket-download-report',
  templateUrl: './ticket-download-report.component.html',
  styleUrls: ['./ticket-download-report.component.scss']
})
export class TicketDownloadReportComponent extends FramePageComponent implements OnInit {

  ticketArr = [];

  constructor(private modalService: BsModalService) {
    super(modalService);
    this.goInit();
  }

  ngOnInit() {
  }

  goInit() {
    AjaxService.requestArray('enrol/report/ticket/download.htm', {}, (array) => {
      this.ticketArr = array;
    }, { RequestWithLoading: true });
  }

  showStd(downloadFlag, province_flag) {
    var entity = {
      downloadFlag: '',
      provinceFlag: ''
    };
    entity.downloadFlag = downloadFlag;
    entity.provinceFlag = province_flag;
    this.showComponentModal(TicketDownloadReportDetailComponent, {
      ResponseEntity: entity
    });
  }

}
