package com.app.hxqh.uddump;

import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXException;

import java.rmi.RemoteException;

/**
 * Áª´¢±¸¼þ×ª´¢ÉêÇë
 * createby liuxq
 */
public class UdDumpMbo extends Mbo implements MboRemote {

    public UdDumpMbo(MboSet ms) throws MXException, RemoteException {
        super(ms);
    }

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

    @Override
    public void save() throws MXException, RemoteException {
        super.save();
        String app = getThisMboSet().getApp();
    }

    @Override
    public void add() throws MXException, RemoteException {
        super.add();
        this.setValue("STATUS","EDIT",2L);//×´Ì¬
        String SITEID = getString("SITEID");
        MboSetRemote LOCATIONSSet = MXServer.getMXServer().getMboSet("LOCATIONS",MXServer.getMXServer().getSystemUserInfo());
        LOCATIONSSet.setWhere("SITEID='"+SITEID+"' AND TYPE='STOREROOM'");
        LOCATIONSSet.reset();
        if(LOCATIONSSet!=null && !LOCATIONSSet.isEmpty()){
            MboRemote LOCATIONSMbo = LOCATIONSSet.getMbo(0);
            String LOCATION = LOCATIONSMbo.getString("LOCATION");
            this.setValue("SITEKF",LOCATION,2L);//×´Ì¬
        }
    }
}
