/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package clips.delegate.service;
import beans.service.MoneyTransactionBean;
import beans.service.MoneyTransactionBeanRemote;
import cli_fmw.delegate.directory.complex.DirectoryLocator;
import clips.delegate.DEC.DECServiceRender;
import cli_fmw.delegate.DelegateLine2;
import cli_fmw.main.ClipsException;
import clips.delegate.directory.ro.DirectoryCollaborator;
import clips.delegate.directory.ro.DirectoryCollaboratorItem;
import beans.service.MoneyTransactionDetails;
import cli_fmw.delegate.AuditListener;
import java.util.Date;
/**
*
* @author lacoste
*/
public class MoneyTransactionLocal
extends DelegateLine2<MoneyTransactionBeanRemote, MoneyTransactionDetails> {
private DECServiceRender serviceRender = new DECServiceRender(this, "информацию об услуге, по которой произведена денежная операция", getAuditListener());
public MoneyTransactionLocal(int id, AuditListener al) throws ClipsException {
super(id, al);
}
public MoneyTransactionLocal(SerRenLocal sr) throws ClipsException {
super(sr.getAuditListener());
serviceRender.initBy(sr);
}
public MoneyTransactionLocal(SerRenLocal sr, MoneyTransactionDetails details) throws ClipsException {
super(details, sr.getAuditListener());
serviceRender.initBy(sr);
}
@Override
protected MoneyTransactionDetails getNewDetails() {
return new MoneyTransactionDetails();
}
public DirectoryCollaboratorItem getCollaborator() throws ClipsException {
DirectoryCollaborator dir = DirectoryLocator.getDirectory(DirectoryCollaborator.class, false);
return dir.getItemFromID(getDetails().collaboratorID);
}
public void setCollaborator(DirectoryCollaboratorItem collaborator) throws ClipsException {
getDetails().collaboratorID = collaborator.getID();
fireContentStateEvent();
}
public Date getDate() throws ClipsException {
return getDetails().date;
}
public void setDate(Date date) throws ClipsException {
getDetails().date = date;
fireContentStateEvent();
}
public String getDescription() throws ClipsException {
return getDetails().description;
}
public void setDescription(String desc) throws ClipsException {
getDetails().description = desc;
fireContentStateEvent();
}
public int getMoney() throws ClipsException {
return getDetails().money;
}
public void setMoney(int money) throws ClipsException {
getDetails().money = money;
fireContentStateEvent();
}
public boolean getPermitted() throws ClipsException {
return getDetails().permitted;
}
public void setPermitted(boolean permitted) throws ClipsException {
getDetails().permitted = permitted;
fireContentStateEvent();
}
@Override
protected String getBeanName() {
return MoneyTransactionBean.class.getSimpleName();
}
}