예제 #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);
            }
        }
예제 #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);
            }
        }
예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #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;
 }
예제 #7
0
 public override DateTime Dbms2NetDate(IGxDbCommand cmd, IDataRecord DR, int i)
 {
     return(Dbms2NetDateTime(DR.GetDateTime(i), false));
 }
예제 #8
0
 public override IGeographicNative Dbms2NetGeo(IGxDbCommand cmd, IDataRecord DR, int i)
 {
     return(new Geospatial(DR.GetString(i)));
 }