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

Examples of pl.zgora.uz.wmie.fe.service.StanowiskoService


      rd.forward(req, res);
    }
  }

  private void setTableData(HttpServletRequest req) {
    StanowiskoService stanowiskoService = null;
    try {
     
      stanowiskoService = (StanowiskoService) BusinessUtil
          .findBusiness("StanowiskoService");
      ProjectionList projectionList = Projections.projectionList();
      projectionList.add(Projections.property(Stanowisko.PROPERTY_ID));
      projectionList.add(Projections.property(Stanowisko.PROPERTY_NAZWA));



      List<Object[]> dane = stanowiskoService.findByParams(
          projectionList);
      List<Object[]> pusteDane = new ArrayList<Object[]>();
     
      req.setAttribute("daneDoTabelki", dane);
      pusteDane.add(new Object[]{"id","nazwa","typ"});
View Full Code Here


      e.printStackTrace();
    }
  }

  private void setSelectData(HttpServletRequest req) {
    StanowiskoService stanowiskoService = null;
    try {
      stanowiskoService = (StanowiskoService) BusinessUtil
          .findBusiness("StanowiskoService");
      req.setAttribute("stanowisko", stanowiskoService.load(1));

      ProjectionList projectionList = Projections.projectionList();
      projectionList.add(Projections.property(Stanowisko.PROPERTY_ID));
      projectionList.add(Projections.property(Stanowisko.PROPERTY_NAZWA));
      req.setAttribute("stanowiskaDoSelecta", stanowiskoService
          .findByParams(projectionList));
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

  }
 
  private void addStanowisko(HttpServletRequest req){
    try {
    String nazwa = req.getParameter("nazwaStanowiska");
    StanowiskoService stanowiskoService = (StanowiskoService)BusinessUtil.findBusiness("StanowiskoService");
    Stanowisko stanowisko = new Stanowisko();
    stanowisko.setNazwa(nazwa);
      stanowiskoService.save(stanowisko);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      e.printStackTrace();
    }
  }
 
  private void prepareDataForStanowiskaSelect(HttpServletRequest request){
    StanowiskoService stanowiskoService = null;
    List<Stanowisko> stanowiska = null;
    try {
      stanowiskoService = (StanowiskoService) BusinessUtil.findBusiness("StanowiskoService");
    List<Criterion> criterions = new ArrayList<Criterion>();
    criterions.add(Restrictions.le(Stanowisko.PROPERTY_ID, 20));
      stanowiska = stanowiskoService.findByParams(criterions);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    Map<String, String> data = new HashMap<String, String>();
View Full Code Here

    }
    request.setAttribute("stanowiskaData", data);
  }
 
  private void setStanowiskoDetails(HttpServletRequest request, Integer id) {
    StanowiskoService stanowiskoService = null;
    try {
      stanowiskoService = (StanowiskoService) BusinessUtil
          .findBusiness("StanowiskoService");
      Stanowisko stanowisko = stanowiskoService.load(id);
      request.setAttribute("id", stanowisko.getIdStanowisko());
      request.setAttribute("name", stanowisko.getNazwa());
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

      throw new ServletException("unsupported parameter !!!");
    }
  }

  private void setStanowiskaSelect(HttpServletRequest request){
    StanowiskoService stanowiskoService = null;
    List<Stanowisko> stanowiska = null;
    try {
      stanowiskoService = (StanowiskoService) BusinessUtil.findBusiness("StanowiskoService");
      stanowiska = stanowiskoService.findAll();
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    Map<String, String> data = new HashMap<String, String>();
View Full Code Here

  public DataResult tableAjax(Map<String, String> filters,
      String[] projections, String columnOrder, String columnOrderDir,
      int startIndex) throws Exception{

   
    StanowiskoService stanowiskoService = null;
   
    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));
      }
    }
   
    try {
      stanowiskoService = (StanowiskoService) BusinessUtil
          .findBusiness("StanowiskoService");

      ProjectionList projectionList = Projections.projectionList();
      for (int i = 0; i < projections.length; i++) {
        projectionList.add(Projections.property(projections[i]));
      }

      List<Criterion> criterions = new ArrayList<Criterion>();
      if (filters.size() > 0) {
        if (!ValidatorUtil.isBlankOrNull(filters
            .get(Stanowisko.PROPERTY_ID))) {
          criterions.add(Restrictions.eq(Stanowisko.PROPERTY_ID,
              Integer.parseInt(filters
                  .get(Stanowisko.PROPERTY_ID))));
        }
        if (!ValidatorUtil.isBlankOrNull(filters
            .get(Stanowisko.PROPERTY_NAZWA))) {
          criterions.add(Restrictions.like(Stanowisko.PROPERTY_NAZWA,
              filters.get(Stanowisko.PROPERTY_NAZWA),
              MatchMode.START));
        }
        if (!ValidatorUtil.isBlankOrNull(filters
            .get(Stanowisko.PROPERTY_OBJECT_PPRACOWNIKS + "."
                + Pracownik.PROPERTY_ID))) {
          criterions.add(Restrictions.eq(
              Stanowisko.PROPERTY_OBJECT_PPRACOWNIKS + "."
                  + Pracownik.PROPERTY_ID,
              Integer.valueOf(filters
                  .get(Stanowisko.PROPERTY_OBJECT_PPRACOWNIKS
                      + "." + Pracownik.PROPERTY_ID))));
        }
      }
      DataResult dane = null;

      startIndex = (startIndex - 1) * ROW_AMOUNT;

      if (orders != null) {
        dane = stanowiskoService.findByParams(projectionList,
            criterions, orders, startIndex, ROW_AMOUNT);
      } else {
        dane = stanowiskoService.findByParams(projectionList,
            criterions, startIndex, ROW_AMOUNT);
      }

      dane.setRowsPerPage(ROW_AMOUNT);
      return dane;
View Full Code Here

  @Override
  public Pracownik setObject() {
    Pracownik pracownik=new Pracownik();
    pracownik.setNazwisko("Nowy");
    pracownik.setImie("NoweImie");
    StanowiskoService stanowiskoService=null;
    try {
      stanowiskoService = (StanowiskoService) BusinessUtil.findBusiness("StanowiskoService");
    } catch (Exception e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }

    Stanowisko stanowisko = new Stanowisko();
    try {
      stanowisko=stanowiskoService.load(1);
    } catch (Exception e) {
      e.printStackTrace();
    }
    pracownik.setStanowisko(stanowisko);
    pracownik.setAdres("Gdzies na swiecie");
View Full Code Here

import pl.zgora.uz.wmie.fe.util.BusinessUtil;

public class StanowiskaAjaxAction {
  public String deleteStanowiska(Integer id){
    try {
    StanowiskoService stanowiskoService = (StanowiskoService) BusinessUtil.findBusiness("StanowiskoService");
      stanowiskoService.deleteById(id);
    } catch (Exception e) {
      e.printStackTrace();
      return e.getCause().getMessage();
    }
    return "";
View Full Code Here

  }

 
  public FormAjaxResponse addStanowisko(Map<String, String> params){
    try {
      StanowiskoService stanowiskoService = (StanowiskoService) BusinessUtil.findBusiness("StanowiskoService");
      Stanowisko s =new Stanowisko();
      s.setNazwa(params.get("nazwaStanowiska").toString());
      stanowiskoService.save(s);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    FormAjaxResponse response = new FormAjaxResponse();
View Full Code Here

TOP

Related Classes of pl.zgora.uz.wmie.fe.service.StanowiskoService

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.