package p2.application.ttype;

import baseclass.PaoCust;
import p2.pao.PaoSet;
import p2.util.P2AppException;
import p2.util.P2Exception;

public class ttype extends PaoCust {
    public ttype(PaoSet arg0) {
        super(arg0);
    }

    @Override
    public void init() throws P2Exception {
        super.init();
        if (!getPaoSet("ttypedetail").isEmpty()) {
            setFieldFlag("ftype", READONLY, true);
        }
    }

    @Override
    protected void save() throws P2Exception {
        super.save();
    }

    @Override
    public void canDelete() throws P2Exception {
        super.canDelete();
        if (!getPaoSet("ttypedetail").isEmpty()) {
            throw new P2AppException("", "以添加分类明细不可删除");
        }
    }
}
