Package com.centraview.projects.helper

Examples of com.centraview.projects.helper.TimeSlipDBVO


      CVDal dl = new CVDal(dataSource);
      dl.setSql("projecttimeslip.updatetimeslip");

      // begin :: adding for fieldlevel rights...

      TimeSlipDBVO tsdbvo = new TimeSlipDBVO();
      tsdbvo = getDBVO(tsvo.getTimeSlipID(),userId);
      tsvo = (TimeSlipVO)CVUtility.replaceVO(tsdbvo, tsvo, "Time Slips", userId, this.dataSource);

      // end :: adding for fieldlevel rights...
View Full Code Here


  }

  public TimeSlipDBVO getDBVO(int timeSlipId, int userId)
  {

    TimeSlipDBVO tdbvo = new TimeSlipDBVO();
    int projectId = 0;
    int activityId = 0;
    try
    {


      CVDal cvdl = new CVDal(dataSource);

      cvdl.setSql( "projecttimeslip.gettimeSlip" );
      cvdl.setInt( 1 , timeSlipId );
       Collection col = cvdl.executeQuery();
      Iterator ite = col.iterator();
      if (ite.hasNext())
      {
        HashMap hm = (HashMap)ite.next();
        tdbvo.setTimeSlipID(((Long)hm.get("timeslipid")).intValue());
          if(hm.get("projectid")!=null)
          tdbvo.setProjectID(((Long)hm.get("projectid")).intValue());
        //tvo.setProjectTitle((String)hm.get("projecttitle"));
        //tvo.setTaskTitle((String)hm.get("title"));
        if(hm.get("activityid")!=null)
          tdbvo.setTaskID(((Integer)hm.get("activityid")).intValue());
        if(hm.get("ticketid")!=null){
          tdbvo.setTicketID(((Long)hm.get("ticketid")).intValue());
        }
        else{
          tdbvo.setTicketID(0);
        }
        tdbvo.setDescription((String)hm.get("description"));
        tdbvo.setDate((java.sql.Date)hm.get("date"));
        tdbvo.setStart((java.sql.Time)hm.get("start"));
        tdbvo.setEnd((java.sql.Time)hm.get("end"));
        tdbvo.setBreakTime(((Double)hm.get("breaktime")).floatValue());
        tdbvo.setHours(((Double)hm.get("hours")).floatValue());

      }
       cvdl.clearParameters();
      if (tdbvo.getProjectID() !=0 )
      {
        cvdl.setSql("projecttimeslip.getprojecttimeSlip");
        cvdl.setInt(1, tdbvo.getProjectID());
        col = cvdl.executeQuery();
        ite = col.iterator();
        if(ite.hasNext())
        {
          HashMap hm = (HashMap)ite.next();
          tdbvo.setProjectTitle((String)hm.get("projecttitle"));
        }
        cvdl.clearParameters();
      }

      if (tdbvo.getTaskID() !=0 )
      {
        cvdl.setSql("projecttimeslip.getactivitytimeSlip");
        cvdl.setInt(1, tdbvo.getTaskID());
        col = cvdl.executeQuery();
        ite = col.iterator();
        if(ite.hasNext())
        {
          HashMap hm = (HashMap)ite.next();
          tdbvo.setTaskTitle((String)hm.get("title"));
        }
        cvdl.clearParameters();
      }
      if (tdbvo.getTicketID() !=0 )
      {
        cvdl.setSqlQuery("select subject from ticket where ticketid ="+tdbvo.getTicketID());
        col = cvdl.executeQuery();
        ite = col.iterator();
        if(ite.hasNext())
        {
          HashMap hm = (HashMap)ite.next();
          tdbvo.setTicket((String)hm.get("subject"));
        }
        cvdl.clearParameters();
      }
      cvdl.destroy();
View Full Code Here

TOP

Related Classes of com.centraview.projects.helper.TimeSlipDBVO

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.