Package net.sf.czarrental.bl.reservation

Examples of net.sf.czarrental.bl.reservation.Reservation


    return reservations;
  }

  @Override
  public Reservation readReservation(int id) {
    Reservation reservation = null;
    Transaction tx = null;
    try {
      Session session = SessionFactoryUtil.getInstance()
          .getCurrentSession();
      tx = session.beginTransaction();
View Full Code Here


    ArrayList<Car> cars = GetCars.getAllCars();
    ArrayList<Reservation> reservations = rDao.readReservation();

    Iterator<Reservation> i = reservations.iterator();
    while (i.hasNext()) {
      Reservation item = (Reservation) i.next();
      System.out.println(cDao.readCar(item.getIDcar()).hashCode());
      if (item.getDateFrom().before(dateTo)
          && item.getDateTo().after(dateTo)) {
        cars = removeCarFromList(cars, item.getIDcar());
        continue;
      }
      if (item.getDateFrom().after(dateFrom)
          && item.getDateTo().before(dateTo)) {
        cars = removeCarFromList(cars, item.getIDcar());
        continue;
      }
      if (item.getDateFrom().before(dateFrom)
          && item.getDateTo().after(dateFrom)) {
        cars = removeCarFromList(cars, item.getIDcar());
        continue;
      }
    }

    return cars;
View Full Code Here

    ArrayList<Car> cars = Car.getAllCars();
    ArrayList<Reservation> reservations = rDao.readReservation();

    Iterator<Reservation> i = reservations.iterator();
    while (i.hasNext()) {
      Reservation item = (Reservation) i.next();
      System.out.println(cDao.readCar(item.getIDcar()).hashCode());
      if (item.getDateFrom().before(dateTo)
          && item.getDateTo().after(dateTo)) {
        cars = removeCarFromList(cars, item.getIDcar());
        continue;
      }
      if (item.getDateFrom().after(dateFrom)
          && item.getDateTo().before(dateTo)) {
        cars = removeCarFromList(cars, item.getIDcar());
        continue;
      }
      if (item.getDateFrom().before(dateFrom)
          && item.getDateTo().after(dateFrom)) {
        cars = removeCarFromList(cars, item.getIDcar());
        continue;
      }
    }

    return cars;
View Full Code Here

      Car vuz = new Car(spz, adresa.getIDaddress(), price, type);
      vuz.save();
    }
    Customer zakaznik = new Customer("Pepik", "telefon", "Adresa", 50);
    zakaznik.save();
    Reservation rezervace = new Reservation(zakaznik.getIDcus(), 20,
        new GregorianCalendar(2009, 12, 10).getTime(),
        new GregorianCalendar(2009, 12, 20).getTime(), "new", null,
        true);
    rezervace.save();
    Transfer transfer = new Transfer(rezervace.getIDres());
    transfer.save();
    Payment payment = new Payment(new GregorianCalendar(2009, 12, 10)
        .getTime(), null, transfer);
    payment.save();

    rezervace.setIDpay(payment.getIDpay());
    rezervace.update();

    ArrayList<Reservation> res = Reservation.getReservations();
    Iterator<Reservation> i = res.iterator();

    while (i.hasNext()) {
View Full Code Here

    return reservations;
  }

  @Override
  public Reservation readReservation(int id) {
    Reservation reservation = null;
    Transaction tx = null;
    try {
      Session session = SessionFactoryUtil.getInstance()
          .getCurrentSession();
      tx = session.beginTransaction();
View Full Code Here

      }
      return reservations;
  }
  @Override
  public Reservation readReservation(int id) {
    Reservation reservation = null;
      Transaction tx = null;
      try {
        Session session = SessionFactoryUtil.getInstance().getCurrentSession();
        tx = session.beginTransaction();
        reservation = (Reservation) session.createQuery("select r from Reservation as r where idres = " + id).uniqueResult();
View Full Code Here

    Customer zakaznik = new Customer("Pepik", "telefon", "Adresa", 50);
    // ulozeni zakaznika
    zakaznik.save();

    // vytvoreni rezervace
    Reservation rezervace = new Reservation(zakaznik.getIDcus(), 20,
        new GregorianCalendar(2009, 12, 10).getTime(),
        new GregorianCalendar(2009, 12, 20).getTime(), "new", null,
        true);
    // ulozeni rezervace
    rezervace.save();

    // vytvoreni platby prevodem
    Transfer transfer = new Transfer(rezervace.getIDres());
    // ulozeni platby
    transfer.save();

    // vytvoreni platby
    Payment payment = new Payment(new GregorianCalendar(2009, 12, 10)
        .getTime(), null, transfer);
    // ulozeni platby
    payment.save();

    // prirazeni platby k rezervaci
    rezervace.setIDpay(payment.getIDpay());
    // update rezervace
    rezervace.update();

    // nacteni rezervaci
    ArrayList<Reservation> res = Reservation.getReservations();
    Iterator<Reservation> i = res.iterator();
View Full Code Here

TOP

Related Classes of net.sf.czarrental.bl.reservation.Reservation

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.