Package clips.delegate.config

Source Code of clips.delegate.config.ConfigLocal

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

package clips.delegate.config;

import beans.config.ConfigParametr;
import cli_fmw.delegate.config.ConfigLocalAbstract;
import cli_fmw.delegate.directory.complex.DirectoryLocator;
import cli_fmw.main.ClipsException;
import clips.delegate.directory.ro.DirectoryLpuItem;
import clips.delegate.directory.simple.insurer.DirectoryInsurer;
import clips.delegate.directory.simple.insurer.DirectoryInsurerItem;
import clips.delegate.directory.simple.regionIdCode.DirectoryRegionIdCode;
import clips.delegate.directory.simple.regionIdCode.DirectoryRegionIdCodeItem;
import clips.login.UserInfo;

/**
*
* @author axe
*/
public class ConfigLocal extends
        ConfigLocalAbstract {

    private static ConfigLocal instance = null;
    private static String br = (System.getProperty("os.name").indexOf("windows") > -1) ? "\\" : "/";
    private static String printPath = System.getProperty("user.home") + br + "PrintForms";

    public static final ConfigLocal getInstance() throws ClipsException{
        if (instance == null){
            instance = new ConfigLocal();
        }
        return instance;
    }

    protected ConfigLocal() throws ClipsException {
        super();
    }

    public DirectoryRegionIdCodeItem getConfigRegionCode() throws ClipsException {
        int id = ConfigParametr.REGION_CODE_ID;
        DirectoryRegionIdCode dirRegionCode= DirectoryLocator.getDirectory(DirectoryRegionIdCode.class);
        return dirRegionCode.getItemFromID((Integer) getCode(id));
    }

    public void setConfigRegionCode(DirectoryRegionIdCodeItem regionCode) throws ClipsException {
        int id = ConfigParametr.REGION_CODE_ID;
        setCode(id, regionCode.getID());
    }

    public DirectoryInsurerItem getConfigDefaultInsurer() throws ClipsException {
        int id = ConfigParametr.DEFAULT_INSURER_ID;
        DirectoryInsurer dir= DirectoryLocator.getDirectory(DirectoryInsurer.class);
        return dir.getItemFromID((Integer) getCode(id));
    }

    public void setConfigDefaultInsurer(DirectoryInsurerItem insurer) throws ClipsException {
        int id = ConfigParametr.DEFAULT_INSURER_ID;
        setCode(id, insurer.getID());
    }

    public static String getPrintFormPath() {
        return printPath;
    }

}
TOP

Related Classes of clips.delegate.config.ConfigLocal

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.