package de.ivu.elect.presentation.kandidatur.exchange;

import javax.enterprise.inject.Specializes;
import javax.inject.Inject;

import de.ivu.elect.business.CurrentCustomer;
import de.ivu.elect.business.wahl.boundary.WahlSessionSelect;
import de.ivu.elect.business.wahl.entity.NlWahlart;

@Specializes
public class NlWahlvorschlagImportSearchView extends WahlvorschlagImportSearchView {
  private static final long serialVersionUID = 1L;

  @Inject
  private transient WahlSessionSelect wahlSessionSelect;

  @Inject
  private transient CurrentCustomer currentCustomer;

  private boolean isCsb() {
    return NlWahlart.isWasCSB(wahlSessionSelect.getEntity(), currentCustomer.getCustomer());
  }

  @Override
  public String getPageTitle() {
    if (isCsb()) {
      return getMessage("wahlvorschlag.import.page.title.csb");
    }
    return super.getPageTitle();
  }

  @Override
  public String getPageHeader() {
    if (isCsb()) {
      return getMessage("wahlvorschlag.import.page.header.csb");
    }
    return super.getPageHeader();
  }
}
