package com.webclient.beans.udkbfl;
import java.rmi.RemoteException;

import com.ibm.tivoli.maximo.asset.ilog.controls.ILogControl;

import psdi.mbo.MboRemote;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.DataBean;
import psdi.webclient.system.controller.ControlInstance;
import psdi.webclient.system.controller.PageInstance;
import psdi.webclient.system.controller.WebClientEvent;

/**
 * ÖªÊ¶·ÖÀàÊ÷×´DataBean
 * edit 2023-10-12
 */
public class UdkbflDateBean extends DataBean {


    @Override
    public int addrow() throws MXException {
        int addrow= super.addrow();
        try {
            MboRemote mbo = this.getMbo();
            MboRemote ownerMbo=mbo.getOwner();
            mbo.setValue("PARENT", mbo.getString("FLBH"));
            mbo.setValue("HASCHILDREN", true);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        return addrow;
    }

    @Override
    public synchronized void save() throws MXException {
        super.save();
        try {
            MboRemote appMbo=app.getAppBean().getMbo();
            appMbo.getThisMboSet().save();
            app.getAppBean().reloadTable();
            app.getAppBean().refreshTable();
        } catch (RemoteException e) {
            e.printStackTrace();
        }

    }


}
