Package com.centraview.common

Examples of com.centraview.common.PureTimeMember


        String str = (String) it.next();

        StringMember sm = null;
        IntMember im = null;
        PureDateMember pdm = null;
        PureTimeMember ptm = null;

        ListElement ele = (ListElement) DL.get(str);
        sm = (StringMember) ele.get("Description");

        String sDescription = sm.getDisplayString();
        hrtsvo.setDescription(sDescription);
        im = (IntMember) ele.get("ID");

        String id = im.getDisplayString();
        ptm = (PureTimeMember) ele.get("StartTime");

        String sStartTime = ptm.getDisplayString();

        Vector vStime = getTime(sStartTime);
        String shr = (String) vStime.get(0);
        int hr = Integer.parseInt(shr);
        String smin = (String) vStime.get(1);
        int min = Integer.parseInt(smin);
        hrtsvo.setStart(new java.sql.Time(hr, min, 0));

        //Convert to time
        ptm = (PureTimeMember) ele.get("EndTime");

        String sEndTime = ptm.getDisplayString();

        //Convert to time
        Vector vEtime = getTime(sEndTime);
        String sEhr = (String) vEtime.get(0);
        int iEhr = Integer.parseInt(sEhr);
View Full Code Here


        if (hm.get("ProjectID") != null)
          projectID = ((Long)hm.get("ProjectID")).intValue();

        StringMember description, projectName = null, taskName = null, createdBy = null;
        PureDateMember date = null;
        PureTimeMember startTime = null, endTime = null;
        IntMember creator, taskId;

        IntMember intmem = new IntMember("ID", timeSlipID, 10, "URL", 'T', true, 10);
        IntMember projectId = new IntMember("ProjectID", projectID, 10, "URL", 'T', true, 10);

        Time tStartTime = (Time)hm.get("Start");
        Time tEndTime = (Time)hm.get("End");

        java.util.Date dt = (java.util.Date)hm.get("Date");

        Calendar calendarStart = Calendar.getInstance();
        calendarStart.set(dt.getYear(), dt.getMonth(), dt.getDay(), tStartTime.getHours(),
            tStartTime.getMinutes());

        Calendar calendarEnd = Calendar.getInstance();
        calendarEnd.set(dt.getYear(), dt.getMonth(), dt.getDay(), tEndTime.getHours(), tEndTime
            .getMinutes());

        long startMili = calendarStart.getTimeInMillis();
        long endMili = calendarEnd.getTimeInMillis();

        long diff = endMili - startMili;

        Time difTime = new Time(diff);

        int startHrs = calendarStart.get(Calendar.HOUR_OF_DAY);// startHrsmm[0];
        int startMins = calendarStart.get(Calendar.MINUTE);// startHrsmm[1];

        int endHrs = calendarEnd.get(Calendar.HOUR_OF_DAY);// endHrsmm[0];
        int endMins = calendarEnd.get(Calendar.MINUTE);// endHrsmm[1];

        float Duration = 0;

        Number dBreakTime = (Number)hm.get("BreakTime");
        float BreakTime = dBreakTime.floatValue();
        float remMin = 0;

        if (startMins != 0 && endMins != 0 && (startMins - endMins != 0)) {
          if (endMins > startMins)
            remMin = 60 / (endMins - startMins);
          else
            remMin = 60 / (startMins - endMins);
        }

        Duration = (endHrs - startHrs) + remMin - BreakTime;

        if (hm.get("Description") != null)
          description = new StringMember("Description", (String)hm.get("Description"), 10, "", 'T',
              false);
        else
          description = new StringMember("Description", "", 10, "", 'T', false);

        if (hm.get("ProjectTitle") != null)
          projectName = new StringMember("Project", (String)hm.get("ProjectTitle"), mfrmx
              .getFieldRight("Time Slip", "project"), "URL", 'T', true);
        else
          projectName = new StringMember("Project", "",
              mfrmx.getFieldRight("Time Slip", "project"), "URL", 'T', true);

        if (hm.get("title") != null)
          taskName = new StringMember("Task", (String)hm.get("title"), mfrmx.getFieldRight(
              "Time Slip", "task"), "URL", 'T', true);
        else
          taskName = new StringMember("Task", "", mfrmx.getFieldRight("Time Slip", "task"), "URL",
              'T', true);

        if (hm.get("activityid") != null)
          taskId = new IntMember("TaskID", ((Integer)hm.get("activityid")).intValue(), 10, "URL",
              'T', true, 10);
        else
          taskId = new IntMember("TaskID", 0, 10, "URL", 'T', true, 10);

        String firstName = (String)hm.get("FirstName");
        String lastName = (String)hm.get("LastName");

        String created = (firstName != null ? firstName + " " : "")
            + (lastName != null ? lastName : "");

        if (!created.equals(""))
          createdBy = new StringMember("CreatedBy", created, 10, "", 'T', true);
        else
          createdBy = new StringMember("CreatedBy", "", 10, "", 'T', true);

        if (hm.get("CreatedBy") != null)
          creator = new IntMember("Creator", ((Integer)hm.get("CreatedBy")).intValue(), 10, "URL",
              'T', false, 10);
        else
          creator = new IntMember("Creator", 0, 10, "URL", 'T', false, 10);

        if (hm.get("Date") != null)
          date = new PureDateMember("Date", (java.util.Date)hm.get("Date"), 10, "URL", 'T', false,
              100, "EST");
        else
          date = new PureDateMember("Date", null, 10, "URL", 'T', false, 100, "EST");

        if (hm.get("Start") != null)
          startTime = new PureTimeMember("StartTime", (java.util.Date)hm.get("Start"), 10, "URL",
              'T', false, 100, "EST");
        else
          startTime = new PureTimeMember("StartTime", null, 10, "URL", 'T', false, 100, "EST");

        if (hm.get("End") != null)
          endTime = new PureTimeMember("EndTime", (java.util.Date)hm.get("End"), 10, "URL", 'T',
              false, 100, "EST");
        else
          endTime = new PureTimeMember("EndTime", null, 10, "URL", 'T', false, 100, "EST");

        TimeSlipListElement ele = new TimeSlipListElement(timeSlipID);
        ele.put("ID", intmem);
        ele.put("TaskID", taskId);
        ele.put("Description", description);
View Full Code Here

        int timeSlipID = ((Long)hm.get("TimeSlipID")).intValue();
        int projectID = ((Long)hm.get("ProjectID")).intValue();

        StringMember description, projectName = null, taskName = null, createdBy = null;
        PureDateMember date = null;
        PureTimeMember startTime = null, endTime = null;
        IntMember creator, taskId;

        IntMember intmem = new IntMember("ID", timeSlipID, 10, "URL", 'T', true, 10);
        IntMember projectId1 = new IntMember("ProjectID", projectID, 10, "URL", 'T', true, 10);

        Time tStartTime = (Time)hm.get("Start");
        Time tEndTime = (Time)hm.get("End");

        java.util.Date dt = (java.util.Date)hm.get("Date");

        Calendar calendarStart = Calendar.getInstance();
        calendarStart.set(dt.getYear(), dt.getMonth(), dt.getDay(), tStartTime.getHours(),
            tStartTime.getMinutes());

        Calendar calendarEnd = Calendar.getInstance();
        calendarEnd.set(dt.getYear(), dt.getMonth(), dt.getDay(), tEndTime.getHours(), tEndTime
            .getMinutes());

        long startMili = calendarStart.getTimeInMillis();
        long endMili = calendarEnd.getTimeInMillis();

        long diff = endMili - startMili;
        Time difTime = new Time(diff);

        int startHrs = calendarStart.get(Calendar.HOUR_OF_DAY);// startHrsmm[0];
        int startMins = calendarStart.get(Calendar.MINUTE);// startHrsmm[1];

        int endHrs = calendarEnd.get(Calendar.HOUR_OF_DAY);// endHrsmm[0];
        int endMins = calendarEnd.get(Calendar.MINUTE);// endHrsmm[1];

        float Duration = 0;

        Double dBreakTime = (Double)hm.get("BreakTime");
        float BreakTime = dBreakTime.floatValue();
        float remMin = 0;

        if (startMins != 0 && endMins != 0 && startMins != endMins) {
          if (endMins > startMins)
            remMin = 60 / (endMins - startMins);
          else
            remMin = 60 / (startMins - endMins);
        }

        Duration = (endHrs - startHrs) + remMin - BreakTime;

        StringMember duration = new StringMember("Duration", Float.toString(Duration), 10, "URL",
            'T', false);

        if (hm.get("Description") != null)
          description = new StringMember("Description", (String)hm.get("Description"), 10, "", 'T',
              false);
        else
          description = new StringMember("Description", "", 10, "", 'T', false);

        if (hm.get("ProjectTitle") != null)
          projectName = new StringMember("Project", (String)hm.get("ProjectTitle"), 10, "URL", 'T',
              true);
        else
          projectName = new StringMember("Project", "", 10, "URL", 'T', true);

        if (hm.get("title") != null)
          taskName = new StringMember("Task", (String)hm.get("title"), 10, "URL", 'T', true);
        else
          taskName = new StringMember("Task", "", 10, "URL", 'T', true);

        if (hm.get("activityid") != null)
          taskId = new IntMember("TaskID", ((Integer)hm.get("activityid")).intValue(), 10, "URL",
              'T', true, 10);
        else
          taskId = new IntMember("TaskID", 0, 10, "URL", 'T', true, 10);

        String firstName = (String)hm.get("FirstName");
        String lastName = (String)hm.get("LastName");

        String created = (firstName != null ? firstName + " " : "")
            + (lastName != null ? lastName : "");

        if (!created.equals(""))
          createdBy = new StringMember("CreatedBy", created, 10, "", 'T', true);
        else
          createdBy = new StringMember("CreatedBy", "", 10, "", 'T', true);

        if (hm.get("CreatedBy") != null)
          creator = new IntMember("Creator", ((Integer)hm.get("CreatedBy")).intValue(), 10, "URL",
              'T', false, 10);
        else
          creator = new IntMember("Creator", 0, 10, "URL", 'T', false, 10);

        if (hm.get("Date") != null)
          date = new PureDateMember("Date", (java.util.Date)hm.get("Date"), 10, "URL", 'T', false,
              100, "EST");
        else
          date = new PureDateMember("Date", null, 10, "URL", 'T', false, 100, "EST");

        if (hm.get("Start") != null)
          startTime = new PureTimeMember("StartTime", (java.util.Date)hm.get("Start"), 10, "URL",
              'T', false, 100, "EST");
        else
          startTime = new PureTimeMember("StartTime", null, 10, "URL", 'T', false, 100, "EST");

        if (hm.get("End") != null)
          endTime = new PureTimeMember("EndTime", (java.util.Date)hm.get("End"), 10, "URL", 'T',
              false, 100, "EST");
        else
          endTime = new PureTimeMember("EndTime", null, 10, "URL", 'T', false, 100, "EST");

        TimeSlipListElement ele = new TimeSlipListElement(timeSlipID);
        ele.put("ID", intmem);
        ele.put("TaskID", taskId);
        ele.put("Description", description);
View Full Code Here

        int timeSlipID = ((Long)hm.get("TimeSlipID")).intValue();
        int projectID = ((Long)hm.get("ProjectID")).intValue();

        StringMember description, projectName = null, taskName = null, createdBy = null;
        PureDateMember date = null;
        PureTimeMember startTime = null, endTime = null;
        IntMember creator, taskId;

        IntMember intmem = new IntMember("ID", timeSlipID, 10, "URL", 'T', true, 10);
        IntMember projectId1 = new IntMember("ProjectID", projectID, 10, "URL", 'T', true, 10);

        Time tStartTime = (Time)hm.get("Start");
        Time tEndTime = (Time)hm.get("End");

        java.util.Date dt = (java.util.Date)hm.get("Date");

        Calendar calendarStart = Calendar.getInstance();
        calendarStart.set(dt.getYear(), dt.getMonth(), dt.getDay(), tStartTime.getHours(),
            tStartTime.getMinutes());

        Calendar calendarEnd = Calendar.getInstance();
        calendarEnd.set(dt.getYear(), dt.getMonth(), dt.getDay(), tEndTime.getHours(), tEndTime
            .getMinutes());

        long startMili = calendarStart.getTimeInMillis();
        long endMili = calendarEnd.getTimeInMillis();

        long diff = endMili - startMili;
        Time difTime = new Time(diff);
        int startHrs = calendarStart.get(Calendar.HOUR_OF_DAY);// startHrsmm[0];
        int startMins = calendarStart.get(Calendar.MINUTE);// startHrsmm[1];

        int endHrs = calendarEnd.get(Calendar.HOUR_OF_DAY);// endHrsmm[0];
        int endMins = calendarEnd.get(Calendar.MINUTE);// endHrsmm[1];

        float Duration = 0;

        Double dBreakTime = (Double)hm.get("BreakTime");
        float BreakTime = dBreakTime.floatValue();
        float remMin = 0;

        if (startMins != 0 && endMins != 0 && startMins != endMins) {
          if (endMins > startMins)
            remMin = 60 / (endMins - startMins);
          else
            remMin = 60 / (startMins - endMins);
        }

        Duration = (endHrs - startHrs) + remMin - BreakTime;

        StringMember duration = new StringMember("Duration", Float.toString(Duration), 10, "URL",
            'T', false);

        if (hm.get("Description") != null)
          description = new StringMember("Description", (String)hm.get("Description"), 10, "", 'T',
              false);
        else
          description = new StringMember("Description", "", 10, "", 'T', false);

        if (hm.get("ProjectTitle") != null)
          projectName = new StringMember("Project", (String)hm.get("ProjectTitle"), 10, "URL", 'T',
              true);
        else
          projectName = new StringMember("Project", "", 10, "URL", 'T', true);

        if (hm.get("title") != null)
          taskName = new StringMember("Task", (String)hm.get("title"), 10, "URL", 'T', true);
        else
          taskName = new StringMember("Task", "", 10, "URL", 'T', true);

        if (hm.get("activityid") != null)
          taskId = new IntMember("TaskID", ((Integer)hm.get("activityid")).intValue(), 10, "URL",
              'T', true, 10);
        else
          taskId = new IntMember("TaskID", 0, 10, "URL", 'T', true, 10);

        String firstName = (String)hm.get("FirstName");
        String lastName = (String)hm.get("LastName");

        String created = (firstName != null ? firstName + " " : "")
            + (lastName != null ? lastName : "");

        if (!created.equals(""))
          createdBy = new StringMember("CreatedBy", created, 10, "", 'T', true);
        else
          createdBy = new StringMember("CreatedBy", "", 10, "", 'T', true);

        if (hm.get("CreatedBy") != null)
          creator = new IntMember("Creator", ((Integer)hm.get("CreatedBy")).intValue(), 10, "URL",
              'T', false, 10);
        else
          creator = new IntMember("Creator", 0, 10, "URL", 'T', false, 10);

        if (hm.get("Date") != null)
          date = new PureDateMember("Date", (java.util.Date)hm.get("Date"), 10, "URL", 'T', false,
              100, "EST");
        else
          date = new PureDateMember("Date", null, 10, "URL", 'T', false, 100, "EST");

        if (hm.get("Start") != null)
          startTime = new PureTimeMember("StartTime", (java.util.Date)hm.get("Start"), 10, "URL",
              'T', false, 100, "EST");
        else
          startTime = new PureTimeMember("StartTime", null, 10, "URL", 'T', false, 100, "EST");

        if (hm.get("End") != null)
          endTime = new PureTimeMember("EndTime", (java.util.Date)hm.get("End"), 10, "URL", 'T',
              false, 100, "EST");
        else
          endTime = new PureTimeMember("EndTime", null, 10, "URL", 'T', false, 100, "EST");

        TimeSlipListElement ele = new TimeSlipListElement(timeSlipID);
        ele.put("ID", intmem);
        ele.put("TaskID", taskId);
        ele.put("Description", description);
View Full Code Here

        HashMap hm = ( HashMap  )it.next();
        int timeSlipID = ((Long)hm.get("TimeSlipID")).intValue();

        StringMember  reference = null, description, projectName = null, taskName =null, createdBy=null;
        PureDateMember date=null;
        PureTimeMember startTime=null, endTime=null;
        IntMember creator, taskId;
        IntMember referencetype = new IntMember( "Reference" ,0 , 10 , "", 'T' , true , 10 );

        IntMember intmem = new IntMember( "ID" , timeSlipID , 10 , "URL", 'T' , true , 10 );
        //IntMember projectId = new IntMember( "ProjectID" , projectID , 10 , "URL", 'T' , true , 10 );

        Time tStartTime = (Time)hm.get("Start");
        Time tEndTime = (Time)hm.get("End");

        Calendar calendarStart = Calendar.getInstance();
        calendarStart.setTime(tStartTime);

        Calendar calendarEnd = Calendar.getInstance();
        calendarEnd.setTime(tEndTime);

        //int startHrsmm[] = CVUtility.convertTimeTo24HrsFormat(StartTime);
        int startHrs = calendarStart.get(Calendar.HOUR_OF_DAY);//startHrsmm[0];
        int startMins = calendarStart.get(Calendar.MINUTE);//startHrsmm[1];

        //int endHrsmm[] = CVUtility.convertTimeTo24HrsFormat(EndTime);
        int endHrs = calendarEnd.get(Calendar.HOUR_OF_DAY);//endHrsmm[0];
        int endMins = calendarEnd.get(Calendar.MINUTE);//endHrsmm[1];


        float Duration = 0;

        Double dBreakTime = (Double)hm.get("BreakTime");
        float BreakTime = dBreakTime.floatValue();
        float remMin = 0;

        if ( startMins != 0 && endMins != 0 && (startMins-endMins !=0))
        {
          if(endMins > startMins)
            remMin = 60/(endMins - startMins);
          else
            remMin = 60/(startMins - endMins);
        }


        Duration = (endHrs - startHrs) + remMin - BreakTime ;

        totalDuration += Duration;


        if( hm.get( "ActivityID" ) != null && hm.get( "ProjectID" ) !=null  && hm.get( "TicketID" ) !=null ){

          int activityId = ((Integer)hm.get("ActivityID")).intValue();
          int projectId = ((Long)hm.get("ProjectID")).intValue();
          int ticketId = ((Long)hm.get("TicketID")).intValue();

          if( projectId != 0){

            String title = " Project : ";
            strQuery = "select ProjectTitle from project where ProjectID = "+projectId;
            cvdl.setSqlQuery(strQuery);
            Collection colProject = null;
            colProject = cvdl.executeQuery();

            if (colProject != null)
            {
              Iterator projectIterator = colProject.iterator();
              while( projectIterator.hasNext() )
              {
                HashMap hm1 = ( HashMap  )projectIterator.next();
                title = title + (String) hm1.get( "ProjectTitle" );
              }
            }

            if( activityId != 0){
              strQuery = "select Title from activity where activityId = "+activityId;
              cvdl.setSqlQuery(strQuery);
              Collection colActivity = null;
              colActivity = cvdl.executeQuery();
              if (colActivity != null)
              {

                Iterator activityIterator = colActivity.iterator();
                while( activityIterator.hasNext() )
                {
                  HashMap hm1 = ( HashMap  )activityIterator.next();
                  title = title +"/"+ (String) hm1.get( "Title" );
                }
              }
            }

            reference  = new StringMember( "Reference", title ,10 , "", 'T' , false  );
          }




          if( ticketId != 0){

            strQuery = "select subject from ticket where ticketid = "+ticketId;
            cvdl.setSqlQuery(strQuery);
            Collection colTicket = null;
            colTicket = cvdl.executeQuery();
            if (colTicket != null)
            {
              Iterator itTicket = colTicket.iterator();
              while( itTicket.hasNext() )
              {
                HashMap hm1 = ( HashMap  )itTicket.next();
                reference  = new StringMember( "Reference", " Ticket : "+(String) hm1.get( "subject" ,10 , "", 'T' , false  );
              }
            }

          }
        }
        else{
          referencetype = new IntMember( "ReferenceType" ,4 , 10 , "", 'T' , true , 10 );
          reference  = new StringMember( "Reference", "" ,10 , "", 'T' , false  );
        }

        if( hm.get( "Description" ) !=null)
          description  = new StringMember( "Description", (String) hm.get( "Description" ) ,10 , "", 'T' , false  );
        else
          description  = new StringMember( "Description", "" ,10 , "", 'T' , false  );



        if( hm.get( "Date" ) !=null)
          date  = new PureDateMember( "Date" ,(java.util.Date)hm.get("Date"),10 , "URL" , 'T' , false ,100 ,"EST");
        else
          date  = new PureDateMember( "Date" ,null,10 , "URL" , 'T' , false ,100 ,"EST"  );

        if( hm.get( "Start" ) !=null)
          startTime  = new PureTimeMember( "StartTime" ,(java.util.Date)hm.get("Start"),10 , "URL" , 'T' , false ,100 ,"EST");
        else
          startTime  = new PureTimeMember( "StartTime" ,null,10 , "URL" , 'T' , false ,100 ,"EST");


        if( hm.get( "End" ) !=null)
          endTime  = new PureTimeMember( "EndTime" ,(java.util.Date)hm.get("End"),10 , "URL" , 'T' , false ,100 ,"EST");
        else
          endTime  = new PureTimeMember( "EndTime" ,null,10 , "URL" , 'T' , false ,100 ,"EST");


        TimeSlipListElement ele = new TimeSlipListElement(timeSlipID);
        ele.put("ID", intmem );
        ele.put("Description", description );
View Full Code Here

TOP

Related Classes of com.centraview.common.PureTimeMember

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.