public void SetSession(ISessionInterface session) { if (this.navigator != null) { this.navigator.SetSession(session); } }
public override object ConvertToType(ISessionInterface session, object a, SqlType othType) { if (a == null) { return(null); } if (othType == null) { return(a); } if (!othType.IsRowType()) { throw Error.GetError(0x15ba); } SqlType[] typesArray = ((RowType)othType).GetTypesArray(); if (this._dataTypes.Length != typesArray.Length) { throw Error.GetError(0x15bc); } object[] objArray = (object[])a; object[] objArray2 = new object[objArray.Length]; for (int i = 0; i < objArray.Length; i++) { objArray2[i] = this._dataTypes[i].ConvertToType(session, objArray[i], typesArray[i]); } return(objArray2); }
public virtual long Position(ISessionInterface session, object data, object otherData, SqlType otherType, long offset) { if ((data == null) || (otherData == null)) { return(-1L); } string str = (string)data; if (otherType.TypeCode == 40) { IClobData data2 = (IClobData)otherData; long num2 = data2.Length(session); if ((offset + num2) > str.Length) { return(-1L); } string str2 = data2.GetSubString(session, 0L, (int)num2); return((long)str.IndexOf(str2, (int)offset)); } if (!otherType.IsCharacterType()) { throw Error.RuntimeError(0xc9, "CharacterType"); } string str3 = (string)otherData; long length = str3.Length; if ((offset + length) > str.Length) { return(-1L); } return(str.IndexOf(str3, (int)offset)); }
public override object ConvertToTypeAdo(ISessionInterface session, object a, SqlType otherType) { if (a == null) { return(a); } if (otherType.TypeCode == 0x10) { return(a); } if (otherType.IsLobType()) { throw Error.GetError(0x15b9); } if (otherType.IsCharacterType()) { if ("0".Equals(a)) { return(true); } if ("1".Equals(a)) { return(false); } } return(this.ConvertToType(session, a, otherType)); }
public override object ConvertToTypeLimits(ISessionInterface session, object a) { if (a == null) { return(null); } IntervalMonthData data = a as IntervalMonthData; if (data != null) { if (data.Units > this.GetIntervalValueLimit()) { throw Error.GetError(0xd6b); } } else { IntervalSecondData data2 = a as IntervalSecondData; if ((data2 != null) && (data2.Units > this.GetIntervalValueLimit())) { throw Error.GetError(0xd6b); } } return(a); }
public virtual IBlobData Substring(ISessionInterface session, IBlobData data, long offset, long length, bool hasLength) { long num2; long num = data.Length(session); if (hasLength) { num2 = offset + length; } else { num2 = (num > offset) ? num : offset; } if (offset > num2) { throw Error.GetError(0xd67); } if ((offset > num2) || (num2 < 0L)) { offset = 0L; num2 = 0L; } if (offset < 0L) { offset = 0L; } if (num2 > num) { num2 = num; } length = num2 - offset; return(new BinaryData(data.GetBytes(session, offset, (int)length), false)); }
public override object ConvertSQLToCSharp(ISessionInterface session, object a) { switch (base.TypeCode) { case 0x65: case 0x66: case 0x6b: return(new MonthSpan((int)((IntervalMonthData)a).Units)); case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6c: case 0x6d: case 110: case 0x6f: case 0x70: case 0x71: { IntervalSecondData data = (IntervalSecondData)a; return(new TimeSpan((((int)data.Units) * 0x989680L) + (data.Nanos / 100))); } } return(base.ConvertSQLToCSharp(session, a)); }
public override object ConvertToType(ISessionInterface session, object a, SqlType othType) { if (a == null) { return(null); } if (othType.TypeCode == 30) { return(a); } if ((othType.TypeCode == 60) || (othType.TypeCode == 0x3d)) { IBlobData data = (IBlobData)a; BlobDataId id1 = session.CreateBlob(data.Length(session)); id1.SetBytes(session, 0L, data.GetBytes()); return(id1); } if ((othType.TypeCode != 12) && (othType.TypeCode != 1)) { throw Error.GetError(0x15b9); } IBlobData data2 = session.GetScanner().ConvertToBinary((string)a); BlobDataId id2 = session.CreateBlob(data2.Length(session)); id2.SetBytes(session, 0L, data2.GetBytes()); return(id2); }
public override object ConvertSQLToCSharp(ISessionInterface session, object a) { IBlobData data1 = (IBlobData)a; int length = (int)data1.Length(session); return(data1.GetBytes(session, 0L, length)); }
public override object ConvertToType(ISessionInterface session, object a, SqlType othType) { if (a == null) { return(null); } if (othType == null) { return(a); } if (!othType.IsArrayType()) { throw Error.GetError(0x15ba); } object[] objArray = (object[])a; if (objArray.Length > this._maxCardinality) { throw Error.GetError(0xda3); } SqlType other = othType.CollectionBaseType(); if (this._dataType.Equals(other)) { return(a); } object[] objArray2 = new object[objArray.Length]; for (int i = 0; i < objArray.Length; i++) { objArray2[i] = this._dataType.ConvertToType(session, objArray[i], other); } return(objArray2); }
public override object ConvertSQLToCSharp(ISessionInterface session, object a) { IClobData data1 = (IClobData)a; int length = (int)data1.Length(session); return(new string(data1.GetChars(session, 0L, length))); }
public override DateTime GetDateTime(int i) { this.CheckNull(i); ISessionInterface sessionProxy = this._command.Connection.InnerConnection.SessionProxy; switch (this._rResult.MetaData.ColumnTypes[i].TypeCode) { case 0x5b: { TimestampData columnInType = (TimestampData)this.GetColumnInType(i, SqlType.SqlDate); if (columnInType == null) { throw new InvalidCastException(); } return((DateTime)SqlType.SqlDate.ConvertSQLToCSharp(sessionProxy, columnInType)); } case 0x5c: { TimeData columnInType = (TimeData)this.GetColumnInType(i, SqlType.SqlTime); if (columnInType == null) { throw new InvalidCastException(); } return((DateTime)SqlType.SqlTime.ConvertSQLToCSharp(sessionProxy, columnInType)); } case 0x5d: { TimestampData columnInType = (TimestampData)this.GetColumnInType(i, SqlType.SqlTimestamp); if (columnInType == null) { throw new InvalidCastException(); } return((DateTime)SqlType.SqlTimestamp.ConvertSQLToCSharp(sessionProxy, columnInType)); } case 0x5e: { TimeData columnInType = (TimeData)this.GetColumnInType(i, SqlType.SqlTimeWithTimeZone); if (columnInType == null) { throw new InvalidCastException(); } return((DateTime)SqlType.SqlTimeWithTimeZone.ConvertSQLToCSharp(sessionProxy, columnInType)); } case 0x5f: { TimestampData columnInType = (TimestampData)this.GetColumnInType(i, SqlType.SqlTimestampWithTimeZone); if (columnInType == null) { throw new InvalidCastException(); } return((DateTime)SqlType.SqlTimestampWithTimeZone.ConvertSQLToCSharp(sessionProxy, columnInType)); } } throw new InvalidCastException(); }
public PainViewController(OneDirectContext context, ILogger <PainViewController> plogger) { logger = plogger; this.context = context; lISessionRepository = new SessionRepository(context); lIPainRepository = new PainRepository(context); lIEquipmentAssignmentRepository = new AssignmentRepository(context); }
public void Truncate(ISessionInterface session, long len) { if (this._data.Length > len) { this._data = ArrayUtil.ResizeArray <byte>(this._data, (int)len); this._bitLength = this._data.Length * 8; } }
public UtlConnectionProxy(ISessionInterface sessionProxy, UtlConnectionOptions connectionOptions, UtlConnection owner) { this.SessionProxy = sessionProxy; this.ConnectionOptions = connectionOptions; this.Owner = owner; this.Created = DateTime.UtcNow.Ticks; this.IsPooled = false; }
public override object ConvertSQLToCSharp(ISessionInterface session, object a) { if (a == null) { return(null); } return(((OtherData)a).GetObject()); }
public override object ConvertToDefaultType(ISessionInterface session, object a) { if (!a.GetType().IsSerializable) { throw Error.GetError(0x15b9); } return(a); }
private int GetLength(ISessionInterface session, object o) { if (this.IsBinary) { return((int)((BinaryData)o).Length(session)); } return(((string)o).Length); }
public override object ConvertSQLToCSharp(ISessionInterface session, object a) { if (a == null) { return(null); } return(((IBlobData)a).GetBytes()); }
public virtual object ConvertToTypeAdo(ISessionInterface session, object a, SqlType otherType) { if (otherType.IsLobType()) { throw Error.GetError(0x15b9); } return(this.ConvertToType(session, a, otherType)); }
public override object ConvertToType(ISessionInterface session, object a, SqlType othType) { if (a == null) { return(a); } return(this.CastOrConvertToType(session, a, othType, false)); }
public long Size(ISessionInterface session, object data) { if (base.TypeCode == 40) { return(((IClobData)data).Length(session)); } return(((string)data).Length); }
public long Position(ISessionInterface session, IBlobData pattern, long start) { if (pattern.Length(session) > this._data.Length) { return(-1L); } byte[] bytes = pattern.GetBytes(); return(this.Position(session, bytes, start)); }
public PainController(OneDirectContext context, ILogger <PainController> plogger, IPainInterface IPainRepository) { logger = plogger; this.context = context; IPatient = new PatientRepository(context); lISessionRepository = new SessionRepository(context); lIPainRepository = IPainRepository; lIEquipmentAssignmentRepository = new AssignmentRepository(context); }
public UtlConnection(ISessionInterface sessionProxy) { this._connectionState = ConnectionState.Closed; this._connectionOptions = new UtlConnectionOptions(); this._connectionString = string.Empty; this.Version += 1L; this.InnerConnection = new UtlConnectionProxy(sessionProxy, this._connectionOptions, this); this._connectionState = ConnectionState.Open; }
public DeviceCalibrationController(OneDirectContext context, ILogger <DeviceCalibrationController> plogger) { logger = plogger; this.context = context; lIUserRepository = new UserRepository(context); IPatient = new PatientRepository(context); lISessionRepository = new SessionRepository(context); lIDeviceCalibrationRepository = new DeviceCalibrationRepository(context); lIEquipmentAssignmentRepository = new AssignmentRepository(context); }
public void Truncate(ISessionInterface session, long len) { ResultLob r = ResultLob.NewLobTruncateRequest(this._id, len); Result result = session.Execute(r); if (result.IsError()) { throw result.GetException(); } }
public byte[] GetBytes(ISessionInterface session, long pos, int length) { if (!IsInLimits((long)this._data.Length, pos, (long)length)) { throw new IndexOutOfRangeException(); } byte[] destinationArray = new byte[length]; Array.Copy(this._data, (int)pos, destinationArray, 0, length); return(destinationArray); }
public override object ConvertToDefaultType(ISessionInterface session, object a) { if (a == null) { return(a); } string str = a.ToString(); return(this.ConvertToType(session, str, SqlType.SqlVarchar)); }
public SessionViewController(OneDirectContext context, ILogger <SessionViewController> plogger) { logger = plogger; this.context = context; IRomChangeLog = new RomChangeLogRepository(context); IPatientRx = new PatientRxRepository(context); lIUserRepository = new UserRepository(context); lISessionInterface = new SessionRepository(context); INewPatient = new NewPatientRepository(context); }
public VeraMasterClass(ISessionInterface session, Action<MessageTypeEnum, string> messageCallBack) { this.Session = session; this.MessageCallBack = messageCallBack; }