import { Component, OnInit } from '@angular/core';
import { Validators, FormBuilder } from '@angular/forms';
import { FlexTableComponent } from '../../../../../shared/common/FlexTable.component';
import { BsModalService } from 'ngx-bootstrap/modal';

@Component({
  selector: 'app-by-course-repl-rule',
  templateUrl: './by-course-repl-rule.component.html',
  styleUrls: ['./by-course-repl-rule.component.scss']
})
export class ByCourseReplRuleComponent extends FlexTableComponent implements OnInit {

  public query = {
    query: "",
    old_rule: "",
    repl_rule: ""
  };
  QUERY_URL = "by/byCourseReplRule/page.htm";
  ADD_URL = "by/byCourseReplRule/add.htm";
  DELETE_URL= "by/byCourseReplRule/delete.htm";
  GET_URL= "by/byCourseReplRule/get.htm";
  EDIT_URL= "by/byCourseReplRule/edit.htm";

  constructor(public bsModalService: BsModalService, fb: FormBuilder) {
    super();
    this.formModel = fb.group({
      id: [null],
      old_course_num: ['', Validators.required],
      old_course_rule: ['', Validators.required],
      rule_num: [null, Validators.required],
      repl_course_num: ['', Validators.required],
      repl_course_rule: ['', Validators.required],
      repl_num: [null, Validators.required],
      remark: [null]
    });
  }

  ngOnInit() {
  }

}
