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