Package java.util

Examples of java.util.Collection


      cvdl.setSqlQueryToNull();

      Number count = new Integer(0);
      cvdl.setSqlQuery("SELECT COUNT(*) AS count FROM literature");
      Collection results = (Collection)cvdl.executeQuery();
      if (results != null && results.size() > 0) {
        Iterator iter = results.iterator();
        while (iter.hasNext()) {
          HashMap row = (HashMap)iter.next();
          count = (Number)row.get("count");
          break;
        }
View Full Code Here


    {
      CVDal cvdl = new CVDal(dataSource);

      cvdl.setSql("project.getproject");
      cvdl.setInt(1, projectId);
      Collection colPrj = cvdl.executeQuery();

      String strTitle = "";
      int intOwner = 0;

      if (colPrj.size() > 0)
      {
        Iterator iter = colPrj.iterator();

        while (iter.hasNext())
        {
          HashMap hm = (HashMap)iter.next();

          if (hm.get("ProjectTitle") != null)
          {
            strTitle = (String)hm.get("ProjectTitle");
          }

          if (hm.get("Owner") != null)
          {
            intOwner = ((Long)hm.get("Owner")).intValue();
          }
        }
      }

      HashMap hmDetails = new HashMap();
      hmDetails.put("title", strTitle);
      hmDetails.put("owner", new Integer(intOwner));
      hmDetails.put("module", new Integer(9));
      hmDetails.put("recordtype", new Integer(48));

      //Get the transactionID
      transactionID = getAtticTransactionID(userID, Constants.CV_GARBAGE, hmDetails);

      HashMap hmPrj = new HashMap();
      hmPrj.put("ProjectID", (new Integer(projectId)).toString());
      sendToAttic(userID, transactionID, "project", hmPrj);

      cvdl.setSql("project.deleteproject");
      cvdl.setInt(1, projectId);
      cvdl.executeUpdate();
      cvdl.clearParameters();

      cvdl.clearParameters();
      cvdl.setSqlQuery("SELECT * FROM projectlink WHERE projectid = ?");
      cvdl.setInt(1, projectId);
      Collection colPrjLink = cvdl.executeQuery();
      cvdl.clearParameters();

      if (colPrjLink.size() > 0)
      {
        Iterator iterator = colPrjLink.iterator();
        while (iterator.hasNext())
        {
          HashMap hm = (HashMap)iterator.next();
          int intRecord = 0;
          if (hm.get("RecordID") != null)
View Full Code Here

    try
    {
      String ProjectQuery = "select ProjectID, ProjectTitle  from project where ProjectID = ?";
      dl.setSqlQuery(ProjectQuery);
      dl.setInt(1, ProjectID);
      Collection col = dl.executeQuery();

      if (col != null)
      {
        Iterator it = col.iterator();
        while (it.hasNext())
        {
          HashMap hm = (HashMap) it.next();
          ProjectName = (String) hm.get("ProjectTitle");
        }// end of while (it.hasNext())
View Full Code Here

        sortmem = "EntityName";
      else if (sortmem.equals("DueDate"))
        sortmem = "End";

      String appendStr = "";
      Collection col = null;

      cvdl.setSql("project.createprojectlist");
      cvdl.executeUpdate();

      cvdl.setSql("project.insertprojectlist");
      cvdl.executeUpdate();

      cvdl.setSql("project.updateprojectlist");
      cvdl.executeUpdate();

      if (searchString != null && searchString.startsWith("ADVANCE:")) {
        searchString = searchString.substring(8);

        String str = "create TEMPORARY TABLE projectsearch " + searchString;
        cvdl.setSqlQueryToNull();
        cvdl.setSqlQuery(str);
        cvdl.executeUpdate();
        cvdl.clearParameters();

        String sortStr = "";
        if (sorttype == 'A') {
          sortStr = " order by " + sortmem + " ";
        } else {
          sortStr = " order by " + sortmem + " DESc";
        }
        if (entityID == -1)// we get all
          str = "select pr.ProjectID, pr.ProjectTitle, pr.Description, pr.Status, pr.Start, pr.End, pr.EntityID, pr.EntityName from projectlist as pr, projectsearch WHERE pr.projectid = projectsearch.projectid "
              + sortStr;
        else
          // we filter over entity id
          str = "select pr.ProjectID, pr.ProjectTitle, pr.Description, pr.Status, pr.Start, pr.End, pr.EntityID, pr.EntityName from projectlist as pr, projectsearch WHERE pr.projectid = projectsearch.projectid and pr.EntityID="
              + entityID + sortStr;
        cvdl.setSqlQueryToNull();
        cvdl.setSqlQuery(str);
        col = cvdl.executeQuery();

        cvdl.setSqlQueryToNull();
        cvdl.setSqlQuery("DROP TABLE projectsearch");
        cvdl.executeUpdate();

        allRecords = false;

      } else {
        if (searchString.startsWith("SIMPLE :")) {
          searchString = searchString.substring(8);
          appendStr = " WHERE (ProjectID like '%" + searchString + "%' "
              + "OR projecttitle like '%" + searchString + "%' " + "OR Description like  '%"
              + searchString + "%' " + "OR status like  '%" + searchString + "%' "
              + "OR start like  '%" + searchString + "%' " + "OR end like  '%" + searchString
              + "%' " + "OR EntityID like  '%" + searchString + "%' " + "OR EntityName like '%"
              + searchString + "%' ) ";

          allRecords = false;
        }

        String str;// cwang
        if (entityID == -1)// we get all
          str = "SELECT * FROM projectlist";
        else
          // we filter over entity id
          str = "SELECT * FROM projectlist WHERE EntityID=" + entityID;

        if (sorttype == 'A') {
          str = str + appendStr + " order by " + sortmem + " limit " + (beginindex - 1) + " , "
              + (endindex + 1) + ";";
          cvdl.setSqlQuery(str);
        } else {
          str = str + appendStr + " order by " + sortmem + " desc limit " + (beginindex - 1)
              + " , " + (endindex + 1) + ";";
          cvdl.setSqlQuery(str);
        }

        col = cvdl.executeQuery();

      }

      cvdl.setSql("project.deleteprojectlist");
      cvdl.executeUpdate();

      Iterator it = col.iterator();
      int i = 0;
      ModuleFieldRightMatrix mfrmx = CVUtility.getUserModuleRight("Projects", userID, false,
          this.dataSource);
      while (it.hasNext()) {
        i++;
        HashMap hm = (HashMap)it.next();

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

        StringMember title, entityName, status, five;
        PureDateMember dueDate;
        IntMember entityId;
        IntMember intmem = new IntMember("ProjectID", projectID, 10, "URL", 'T', false, 10);

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

        if (hm.get("EntityName") != null)
          entityName = new StringMember("Entity", (String)hm.get("EntityName"), mfrmx
              .getFieldRight("Projects", "entity"), "URL", 'T', true);
        else
          entityName = new StringMember("Entity", "", mfrmx.getFieldRight("Projects", "entity"),
              "URL", 'T', true);

        if (hm.get("EntityID") != null)
          entityId = new IntMember("EntityID", ((Long)hm.get("EntityID")).intValue(), 10, "URL",
              'T', false, 10);
        else
          entityId = new IntMember("EntityID", 0, 10, "URL", 'T', false, 10);

        status = new StringMember("Status", (String)hm.get("Status"), mfrmx.getFieldRight(
            "Projects", "status"), "URL", 'T', false);

        if (hm.get("End") != null) {
          java.util.Date dt = (java.util.Date)hm.get("End");
          Calendar cal = Calendar.getInstance();
          cal.setTime(dt);
          cal.set(Calendar.HOUR, 12);
          cal.set(Calendar.MINUTE, 0);
          dueDate = new PureDateMember("DueDate", cal.getTime(), mfrmx.getFieldRight("Projects",
              "end"), "URL", 'T', false, 100, "EST");
        } else
          dueDate = new PureDateMember("DueDate", null, mfrmx.getFieldRight("Projects", "end"),
              "URL", 'T', false, 100, "EST");

        ProjectListElement ele = new ProjectListElement(projectID);
        ele.put("ProjectID", intmem);
        ele.put("Name", title);
        ele.put("Entity", entityName);
        ele.put("Status", status);
        ele.put("DueDate", dueDate);
        ele.put("EntityID", entityId);

        StringBuffer sb = new StringBuffer("00000000000");
        sb.setLength(11);
        String str = (new Integer(i)).toString();
        sb.replace((sb.length() - str.length()), (sb.length()), str);
        String newOrd = sb.toString();

        cvdl.clearParameters();
        if (!allRecords) {
          projectsList.setTotalNoOfRecords(projectsList.size());
        } else {
          int count = 0;
          cvdl.setSql("project.selectprojectcount");
          Collection col2 = cvdl.executeQuery();
          Iterator ite2 = col2.iterator();
          if (ite2.hasNext()) {
            HashMap hm2 = (HashMap)ite2.next();
            count = ((Integer)hm2.get("count(pr.projectid)")).intValue();

          }
View Full Code Here

      CVDal cvdl = new CVDal(dataSource);
      CVUtility.getAllAccessibleRecords("Time Slips", "timeslipaccess", "timeslip", "TimeSlipID",
          "CreatedBy", null, userID, cvdl);

      Collection col = null;

      if (searchString != null && searchString.startsWith("ADVANCE:")) {
        searchString = searchString.substring(8);

        String str = "create TEMPORARY TABLE timeslipsearch " + searchString;
        cvdl.setSqlQueryToNull();
        cvdl.setSqlQuery(str);
        cvdl.executeUpdate();
        cvdl.clearParameters();

        str = "select ts.TimeSlipID, ts.ProjectID, project.ProjectTitle, ts.Description, "
            + "ts.CreatedBy, individual.FirstName, individual.LastName, "
            + "ts.activityid, ts.BreakTime, ts.Date, ts.Start, ts.End, activity.title "
            + "from timeslip ts, timeslipsearch, timeslipaccess tla "
            + "left outer join project on  ts.ProjectID = project.ProjectID "
            + "left outer join individual on ts.CreatedBy = individual.IndividualID "
            + "left outer join task on ts.activityID = task.activityID "
            + "left outer join activity on task.activityid = activity.activityid "
            + "WHERE timeslipsearch.timeslipid =  ts.timeslipid and tla.TimeSlipID=ts.TimeSlipID";

        cvdl.setSqlQueryToNull();
        cvdl.setSqlQuery(str);
        col = cvdl.executeQuery();

        cvdl.setSqlQueryToNull();
        cvdl.setSqlQuery("DROP TABLE timeslipsearch");
        cvdl.executeUpdate();

        allRecords = false;

      } else {
        String appendStr = "";
        if (searchString.startsWith("SIMPLE :")) {
          searchString = searchString.substring(8);
          appendStr = " and (ts.TimeSlipID like '%" + searchString + "%' "
              + "OR ts.ProjectID like '%" + searchString + "%' "
              + "OR project.ProjectTitle like  '%" + searchString + "%' "
              + "OR ts.Description like  '%" + searchString + "%' " + "OR ts.CreatedBy like  '%"
              + searchString + "%' " + "OR individual.FirstName like  '%" + searchString + "%' "
              + "OR individual.LastName like  '%" + searchString + "%' "
              + "OR ts.activityid like  '%" + searchString + "%' " + "OR ts.BreakTime like  '%"
              + searchString + "%' " + "OR ts.Date like  '%" + searchString + "%' "
              + "OR ts.End like  '%" + searchString + "%' " + "OR activity.title like  '%"
              + searchString + "%' " + "OR ts.Start like '%" + searchString + "%' ) ";

          allRecords = false;
        }

        if (sorttype == 'A') {
          String str = "select ts.TimeSlipID, ts.ProjectID, project.ProjectTitle, ts.Description, ts.CreatedBy, individual.FirstName, individual.LastName, ts.activityid, ts.BreakTime, ts.Date, ts.Start, ts.End, activity.title from timeslipaccess tla, timeslip  ts left outer join project on  ts.ProjectID = project.ProjectID left outer join individual on ts.CreatedBy = individual.IndividualID left outer join task on ts.activityID = task.activityID left outer join activity on task.activityid = activity.activityid where tla.TimeSlipID=ts.TimeSlipID "
              + appendStr
              + " order by "
              + sortmem
              + " limit "
              + (beginindex - 1)
              + " , "
              + (endindex + 1) + ";";
          cvdl.setSqlQuery(str);
        } else {
          String str = "select ts.TimeSlipID, ts.ProjectID, project.ProjectTitle, ts.Description, ts.CreatedBy, individual.FirstName, individual.LastName, ts.activityid, ts.BreakTime, ts.Date, ts.Start, ts.End, activity.title from timeslipaccess tla, timeslip  ts left outer join project on  ts.ProjectID = project.ProjectID left outer join individual on ts.CreatedBy = individual.IndividualID left outer join task on ts.activityID = task.activityID left outer join activity on task.activityid = activity.activityid where tla.TimeSlipID=ts.TimeSlipID "
              + appendStr
              + " order by "
              + sortmem
              + " desc limit "
              + (beginindex - 1)
              + " , "
              + (endindex + 1) + ";";
          cvdl.setSqlQuery(str);
        }

        col = cvdl.executeQuery();

      }

      cvdl.setSqlQueryToNull();
      cvdl.clearParameters();
      cvdl.setSqlQuery("drop table timeslipaccess");
      cvdl.executeUpdate();

      ModuleFieldRightMatrix mfrmx = CVUtility.getUserModuleRight("Time Slip", userID, false,
          this.dataSource);

      Iterator it = col.iterator();
      int i = 0;
      while (it.hasNext()) {
        i++;
        HashMap hm = (HashMap)it.next();

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

        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);
        ele.put("Project", projectName);
        ele.put("ProjectID", projectId);
        ele.put("Task", taskName);
        if (Duration > 1.0) {
          StringMember duration = new StringMember("Duration", Float.toString(Duration) + " hours",
              10, "URL", 'T', false);
          ele.put("Duration", duration);
        } else if (Duration == 1.0) {
          StringMember duration = new StringMember("Duration", Float.toString(Duration) + " hour",
              10, "URL", 'T', false);
          ele.put("Duration", duration);
        } else if (Duration > 0.0 && Duration < 1.0) {
          StringMember duration = new StringMember("Duration", Float.toString(Duration * 60)
              + " minutes", 10, "URL", 'T', false);
          ele.put("Duration", duration);
        } else {
          StringMember duration = new StringMember("Duration", "", 10, "URL", 'T', false);
          ele.put("Duration", duration);
        }
        ele.put("CreatedBy", createdBy);
        ele.put("Creator", creator);
        ele.put("Date", date);
        ele.put("StartTime", startTime);
        ele.put("EndTime", endTime);

        StringBuffer sb = new StringBuffer("00000000000");
        sb.setLength(11);
        String str = (new Integer(i)).toString();
        sb.replace((sb.length() - str.length()), (sb.length()), str);
        String newOrd = sb.toString();

        if (!allRecords) {
          timeSlipList.setTotalNoOfRecords(timeSlipList.size());
        } else {
          int count = 0;
          cvdl.setSql("project.selecttimeslipcount");
          Collection col2 = cvdl.executeQuery();
          Iterator ite2 = col2.iterator();
          if (ite2.hasNext()) {
            HashMap hm2 = (HashMap)ite2.next();
            count = ((Integer)hm2.get("count(timeslipid)")).intValue();

          }
View Full Code Here

      int taskCount = 1;
      dl.setSql("projecttask.selecttaskcount");
      dl.setInt(1, tvo.getProjectID());

      Collection countCol = dl.executeQuery();
      Iterator itCount = countCol.iterator();

      if (itCount.hasNext())
      {
        HashMap hm = (HashMap)itCount.next();
        if (hm.get("count(projecttaskcount)") != null)
        {
          taskCount = ((Integer)hm.get("count(projecttaskcount)")).intValue();
        }else{
          taskCount = 0;
        }
      }

      dl.clearParameters();

      dl.setSql("projecttask.addtask");
      dl.setInt(1, activityId);
      dl.setInt(2, tvo.getProjectID());
      dl.setInt(3, tvo.getParentID());
      dl.setString(4, tvo.getIsMileStone());
      dl.setInt(5, ++taskCount);
      dl.executeUpdate();

      HashMap assigned = (HashMap)tvo.getAssignedTo();
      Iterator ite = null;
      if (assigned != null)
      {
        ite = assigned.keySet().iterator();
        while (ite.hasNext())
        {
          int assignedTo = ((Integer)ite.next()).intValue();

          dl.setSql("projecttask.addtaskassigned");
          dl.setInt(1, activityId);
          dl.setInt(2, assignedTo);
          dl.executeUpdate();
          dl.clearParameters();
        }
      }

      Collection actions = tvo.getActivityAction();
      if (actions != null)
      {
        ite = actions.iterator();
        while (ite.hasNext())
        {
          ActivityActionVO action = (ActivityActionVO)ite.next();

          dl.setSql("projecttask.addtaskalertaction");
View Full Code Here

        sortStr = " order by " + sortmem + " DESC";
      }

      CVDal cvdl = new CVDal(dataSource);

      Collection col = null;

      String strTs = "select ts.TimeSlipID, ts.ProjectID, project.ProjectTitle, ts.Description, ts.CreatedBy, individual.FirstName, individual.LastName, ts.activityid, ts.BreakTime, ts.Date, ts.Start, ts.End, activity.title from timeslip  ts left outer join project on  ts.ProjectID = project.ProjectID "
          + "left outer join individual on ts.CreatedBy = individual.IndividualID left outer join task on ts.activityID = task.activityID left outer join activity on task.activityid = activity.activityid where ts.projectid = "
          + projectId + " " + sortStr;

      cvdl.setSqlQuery(strTs);

      col = cvdl.executeQuery();

      Iterator it = col.iterator();
      int i = 0;
      while (it.hasNext()) {
        i++;
        HashMap hm = (HashMap)it.next();
View Full Code Here

        tvo.setIndividualName(actVo.getIndividualName());
      }

      dl.setSql("projecttask.gettask");
      dl.setInt(1, taskId);
      Collection col = dl.executeQuery();
      Iterator ite = col.iterator();
      if (ite.hasNext())
      {
        HashMap hm = (HashMap)ite.next();
        if (hm.get("projectid") != null)
        {
          tvo.setProjectID(((Long)hm.get("projectid")).intValue());
        }

        if (hm.get("parent") != null)
        {
          tvo.setParentID(((Long)hm.get("parent")).intValue());
        }

        if (hm.get("milestone") != null)
        {
          tvo.setIsMileStone((String)hm.get("milestone"));
        }

        if (hm.get("percentcomplete") != null)
        {
          tvo.setPercentComplete(((Long)hm.get("percentcomplete")).intValue());
        }

        if (hm.get("projecttitle") != null)
        {
          tvo.setProjectName((String)hm.get("projecttitle"));
        }

        if (hm.get("projecttaskcount") != null)
        {
          tvo.setProjectTaskCount(((Integer)hm.get("projecttaskcount")).intValue());
        }
      }
      dl.clearParameters();

      dl.setSql("projecttask.gettaskassigned");
      dl.setInt(1, taskId);
      col = dl.executeQuery();
      ite = col.iterator();
      while (ite.hasNext())
      {
        HashMap hm = (HashMap)ite.next();
        if (hm.get("individualid") != null)
        {
          tvo.setAssignedTo(((Long)hm.get("individualid")).intValue(), (String)hm.get("CONCAT(firstname, ' ' , lastname)"));
        }
      }
      dl.clearParameters();

      Collection col1 = null;
      Iterator ite1 = null;

      int activityid = -1;
      dl.setSqlQuery("SELECT activityaction.actionid, activityaction.recipient, "+
                "concat(individual.firstname,' ', individual.lastname) IndividualName ,action.type "+
View Full Code Here

    com.centraview.common.TimeSlipList timeSlipList = new com.centraview.common.TimeSlipList();
    try {
      CVDal cvdl = new CVDal(dataSource);

      Collection col = null;

      cvdl.setSql("project.projecttimeslip");
      cvdl.setInt(1, projectId);
      col = cvdl.executeQuery();

      Iterator it = col.iterator();
      int i = 0;
      while (it.hasNext()) {
        i++;
        HashMap hm = (HashMap)it.next();
View Full Code Here

        }
      }

      dl.setSql("projecttask.selecttaskaction");
      dl.setInt(1, tvo.getActivityID());
      Collection countCol = dl.executeQuery();
      dl.clearParameters();
      Iterator itCount = countCol.iterator();
      while (itCount.hasNext())
      {
        HashMap hm = (HashMap)itCount.next();
        if (hm.get("actionid") != null)
        {
          int actionidd = ((Long)hm.get("actionid")).intValue();
          dl.setSql("projecttask.deletetaskalertaction");
          dl.setInt(1, actionidd);
          dl.executeUpdate();
          dl.clearParameters();
          dl.setSql("projecttask.deletetaskalert");
          dl.setInt(1, actionidd);
          dl.executeUpdate();
          dl.clearParameters();
        }
      }

      Vector customField = tvo.getCustomField();
      if (customField != null && customField.size() != 0)
      {
        for (int i = 0; i < customField.size(); i++)
        {
          CustomFieldVO cvo = (CustomFieldVO)customField.get(i);
          if (cvo.getFieldID() != 0)
          {
            dl.setSql("common.updateCustomFieldScalar");
            dl.setString(1, cvo.getValue());
            dl.setInt(2, cvo.getFieldID());
            dl.setInt(3, tvo.getActivityID());
            dl.executeUpdate();
            dl.clearParameters();
          }
        }
      }

      Collection actions = tvo.getActivityAction();
      if (actions != null)
      {
        ite = actions.iterator();
        while (ite.hasNext())
        {
          ActivityActionVO action = (ActivityActionVO)ite.next();
          String message = tvo.getMessage();
          dl.setSql("projecttask.addtaskalertaction");
View Full Code Here

TOP

Related Classes of java.util.Collection

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.