package p2.application.tcustomer_reception;

import baseclass.PaoCust;
import p2.pao.PaoSet;
import p2.util.P2Exception;
import p2.application.tcustomer.tcustomer;

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

    @Override
    public void init() throws P2Exception {
        super.init();
    }

    @Override
    public void add() throws P2Exception {
        super.add();
        if (getOwner() instanceof tcustomer) {
            if ("TCUSTOMER_RECEPTION".equals(getThisPaoSet().getRelationName())) {
                setValue("ftype", "½Ó´ý", 11L);
            } else if ("TCUSTOMER_RECEPTION_ORDER".equals(getThisPaoSet().getRelationName())) {
                setValue("ftype", "ÏúÊÛ", 11L);
            }

            String[] fieldname = new String[]{"tcustomerid", "tagentsid", "fname", "fbirthdate", "fchannel", "fcommunity", "fnumber", "fphonenumber", "frenovationplandate", "fwechatno", "tstoreid"};
            copyFieldValue(getOwner(), fieldname, this, fieldname);
            setValue("fdate", getDate(), 11L);
        }
    }
}
