package p2.application.tagents;

import baseclass.DataBeanCust;
import p2.pao.PaoSet;
import p2.util.P2AppException;
import p2.util.P2Exception;
import p2.application.tenterprise.tenterprise;

public class tagentsDataBean extends DataBeanCust {
    @Override
    public int ADDROW() throws P2Exception {
        return super.ADDROW();
    }

    @Override
    public int TOGGLEDELETEROW() throws P2Exception {
        return super.TOGGLEDELETEROW();
    }

    //生成默认收款记录
    public int CREATEPAYINFO() throws P2Exception {

        if (dialogIsNotOpen()) {
            dialogOpen("对勾选的经销商生成一个今日生效且有效期为1年的付款记录？");
        }
        if (dialogIsCheckOk()) {
            tenterprise tenterprise = (tenterprise) (parent.getPao());
            tenterprise.createdefaultpayinfovalidate();
            tenterprise.createdefaultpayinfo();
            parent.save();
            ((PaoSet) getPaoSet()).addWarning(new P2AppException("", "付款记录已生成"));
        }
        byrefresh();
        return 1;
    }

}
