/*
* PanelClientExcemption.java
*
* Created on 23 Февраль 2008 г., 12:54
*/
package clips.userseach.clientExcemption;
import beans.user.client.facilityClient.FacilityClientChunk;
import clips.delegate.client.ClientLocal;
import cli_fmw.delegate.DelegateLine2;
import cli_fmw.delegate.directory.complex.DirectoryLocator;
import cli_fmw.main.ClipsException;
import cli_fmw.main.PageContainer;
import cli_fmw.main.PageGeneric;
import cli_fmw.main.PrintCreators;
import cli_fmw.main.Printable;
import cli_fmw.utils.table_config_states.StateSaver;
import clips.delegate.client.ClientExemptionData;
import clips.delegate.directory.simple.exemptionType.DirectoryExcemption;
import clips.delegate.directory.simple.exemptionType.DirectoryExcemptionItem;
import framework.utils.Converter;
import java.util.HashMap;
/**
*
* @author petr
*/
public class PanelClientExcemption extends PageGeneric implements Printable {
ClientLocal clientLoc;
/** Creates new form PanelClientExcemption */
public PanelClientExcemption(PageContainer container, ClientLocal cl) throws ClipsException {
super(container);
clientLoc = cl;
initComponents();
loadExcems();
StateSaver.attachTo(this);
}
private void loadExcems() throws ClipsException {
ClientExemptionData chunk = clientLoc.getExemption();
if (chunk == null) {
labExemp.setText("Нет категории льготности");
return;
}
DirectoryExcemptionItem exemp = chunk.getExemption();
if (exemp != null && exemp.getID() != 0) {
labExemp.setText(exemp != null ? exemp.toString() : "...");
}
String ss = chunk.getDocName();
if (ss != null && !ss.trim().isEmpty()) {
labDocName.setText(ss);
}
ss = chunk.getDocSN();
if (ss != null && !ss.trim().isEmpty()) {
labDocSN.setText(ss);
}
if (chunk.getGspBegin() != null) {
labGspBegin.setText(Converter.dateToString(chunk.getGspBegin()));
}
if (chunk.getGspEnd() != null) {
labGspEnd.setText(Converter.dateToString(chunk.getGspEnd()));
}
if (chunk.hasRightNSU()) {
labNsuFlag.setText("Получает");
}
else {
labNsuFlag.setText("Не получает");
}
if (chunk.getNsuBegin() != null) {
labNsuBegin.setText(Converter.dateToString(chunk.getNsuBegin()));
}
if (chunk.getNsuEnd() != null) {
labNsuEnd.setText(Converter.dateToString(chunk.getNsuEnd()));
}
if (chunk.getRegBegin() != null) {
labRegBegin.setText(Converter.dateToString(chunk.getRegBegin()));
}
if (chunk.getRegEnd() != null) {
labRegEnd.setText(Converter.dateToString(chunk.getRegEnd()));
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
pnlExcemDocInput = new javax.swing.JPanel();
tfDocEnter = new javax.swing.JTextField();
jPanel1 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jPanel4 = new javax.swing.JPanel();
labExemp = new javax.swing.JLabel();
labDocName = new javax.swing.JLabel();
labDocSN = new javax.swing.JLabel();
labGspBegin = new javax.swing.JLabel();
labGspEnd = new javax.swing.JLabel();
labNsuFlag = new javax.swing.JLabel();
labNsuBegin = new javax.swing.JLabel();
labNsuEnd = new javax.swing.JLabel();
labRegBegin = new javax.swing.JLabel();
labRegEnd = new javax.swing.JLabel();
pnlExcemDocInput.setBorder(javax.swing.BorderFactory.createTitledBorder("Введите данные документа, подтверждающего льготность"));
javax.swing.GroupLayout pnlExcemDocInputLayout = new javax.swing.GroupLayout(pnlExcemDocInput);
pnlExcemDocInput.setLayout(pnlExcemDocInputLayout);
pnlExcemDocInputLayout.setHorizontalGroup(
pnlExcemDocInputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnlExcemDocInputLayout.createSequentialGroup()
.addContainerGap()
.addComponent(tfDocEnter, javax.swing.GroupLayout.DEFAULT_SIZE, 458, Short.MAX_VALUE)
.addContainerGap())
);
pnlExcemDocInputLayout.setVerticalGroup(
pnlExcemDocInputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnlExcemDocInputLayout.createSequentialGroup()
.addComponent(tfDocEnter, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1.setLayout(new java.awt.BorderLayout(20, 0));
jPanel2.setLayout(new java.awt.GridLayout(10, 1));
jLabel1.setText("Категория гражданина, имеющего право на ГСП");
jPanel2.add(jLabel1);
jLabel2.setText("Наименование документа");
jPanel2.add(jLabel2);
jLabel3.setText("Серия и номер документа");
jPanel2.add(jLabel3);
jLabel4.setText("Дата начала действия права на ГСП");
jPanel2.add(jLabel4);
jLabel5.setText("Дата окончания действия права на ГСП");
jPanel2.add(jLabel5);
jLabel10.setText("Признак получения НСУ");
jPanel2.add(jLabel10);
jLabel6.setText("Дата начала действия права на НСУ");
jPanel2.add(jLabel6);
jLabel7.setText("Дата окончания действия права на НСУ");
jPanel2.add(jLabel7);
jLabel8.setText("Дата включения в региональный Регистр");
jPanel2.add(jLabel8);
jLabel9.setText("Дата исключения из регионального Регистра");
jPanel2.add(jLabel9);
jPanel1.add(jPanel2, java.awt.BorderLayout.LINE_START);
jPanel4.setLayout(new java.awt.GridLayout(10, 1));
labExemp.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
labExemp.setText("...");
jPanel4.add(labExemp);
labDocName.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
labDocName.setText("...");
jPanel4.add(labDocName);
labDocSN.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
labDocSN.setText("...");
jPanel4.add(labDocSN);
labGspBegin.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
labGspBegin.setText("...");
jPanel4.add(labGspBegin);
labGspEnd.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
labGspEnd.setText("...");
jPanel4.add(labGspEnd);
labNsuFlag.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
labNsuFlag.setText("...");
jPanel4.add(labNsuFlag);
labNsuBegin.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
labNsuBegin.setText("...");
jPanel4.add(labNsuBegin);
labNsuEnd.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
labNsuEnd.setText("...");
jPanel4.add(labNsuEnd);
labRegBegin.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
labRegBegin.setText("...");
jPanel4.add(labRegBegin);
labRegEnd.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
labRegEnd.setText("...");
jPanel4.add(labRegEnd);
jPanel1.add(jPanel4, java.awt.BorderLayout.CENTER);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 374, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel4;
private javax.swing.JLabel labDocName;
private javax.swing.JLabel labDocSN;
private javax.swing.JLabel labExemp;
private javax.swing.JLabel labGspBegin;
private javax.swing.JLabel labGspEnd;
private javax.swing.JLabel labNsuBegin;
private javax.swing.JLabel labNsuEnd;
private javax.swing.JLabel labNsuFlag;
private javax.swing.JLabel labRegBegin;
private javax.swing.JLabel labRegEnd;
private javax.swing.JPanel pnlExcemDocInput;
private javax.swing.JTextField tfDocEnter;
// End of variables declaration//GEN-END:variables
@Override
public String getPageTitle() {
return "Льготы: " + clientLoc.toString();
}
// Persistentable
@Override
public boolean readyForPrint() {
return true;
}
@Override
public void print() {
}
@Override
public DelegateLine2 getDelegate() {
return clientLoc;
}
}