Package net.helipilot50.stocktrade.framework

Examples of net.helipilot50.stocktrade.framework.DateTimeData


              cachedRowSet.updateBigDecimal(pColOrdinal, value.getBigDecimal());
            } else if (pValue instanceof BooleanData) {
              BooleanData value = (BooleanData) pValue;
              cachedRowSet.updateBoolean(pColOrdinal, value.getBooleanValue());
            } else if (pValue instanceof DateTimeData) {
              DateTimeData value = (DateTimeData) pValue;
              cachedRowSet.updateDate(pColOrdinal, new Date(value.asDate().getTime()));
            } else if (pValue instanceof BinaryData) {
              BinaryData value = (BinaryData) pValue;
              cachedRowSet.updateBinaryStream(pColOrdinal, new ByteArrayInputStream(value.getValue()), value.getActualSize());
            }
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), net.helipilot50.stocktrade.framework.Constants.SP_ER_USER, net.helipilot50.stocktrade.framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
View Full Code Here


                }
                else if (obj instanceof Date && clazz.equals(String.class)) { // CraigM:05/08/2008 - Map a Date to a String
                  localWrapper.setPropertyValue(descriptorName, obj.toString());
                }
                else if (obj instanceof Timestamp && clazz.equals(String.class)) {
                    DateTimeData dtd = new DateTimeData((Timestamp)obj);
                    localWrapper.setPropertyValue(descriptorName, dtd.toString());
                }
                else {
                    localWrapper.setPropertyValue(descriptorName, obj);
                }
            }
View Full Code Here

     */
        public boolean display(ParameterHolder_DateTimeData DateInput, JComponent pDateField)
        {
            boolean RC = false;
            JComponent DateField = null;
            DateTimeData OldDate = new DateTimeData();
            if (DateInput != null){
                OldDate.setValue((DateTimeData)DateInput.getObject());
                this.fillCalendar(((DateTimeData)DateInput.getObject()));
            }else
                this.fillCalendar(this.getDateInput());
            if (pDateField == null)
                DateField = this.getDateField();
View Full Code Here

            Fmt.setTemplate(new TextData("mmmm - yyyy")); //$NON-NLS-1$
            this.getqq_MonthYear().setText(Fmt.formatDate(DateInput).toString());

            //  Change the color of the label to BLUE if it is the
            //  current month. All other months stays BLACK
            DateTimeData CurrentMonthYear = new DateTimeData();
            CurrentMonthYear.setCurrent();

            if (this.getqq_MonthYear().getText().equals(Fmt.formatDate(CurrentMonthYear))) {
                UIutils.setForeground(this.getqq_MonthYear(), Color.blue);
            }
            else {
                UIutils.setForeground(this.getqq_MonthYear(), Color.black);
            }

            //  Get the current day of the month
            //  so that it can be highlighted
            Fmt.setTemplate(new TextData("d"));
            this.setCurrentDay(Fmt.formatDate(DateInput).getValue());

            //  Find out what day of the week does the 1st of the month fall on
            Fmt.setTemplate(new TextData("m/yyyy")); //$NON-NLS-1$
            TextData FirstOfMonthText = new TextData("1/"); //$NON-NLS-1$
            FirstOfMonthText.concat( Fmt.formatDate(DateInput) );
            Fmt.setTemplate(new TextData("d/m/yyyy"));
            DateTimeData FirstOfMonth = Fmt.decodeDate(FirstOfMonthText);
            int DateStart = FirstOfMonth.dayOfWeek();

            //  Find out how many days are there in this month
            //  Note that we need to deal with leap year
            int DateEnd = 0;

            if (Month.toString().equals("4") || Month.toString().equals("6") || Month.toString().equals("9") || Month.toString().equals("11")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                DateEnd = DateStart+29;
            }
            else if (Month.toString().equals("2")) { //$NON-NLS-1$
                IntervalData Days28 = new IntervalData();
                Days28.addUnit(0, 0, 28, 0, 0, 0, 0);
                FirstOfMonth.add(Days28);
                Fmt.setTemplate(new TextData("m"));
                TextData FebOrMarch = Fmt.formatDate(FirstOfMonth);

                if (FebOrMarch.toString().equals("2")) { //$NON-NLS-1$
                    //  Leap year
View Full Code Here

            if (o == null || resultSet.wasNull()) {
                throw new UsageException(
                        "getDateTimeData(int) could not handle column " + pColumnID + ". Result =" + o,
                        SP_ER_PARAMETERERROR, SP_ER_USER, UsageException.qq_Resolver.cMESSAGE_REASONCODE_SEVERITY);
            }
            DateTimeData dt = new DateTimeData(resultSet.getTimestamp(pColumnID));
            return dt;
        } catch (SQLException e) {
          throw processException(e);
        }
    }
View Full Code Here

            if (o == null || resultSet.wasNull()) {
                throw new UsageException(
                        "getDateTimeData(String) could not handle column " + pColumnName + ". Result =" + o,
                        SP_ER_USER, SP_ER_PARAMETERERROR, UsageException.qq_Resolver.cMESSAGE_REASONCODE_SEVERITY);
            }
            DateTimeData dt = new DateTimeData(resultSet
                    .getTimestamp(pColumnName));
            return dt;
        } catch (SQLException e) {
          throw processException(e);
        }
View Full Code Here

        format = dateFormat;
    }

    protected DataValue setDataValueFromString(DataValue dataValue, String value) throws ParseException
    {
        DateTimeData dateTimeValue = (DateTimeData) dataValue;
        if (value != null && value.length() > 0)
        {
            dateTimeValue.setValue((Date) format.parseObject(value));
        }
        else {
            if (dataValue.isNullable()) {
                dateTimeValue.setNullValue(true);
            }
            else {
                dateTimeValue = null;
            }
        }
View Full Code Here

        return dateTimeValue;
    }

    protected String dataValueToString(DataValue value)
    {
        DateTimeData dateTimeValue = (DateTimeData) value;
        return format.format(dateTimeValue.asDate());
    }
View Full Code Here

              cachedRowSet.updateInt(pColOrdinal, integerValue.getIntegerValue());
            } else if (pValue instanceof DoubleData) {
              DoubleData doubleValue = (DoubleData) pValue;
              cachedRowSet.updateDouble(pColOrdinal, doubleValue.getDoubleValue());
            } else if (pValue instanceof DecimalData) {
              DecimalData value = (DecimalData) pValue;
              cachedRowSet.updateBigDecimal(pColOrdinal, value.getBigDecimal());
            } else if (pValue instanceof BooleanData) {
              BooleanData value = (BooleanData) pValue;
              cachedRowSet.updateBoolean(pColOrdinal, value.getBooleanValue());
            } else if (pValue instanceof DateTimeData) {
              DateTimeData value = (DateTimeData) pValue;
              cachedRowSet.updateDate(pColOrdinal, new Date(value.asDate().getTime()));
            } else if (pValue instanceof BinaryData) {
              BinaryData value = (BinaryData) pValue;
              cachedRowSet.updateBinaryStream(pColOrdinal, new ByteArrayInputStream(value.getValue()), value.getActualSize());
            }
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), net.helipilot50.stocktrade.framework.Constants.SP_ER_USER, net.helipilot50.stocktrade.framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
View Full Code Here

              cachedRowSet.updateString(pColOrdinal, textValue.toString());
            } else if (pValue instanceof IntegerData) {
              IntegerData integerValue = (IntegerData) pValue;
              cachedRowSet.updateInt(pColOrdinal, integerValue.getIntegerValue());
            } else if (pValue instanceof DoubleData) {
              DoubleData doubleValue = (DoubleData) pValue;
              cachedRowSet.updateDouble(pColOrdinal, doubleValue.getDoubleValue());
            } else if (pValue instanceof DecimalData) {
              DecimalData value = (DecimalData) pValue;
              cachedRowSet.updateBigDecimal(pColOrdinal, value.getBigDecimal());
            } else if (pValue instanceof BooleanData) {
              BooleanData value = (BooleanData) pValue;
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.framework.DateTimeData

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.