73 lines
3 KiB
Java
73 lines
3 KiB
Java
|
|
package it.acxent.contab.servlet;
|
||
|
|
|
||
|
|
import it.acxent.contab.CausaleContabile;
|
||
|
|
import it.acxent.contab.CausaleContabileCR;
|
||
|
|
import it.acxent.contab.RigaCausaleContabile;
|
||
|
|
import it.acxent.db.CRAdapter;
|
||
|
|
import it.acxent.db.DBAdapter;
|
||
|
|
import it.acxent.db.ResParm;
|
||
|
|
import it.acxent.servlet.AblServletSvlt;
|
||
|
|
import javax.servlet.annotation.WebServlet;
|
||
|
|
import javax.servlet.http.HttpServletRequest;
|
||
|
|
import javax.servlet.http.HttpServletResponse;
|
||
|
|
|
||
|
|
@WebServlet(urlPatterns = {"/admin/contabConfig/CausaleContabile.abl"})
|
||
|
|
public class CausaleContabileSvlt extends AblServletSvlt {
|
||
|
|
private static final long serialVersionUID = -442960013744440571L;
|
||
|
|
|
||
|
|
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {
|
||
|
|
CausaleContabile bbean = (CausaleContabile)bean;
|
||
|
|
req.setAttribute("list", new RigaCausaleContabile(getApFull(req)).findByCausaleContabile(bbean.getId_causaleContabile()));
|
||
|
|
}
|
||
|
|
|
||
|
|
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||
|
|
|
||
|
|
protected DBAdapter getBean(HttpServletRequest req) {
|
||
|
|
return new CausaleContabile(getApFull(req));
|
||
|
|
}
|
||
|
|
|
||
|
|
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||
|
|
return new CausaleContabileCR(getApFull(req));
|
||
|
|
}
|
||
|
|
|
||
|
|
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||
|
|
super.prepareNewRecord(req, res);
|
||
|
|
}
|
||
|
|
|
||
|
|
public void _addConto(HttpServletRequest req, HttpServletResponse res) {
|
||
|
|
long id_causaleContabile = getRequestLongParameter(req, "id_causaleContabile");
|
||
|
|
long id_rigaCausaleContabile = getRequestLongParameter(req, "id_rigaCausaleContabile");
|
||
|
|
ResParm rp = new ResParm(true);
|
||
|
|
CausaleContabile bean = new CausaleContabile(getApFull(req));
|
||
|
|
bean.findByPrimaryKey(id_causaleContabile);
|
||
|
|
fillObject(req, bean);
|
||
|
|
rp = bean.save();
|
||
|
|
if (rp.getStatus()) {
|
||
|
|
RigaCausaleContabile rBean = new RigaCausaleContabile(getApFull(req));
|
||
|
|
rBean.findByPrimaryKey(id_rigaCausaleContabile);
|
||
|
|
fillObject(req, rBean);
|
||
|
|
rBean.setId_causaleContabile(bean.getId_causaleContabile());
|
||
|
|
rBean.save();
|
||
|
|
}
|
||
|
|
req.setAttribute("id_causaleContabile", Long.valueOf(bean.getId_causaleContabile()));
|
||
|
|
sendMessage(req, rp.getMsg());
|
||
|
|
showBean(req, res);
|
||
|
|
}
|
||
|
|
|
||
|
|
public void _modConto(HttpServletRequest req, HttpServletResponse res) {
|
||
|
|
long id_rigaCausaleContabile = getRequestLongParameter(req, "id_rigaCausaleContabile");
|
||
|
|
RigaCausaleContabile riga = new RigaCausaleContabile(getApFull(req));
|
||
|
|
riga.findByPrimaryKey(id_rigaCausaleContabile);
|
||
|
|
req.setAttribute("bean2", riga);
|
||
|
|
showBean(req, res);
|
||
|
|
}
|
||
|
|
|
||
|
|
public void _delConto(HttpServletRequest req, HttpServletResponse res) {
|
||
|
|
long id_rigaCausaleContabile = getRequestLongParameter(req, "id_rigaCausaleContabile");
|
||
|
|
RigaCausaleContabile riga = new RigaCausaleContabile(getApFull(req));
|
||
|
|
riga.findByPrimaryKey(id_rigaCausaleContabile);
|
||
|
|
ResParm rp = riga.delete();
|
||
|
|
sendMessage(req, rp.getMsg());
|
||
|
|
showBean(req, res);
|
||
|
|
}
|
||
|
|
}
|