Package pl.zgora.uz.wmie.fe.sps.business.service

Examples of pl.zgora.uz.wmie.fe.sps.business.service.OfferService


  @Override
  public DataResult tableAjax(Map<String, String> filters,
      String[] projections, String columnOrder, String columnOrderDir,
      int startIndex) throws Exception {
    OfferService offerService = (OfferService) BusinessUtil
        .findBusiness("OfferService");

    ProjectionList projectionList = Projections.projectionList();
    for (int i = 0; i < projections.length; i++) {
      projectionList.add(Projections.property(projections[i]));
    }
    List<Criterion> criterions = new ArrayList<Criterion>();

    FiltersUtil filtersUtil = new FiltersUtil();
    criterions = filtersUtil
        .createCriteriaFromFilters(filters, Offer.class);

    List<Order> orders = null;
    // stala czesc sluzaca sortowaniu
    if (columnOrder.compareTo("null") != 0) {
      orders = new ArrayList<Order>();
      if (columnOrderDir.compareTo("desc") == 0) {
        orders.add(Order.desc(columnOrder));
      } else {
        orders.add(Order.asc(columnOrder));
      }
    }

    startIndex = (startIndex - 1) * ROW_AMOUNT;
    DataResult dataResult = offerService.findByParams(projectionList,
        criterions, orders, startIndex, ROW_AMOUNT);
    return dataResult;
  }
View Full Code Here


import pl.zgora.uz.wmie.fe.sps.business.service.OfferService;
import pl.zgora.uz.wmie.fe.sps.business.util.BusinessUtil;

public class OfferAjaxAction {
  public void deleteSelectedAcademy(Integer id) throws Exception {
    OfferService offerService = (OfferService) BusinessUtil
        .findBusiness("OfferService");
    offerService.deleteById(id);
  }
View Full Code Here

  protected void service(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    String targetPage = null;
    String method = getInitParameter("method");

    OfferService offerService=null;
    try {
      offerService = (OfferService) BusinessUtil
        .findBusiness("OfferService");
    } catch (Exception e2) {
      e2.printStackTrace();
    }
   
   
    if (TABLE_ACTION.equals(method)) {
      targetPage = getInitParameter("page");
    } else if (PRE_ADD_ACTION.equals(method)) {
      //prepareDataForSelect(req); 
      targetPage = "/pages/offer/offerForm.jsp";
   
    } else if (DETAILS.equals(method)) {
      try {
        //TODO offerGuardian
       
        //prepareDataForSelect(req);
        Offer offer = offerService.load(Integer.valueOf(req.getParameter("id")));
        OfferGuardianService offerGuardianService=(OfferGuardianService) BusinessUtil
                    .findBusiness("OfferGuardianService");;
        if (offer.getOfferGuardian()!=null) {
          OfferGuardian guardian=offerGuardianService.load(offer.getOfferGuardian().getIdOfferGuardian());
          req.setAttribute("guardian", guardian.getFirstName()+" "+guardian.getLastName());
View Full Code Here

TOP

Related Classes of pl.zgora.uz.wmie.fe.sps.business.service.OfferService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.