Package clips.delegate.doctor.certificate.tag.certTags

Source Code of clips.delegate.doctor.certificate.tag.certTags.CertTagJobProfession

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package clips.delegate.doctor.certificate.tag.certTags;

import clips.delegate.doctor.DiseaseLocal;
import clips.delegate.doctor.certificate.CertificateLocal;
import clips.delegate.job.JobLocal;
import clips.delegate.doctor.certificate.tag.TagToClass;
import cli_fmw.delegate.report.ReportParam;
import cli_fmw.main.ClipsException;
import clips.delegate.doctor.certificate.tag.interfaces.TypeSelectable;
import java.util.List;
import framework.utils.PairIntStr;

/**
*
* @author vip
*/
@TagToClass(tagName="job_profession", title="Место работы и профессия")
public class CertTagJobProfession extends TypeSelectable {
    int defaultid;

    public CertTagJobProfession() throws ClipsException {
    }
   
    public CertTagJobProfession(CertificateLocal certificateLocal, ReportParam reportParam, DiseaseLocal diseaseLocal) throws ClipsException {
        super(certificateLocal, reportParam, diseaseLocal);
        if (certificateLocal.isNewlyCreated()) {
            setItem(defaultid);
        }
    }

    @Override
    public void fillItems() throws ClipsException {
        if (certificateLocal == null) throw new ClipsException();
        List<JobLocal> jobList = certificateLocal.getClientLocal().getJobList();
        for (int i = 0; i < jobList.size(); i++) {
            JobLocal jobLocal = jobList.get(i);
            if (!jobLocal.isFired()) {
                if (defaultid == 0) {
                    defaultid = jobLocal.getID();
                }
                String fullTitle = jobLocal.getEnterprise().getFullTitle(false);
                fullTitle.replaceAll("\n", "");
                String profession = jobLocal.getAppointment().getTitle();
                PairIntStr pair = new PairIntStr(jobLocal.getID(), fullTitle + ", " + profession);
                allItems.add(pair);
            }
        }
    }

    @Override
    public boolean isEditable() {
        return true;
    }

    @Override
    public String getValue() throws ClipsException {
        return getText();
    }


}
TOP

Related Classes of clips.delegate.doctor.certificate.tag.certTags.CertTagJobProfession

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.