Exemplo n.º 1
0
        public override Guid GetGuid(IGxDbCommand cmd, IDataRecord DR, int i)
        {
            string guid = base.GetString(cmd, DR, i);

            try
            {
                return(new Guid(guid));
            }
            catch (FormatException)
            {
                return(Guid.Empty);
            }
        }
Exemplo n.º 2
0
        public override IGeographicNative GetGeospatial(IGxDbCommand cmd, IDataRecord DR, int i)
        {
            if (!cmd.HasMoreRows || DR == null || DR.IsDBNull(i))
            {
                return(new Geospatial());
            }
            else
            {
                Geospatial gtmp   = new Geospatial();
                String     geoStr = DR.GetString(i);

                gtmp.FromString(geoStr);
                return(gtmp);
            }
        }
Exemplo n.º 3
0
 public override IGeographicNative GetGeospatial(IGxDbCommand cmd, IDataRecord DR, int i)
 {
     if (!cmd.HasMoreRows || DR == null || DR.IsDBNull(i))
     {
         return(new Geospatial());
     }
     else
     {
         Geospatial gtmp   = new Geospatial();
         String[]   geoStr = DR.GetValue(i).ToString().Split(new char[] { ';' }, 2);
         String[]   srId   = geoStr[0].Split(new char[] { '=' }, 2);
         gtmp.Srid = Int16.Parse(srId[1]);
         gtmp.FromString(geoStr[1]);
         return(gtmp);
     }
 }
Exemplo n.º 4
0
 public override string GetString(IGxDbCommand cmd, IDataRecord DR, int i, int size)
 {
     if (!cmd.HasMoreRows || DR == null || DR.IsDBNull(i))
     {
         return(string.Empty);
     }
     else
     {
         string value = DR.GetString(i);
         if (value != null && value.Length < size)
         {
             value = value.PadRight(size);
         }
         return(value);
     }
 }
Exemplo n.º 5
0
 public override long GetBytes(IGxDbCommand cmd, IDataRecord DR, int i, long fieldOffset, byte[] buffer, int bufferOffset, int length)
 {
     if (!cmd.HasMoreRows || DR == null || DR.IsDBNull(i))
     {
         return(0);
     }
     else
     {
         if (fieldOffset == 0)
         {
             _buffer = (byte[])DR.GetValue(i);
         }
         int count = 0;
         for (long index = fieldOffset; index < fieldOffset + length && index < _buffer.Length; index++)
         {
             buffer[bufferOffset + count] = _buffer[index];
             count++;
         }
         return(count);
     }
 }
 public GXFatFieldGetter(GxCommand gxDbCommand)
 {
     _gxDbCommand = gxDbCommand;
 }
Exemplo n.º 7
0
 public override DateTime Dbms2NetDate(IGxDbCommand cmd, IDataRecord DR, int i)
 {
     return(Dbms2NetDateTime(DR.GetDateTime(i), false));
 }
Exemplo n.º 8
0
 public override IGeographicNative Dbms2NetGeo(IGxDbCommand cmd, IDataRecord DR, int i)
 {
     return(new Geospatial(DR.GetString(i)));
 }