MAObjDetailsPageCO

package xxcus.oracle.apps.per.selfservice.appraisals.webui;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.per.selfservice.appraisals.webui.MAObjDetailsPageCO;

public class MAObjDetailsPageCOEx extends MAObjDetailsPageCO {
    public MAObjDetailsPageCOEx() {
    }
    public void processFormRequest(OAPageContext pc, OAWebBean wb) {
        if ((pc.getParameter("Apply") != null || pc.getParameter("UpdNext") != null || pc.getParameter("Save") != null)
            && pc.getParameter("Performance") != null && pc.getParameter("Performance") != "")
        {
            String rating = pc.getParameter("Performance");
            String sql = "Select step_value from PER_RATING_LEVELS_VL where rating_level_id =" + rating;
            String display_val = null;
            try {
                    Connection conn = pc.getApplicationModule(wb).getOADBTransaction().getJdbcConnection();
                    PreparedStatement ps = conn.prepareStatement(sql);
                    ResultSet rs = ps.executeQuery();
                    rs.next();
                    display_val = rs.getString(1).trim();
                }
                catch (Exception e) {
                    e.printStackTrace();
                }

                if (display_val.equals("1") || display_val.equals("2"))
                {
                    if (pc.getParameter("PerfComments").trim().equals(null) || pc.getParameter("PerfComments") == "")
                    {
                        throw new OAException("Comments is mandatory !", OAException.ERROR);
                    }
                }
        }
        super.processFormRequest(pc,wb);
    }   
   
}

No comments:

Post a Comment