Package edu.ubb.warp.dao

Examples of edu.ubb.warp.dao.BookingDAO


    }
  }
 
  public void init_tab2() throws DAOException, ResourceNotFoundException, ResourceNotBookedException {
    DAOFactory df = DAOFactory.getInstance();
    BookingDAO bookDAO = df.getBookingDAO();
    ResourceDAO resourceDAO = df.getResourceDAO();
    ProjectDAO proDAO = df.getProjectDAO();
    ArrayList<Project> projectList = proDAO.getProjectsByUser(user);
    Resource userResource = resourceDAO.getResourceByUser(user);
    int min,max = 0;
    Booking bMinMax = bookDAO.getMinBookingByResource(userResource);
    min = bMinMax.getWeek();
    bMinMax = bookDAO.getMaxBookingByResource(userResource);
    max = bMinMax.getWeek();
   
    {
      jobs.addContainerProperty("Project", String.class, null);
      for(int i = min; i <= max; i++) {
        String s = "Week " + Integer.toString(i);
        jobs.addContainerProperty(s, String.class, null);
      }
     

     
      for(int j = 0; j < projectList.size(); j++) {
        String[] obj = new String[max - min + 2];
        obj[0] = projectList.get(j).getProjectName();
        int i = 1;
        for(int it = min; it <= max; it++) {
          Booking b = bookDAO.getBookingByResourceIDAndProjectIDAndWeek(userResource.getResourceID(),projectList.get(j).getProjectID(), i);
          obj[i] = Float.toString(b.getRatio());
          i++;
        }
        jobs.addItem(obj,j);
      }
View Full Code Here


//      System.out.println(tf.getCaption());
//      System.out.println(tf.getValue().toString());
     
    }
    int id = Integer.parseInt(resourceTable.getItem(resourceTable.getValue()).getItemProperty("ResourceID").toString());
    BookingDAO bd = df.getBookingDAO();
    try {
      System.out.printf("projectid:%d, resourceid:%d\n", project.getProjectID(), id);
      bd.insertBookings(project.getProjectID(), id, tm);
     
    } catch (DAOException e) {
      me.getApplication().getMainWindow().showNotification("Database Error!");
      e.printStackTrace();
    } catch (RatioOutOfBoundsException e) {
View Full Code Here

//      System.out.println(tf.getCaption());
//      System.out.println(tf.getValue().toString());
     
    }
    int id = Integer.parseInt(resourceTable.getItem(resourceTable.getValue()).getItemProperty("ResourceID").toString());
    BookingDAO bd = df.getBookingDAO();
    try {
      System.out.printf("projectid:%d, resourceid:%d\n", project.getProjectID(), id);
      bd.updateBookings(project.getProjectID(), id, tm);
     
    } catch (DAOException e) {
      me.getApplication().getMainWindow().showNotification("Database Error!");
      e.printStackTrace();
    } catch (RatioOutOfBoundsException e) {
View Full Code Here

            private static final long serialVersionUID = 6401444749536086608L;

            public void buttonClick(ClickEvent event) {
              me.project.setOpenedStatus(false);

              BookingDAO book = df.getBookingDAO();
              int curentDate = Timestamp.toInt(new Date());
              try {

                Booking maxBook = book
                    .getMaxBookingByProject(me.project);

                if (curentDate > maxBook.getWeek()) {

                  me.project.setDeadLineDate(new Date());
View Full Code Here

        me.getApplication().getMainWindow().setContent(new MakeRequestPageUI(u,p));
      }
    });
 
    try {
      BookingDAO bookDAO = df.getBookingDAO();
      ResourceDAO resourceDAO = df.getResourceDAO();
      ArrayList<Resource> resourceList;
     
      resourceList = resourceDAO.getResourcesByProject(p);
   
      int min,max = 0;
      Booking bMinMax = bookDAO.getMinBookingByProject(p);
      min = bMinMax.getWeek();
      bMinMax = bookDAO.getMaxBookingByProject(p);
      max = bMinMax.getWeek();
      {
        projectTable.addContainerProperty("Resource", String.class, null);
        for(int i = min; i <= max; i++) {
          String s = "Week " + Integer.toString(i);
          projectTable.addContainerProperty(s, String.class, null);
        }
       
 
       
        for(int j = 0; j < resourceList.size(); j++) {
          String[] obj = new String[max - min + 2];
          obj[0] = resourceList.get(j).getResourceName();
          int i = 1;
          for(int it = min; it <= max; it++) {
            Booking b = bookDAO.getBookingByResourceIDAndProjectIDAndWeek(resourceList.get(j).getResourceID(),p.getProjectID(), i);
            obj[i] = Float.toString(b.getRatio());
            i++;
          }
          projectTable.addItem(obj,j);
        }
View Full Code Here

        Date projectEnd = (Date) date.getValue();
        Date dateNow = new Date();

        System.out.println(projectEnd.toString());
        if (projectEnd.after(projectStart) && projectEnd.after(dateNow)) {
          BookingDAO bookDAO = df.getBookingDAO();
          int maxweek;
          int weeknow = Timestamp.toInt(projectEnd);

          try {
            Booking bmax = bookDAO.getMaxBookingByProject(p);
            maxweek = bmax.getWeek();

            if (weeknow > maxweek) { // lehet updatelni

              try {
View Full Code Here

      private static final long serialVersionUID = -1584650324522763760L;

      public void buttonClick(ClickEvent event) {
        //close a project 
       
        BookingDAO book = df.getBookingDAO();
       
        int nowDate = Timestamp.toInt(new Date());
       
        int projectEnd = p.getDeadLine();
       
       
        try {
       
          Booking maxBook =book.getMaxBookingByProject(p);
       
          if (nowDate > maxBook.getWeek())
          {
           
            p.setDeadLineDate(new Date());
View Full Code Here

TOP

Related Classes of edu.ubb.warp.dao.BookingDAO

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.