Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.GDDate


        });
    }
 
  private void makePresentOnDate(String time, String registration, int column) {
    int hour = Integer.parseInt(time.split(":")[0]);
    GDDate date = new GDDate(getCalendar());
   
    date.addDays(column - 2);
    date.setHourOfDay(hour);
    date.setMinuteOfHour(0);
    date.setSecondOfMinute(0);
   
    try {
      system.execute(new AddStudentPresentOnAppointment(true, registration, date));
     } catch (TransactionDateException e) {
      MessageBox box = new MessageBox(getShell(), IMessageProvider.INFORMATION);
View Full Code Here


        box.open();
    }
  }

  private void updateColumns() {
    GDDate myCalendar = new GDDate();
    myCalendar.setTimeInMillis(getCalendar());

    for (int x = 0; x < numberOfColumns; x++) {
      TableColumn col = presentTable.getColumn(x);
      String text = "Hor�rio";
      String day = "";
      if (x > 1) {
        text = new SimpleDateFormat("EEEEE").format(
            myCalendar.getDate()).replace("-feira", "");
        day = new SimpleDateFormat("dd").format(myCalendar.getDate());
        text = text + " (" + day + ")";
        myCalendar.addDays(1);//(Calendar.DAY_OF_MONTH, 1);
      }
      col.setText(text);
    }
  }
View Full Code Here

         
          
          
          
        for (Person person : persons.values()) {
          GDDate date;
          try {
            date = new GDDate(person.getBirthDate());
          } catch (Exception e) {
            date = new GDDate();
          }
          if(date.equals(new GDDate())) {
            System.out.println(person.getName() + " - " + date.getFormatedDate());
          }
        }
        } catch (Exception e) {
    }   
//    try {
View Full Code Here

                      items = table.getItems();
                      break;
                  }
                } else if (isDate(items[z].getText(index))) {
                   try{
                     GDDate calendar1 = new GDDate(value1);
                     GDDate calendar2 = new GDDate(value2);
                     if ((order == 0) ? calendar2.beforeDay(calendar1) : calendar2.afterDay(calendar1)) {
                       String[] values = { items[z].getText(0), items[z].getText(1), items[z].getText(2), items[z].getText(3), items[z].getText(4), items[z].getText(5), items[z].getText(6), items[z].getText(7), items[z].getText(8) };
                       Image[] images = {items[z].getImage(0), items[z].getImage(1), items[z].getImage(2), items[z].getImage(3), items[z].getImage(4), items[z].getImage(5), items[z].getImage(6), items[z].getImage(7), items[z].getImage(8)};
                       Color[] color = { items[z].getForeground(0), items[z].getForeground(1), items[z].getForeground(2), items[z].getForeground(3), items[z].getForeground(4), items[z].getForeground(5), items[z].getForeground(6), items[z].getForeground(7), items[z].getForeground(8)};
                       items[z].dispose();
                       TableItem item = new TableItem(table, SWT.NONE, j);
View Full Code Here

        return true;
    }

     private boolean isDate(String string) {
        try {
            new GDDate(string);
        } catch (Exception e) {
            return false;
        }
        return true;
    }
View Full Code Here

                    registrationWithoutParcels.add(registration);
                  Person person = (Person) system.query(new GetPerson(registration.getIdPerson()));
                  int numberOfParcel = 1;
                 
                  for (Parcel parcel : registration.getParcels()) {
                      parcelDate = new GDDate(parcel.getDate());
                          if (parcelDate.afterOrEqualsDay(this.startDate) && parcelDate.beforeOrEqualsDay(this.finishDate)) {
                            createParcelsMap(person, parcel, index , numberOfParcel, registration.isActive(), registration.getIdRegistration());
                              index++;
                          }
                      numberOfParcel++;
View Full Code Here

         
     
      private void createParcelsMap(Person person, Parcel parcel, int index, int numberOfParcel, boolean isActive, String idRegistration) {
          float value;
          String numberOfParcelStr = "";
          GDDate today = new GDDate();
          GDDate parcelDate = new GDDate(parcel.getDate());
         
            if(parcelDate.afterOrEqualsDay(today)) {
              value = new Money(parcel.getValueBeforeParcelDateExpiration()).getFloatValue();
            } else {
              value = new Money(parcel.getValueAfterParcelDateExpiration()).getFloatValue();
            }
View Full Code Here

        int startWorkTime = gd.getWorktime("start");
        int endWorkTime = gd.getWorktime("end");
      RegistrationMap registrationMap = system.getRegistratioMap();
      for (int i = 1; i <= weekDays.size() ; i++) {
      for (int hour = startWorkTime; hour <= endWorkTime; hour++) {
        GDDate date = new GDDate();
        date.setWeekDay(i);
        date.setHourOfDay(hour-1);
        int numberOfAppointments = registrationMap.getNumberOfAppointmentsOfTheDay(date);
        int numberOfVacancy = registrationMap.getMaxVacancy(weekDays.get(i-1), String.valueOf(hour));
        int numberOfVacancyWithOutClassRoom = numberOfVacancy - numberOfAppointments;
       
        if(numberOfVacancyWithOutClassRoom < _numberOfComputers && numberOfVacancyWithOutClassRoom > 0) {
View Full Code Here

   
    public void parserFileOFC(File inFile) {
        String description = null;
        String value = "";
        String bankOperationNumber = null;
        GDDate date = null;
        String inputLine;

        try {
          boolean isCancel = false;
            BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(inFile)));
            while ((inputLine = br.readLine()) != null) {
              if(isCancel){
                break;
              }
                String lineTest = inputLine.trim();
                if (lineTest.contains("MEMO")) {
                    description = lineTest.split("<MEMO>")[1];
                } else if (lineTest.contains("TRNAMT")) {
//                    if (lineTest.split("<TRNAMT>")[1].contains("-")) {
//                        value = lineTest.split("<TRNAMT>")[1];
//                    } else
                        value = lineTest.split("<TRNAMT>")[1];
                } else if (lineTest.contains("DTPOSTED")) {
                    int year = Integer.parseInt(lineTest.split("<DTPOSTED>")[1].substring(0, 4));
                    int month = Integer.parseInt(lineTest.split("<DTPOSTED>")[1].substring(4, 6));
                    int day = Integer.parseInt(lineTest.split("<DTPOSTED>")[1].substring(6, 8));
                    date = new GDDate(day, month, year);
//                } else if (lineTest.contains("CHKNUM")) {
//                    description = "Documento " + lineTest.split("<CHKNUM>")[1] + " - " + description;
                } else if (lineTest.contains("FITID")) {
                  if(lineTest.split("<FITID>").length == 0){
                    bankOperationNumber += 0 + " = "+date.getFormatedDate().trim()+" = "+value.replace(",", ".").trim();
                        description = "Documento " + 0 + " - " + description;
                  }else{
                    String idOperation = lineTest.split("<FITID>")[1];
                   
            description = "Documento " + idOperation + " - " + description;
                    bankOperationNumber = idOperation.trim();
                    bankOperationNumber += " = " + date.getFormatedDate().trim() + " = " + value.replace(",", ".").trim();
                  }
                } else if (lineTest.contains("ACCTID")) {
                  String accountNumber = lineTest.split("<ACCTID>")[1];
                  try {
                    List<Account> accounts = (List<Account>) system.query(new GetBankAccountsByNumber(accountNumber));
View Full Code Here

  private Expenditure getRelatedExpenditure(String bankOperationNumber, String description, String value, GDDate date) {
      try {
        Map<String, Expenditure> expenditures = (Map<String, Expenditure>) system.query(new GetExpenditures());
       
        for (Expenditure expenditure : expenditures.values()) {
          GDDate incomingDate = new GDDate(expenditure.getNextPaymentDate());
          incomingDate.addDays(-3);
         
          GDDate endDate = new GDDate(expenditure.getNextPaymentDate());
          endDate.addDays(3);
         
        if((date.afterDay(incomingDate) && date.beforeDay(endDate))
            && new Money("-"+ expenditure.getValue()).equals(new Money(value)))
        {
          return expenditure;
View Full Code Here

TOP

Related Classes of br.com.visualmidia.business.GDDate

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.