Exemplo n.º 1
0
            public RecordAsMFNodeAdapter(IDataReader reader)
            {
                for (int i = 0; i != reader.FieldCount; ++i)
                {
                    if (reader.GetDataTypeName(i).ToLower() == "xml")
                    {
                        long   l = reader.GetBytes(i, 0, null, 0, 0);
                        byte[] b = new byte[l];
                        try
                        {
                            reader.GetBytes(i, 0, b, 0, (int)l);
                        }
                        catch (System.InvalidCastException x)
                        {
                            // Workaround for DB2 NULL values in XML.
                            continue;
                        }

                        dictionary.Add(reader.GetName(i), b);
                    }
                    else
                    {
                        if (!reader.IsDBNull(i))
                        {
                            object value = reader.GetValue(i);

                            // promote datetimes
                            if (value is DateTime)
                            {
                                value = new Altova.Types.DateTime((DateTime)value);
                            }

                            dictionary.Add(reader.GetName(i), value);
                        }
                    }
                }
            }
Exemplo n.º 2
0
 public static void SetValue(XmlNode node, MemberInfo member, Altova.Types.DateTime b)
 {
     SetValue(node, member, GetFormatter(member).Format(b));
 }
Exemplo n.º 3
0
 public static void SetParameter(IDataParameter target, Altova.Types.DateTime value)
 {
     target.Value = value.Value;
 }
Exemplo n.º 4
0
 public static void SetValue(RecordBuffer buffer, MemberInfo member, Altova.Types.DateTime value)
 {
     buffer.Set(member.LocalName, value.Value);
 }
Exemplo n.º 5
0
 public static Altova.Types.DateTime CastToDateTime(Altova.Types.DateTime s, Altova.Types.DateTimeFormat format)
 {
     return(s);
 }
Exemplo n.º 6
0
        /*
         * public static Altova.Types.YearMonthDuration CastToYearMonthDuration(string s)
         * {
         *  return Altova.Types.YearMonthDuration.Parse(s);
         * }
         *
         * public static Altova.Types.DayTimeDuration CastToDayTimeDuration(string s)
         * {
         *  return Altova.Types.DayTimeDuration.Parse(s);
         * }
         */

        public static Altova.Types.DateTime CastToDateTime(Altova.Types.DateTime s)
        {
            return(s);
        }
Exemplo n.º 7
0
 public static string CastToString(Altova.Types.DateTime dt, Altova.Types.DateTimeFormat format)
 {
     return(dt.ToString(format));
 }
Exemplo n.º 8
0
 public static string CastToString(Altova.Types.DateTime dt)
 {
     return(dt.ToString());
 }
Exemplo n.º 9
0
 public static DbParam ToDBType(Altova.Types.DateTime dt, DbType type)
 {
     return(new DbParam(dt.Value, type, 0));
 }