Regalamiunsorriso/decompiled-libs/www/acxent-common-1.0.1/it/acxent/cc/servlet/ResoSvlt.java

78 lines
2.6 KiB
Java

package it.acxent.cc.servlet;
import it.acxent.contab.Documento;
import it.acxent.contab.DocumentoCR;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.util.AbMessages;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ResoSvlt extends it.acxent.www.servlet.ResoSvlt {
private static final long serialVersionUID = -1875981812979270687L;
protected void fillComboAfterDetail(DBAdapter l_bean, HttpServletRequest req, HttpServletResponse res) {
Documento bean = (Documento)l_bean;
int ordineInverso = (bean.getTipoDocumento().getFlgOrdinamentoRigheStampa() == 1L) ? 1 : 0;
req.setAttribute("righeDocumento", bean.findRigheDocumento(0, 0, ordineInverso));
if (req.getAttribute("msg").equals("Lettura effettuata"))
req.setAttribute("msg", "");
}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new Documento(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new DocumentoCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected void sendMailReso(HttpServletRequest req, HttpServletResponse res) {
Documento bean = null;
ResParm rp = new ResParm(true, "");
long l_id = getRequestLongParameter(req, "id_ordine");
bean = new Documento(getApFull(req));
try {
bean.findByPrimaryKey(l_id);
rp = bean.sendResoMailMessage();
sendMessage(req, rp.getMsg());
} catch (Exception e) {
forceMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
}
showBean(req, res);
}
protected String getCRAttribute(HttpServletRequest req) {
return "CRRes";
}
protected ResParm beforeSearch(HttpServletRequest req, HttpServletResponse res) {
DocumentoCR CR = new DocumentoCR(getApFull(req));
if (getLoginUserId(req) != null)
req.setAttribute("id_users", String.valueOf(getLoginUserId(req).longValue()));
return new ResParm(true);
}
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
String cmd = getCmd(req);
if (cmd.equals("sendMailReso")) {
sendMailReso(req, res);
} else {
search(req, res);
}
}
protected String getBeanPageName(HttpServletRequest req) {
return "reso";
}
protected ResParm afterSave(DBAdapter l_bean, HttpServletRequest req, HttpServletResponse res) {
Documento bean = (Documento)l_bean;
return bean.sendResoMailMessage();
}
}