Пример #1
0
 public boolean delete(Airport airport) {
   ActionContext ctx = ActionContext.getContext();
   Integer aid = airport.getAid();
   String hql = "from Airport as airport where aid='" + aid + "'";
   List list = airportDao.findByHql(hql);
   if (list.isEmpty()) return false;
   else {
     Airport delairport = (Airport) list.get(0);
     airportDao.delete(delairport);
     return true;
   }
 }
Пример #2
0
 public boolean updateAirportByManager(Airport airport) {
   ActionContext ctx = ActionContext.getContext();
   session = (Map<String, Object>) ctx.getSession();
   Integer aid = airport.getAid();
   String hql = "from Airport as airport where aid='" + aid + "'";
   List list = airportDao.findByHql(hql);
   if (list.isEmpty()) return false;
   else {
     airport = (Airport) list.get(0);
     session.put("airport", airport);
     return true;
   }
 }
Пример #3
0
 public boolean find(Airport airport) {
   ActionContext ctx = ActionContext.getContext();
   session = (Map<String, Object>) ctx.getSession();
   String portname = airport.getPortname();
   String hql = "from Airport as airport where portname='" + portname + "'";
   List list = airportDao.findByHql(hql);
   if (list.isEmpty()) return false;
   else {
     airport = (Airport) list.get(0);
     session.put("airport", airport);
     return true;
   }
 }