コード例 #1
0
ファイル: Result.cs プロジェクト: cwdotson/FwNs
 public void SetSession(ISessionInterface session)
 {
     if (this.navigator != null)
     {
         this.navigator.SetSession(session);
     }
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        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));
        }
コード例 #4
0
ファイル: BooleanType.cs プロジェクト: cwdotson/FwNs
 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));
 }
コード例 #5
0
ファイル: IntervalType.cs プロジェクト: cwdotson/FwNs
        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);
        }
コード例 #6
0
ファイル: BinaryType.cs プロジェクト: cwdotson/FwNs
        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));
        }
コード例 #7
0
ファイル: IntervalType.cs プロジェクト: cwdotson/FwNs
        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));
        }
コード例 #8
0
ファイル: BlobType.cs プロジェクト: cwdotson/FwNs
        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);
        }
コード例 #9
0
ファイル: BlobType.cs プロジェクト: cwdotson/FwNs
        public override object ConvertSQLToCSharp(ISessionInterface session, object a)
        {
            IBlobData data1  = (IBlobData)a;
            int       length = (int)data1.Length(session);

            return(data1.GetBytes(session, 0L, length));
        }
コード例 #10
0
ファイル: ArrayType.cs プロジェクト: cwdotson/FwNs
        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);
        }
コード例 #11
0
        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)));
        }
コード例 #12
0
        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();
        }
コード例 #13
0
 public PainViewController(OneDirectContext context, ILogger <PainViewController> plogger)
 {
     logger                          = plogger;
     this.context                    = context;
     lISessionRepository             = new SessionRepository(context);
     lIPainRepository                = new PainRepository(context);
     lIEquipmentAssignmentRepository = new AssignmentRepository(context);
 }
コード例 #14
0
ファイル: BinaryData.cs プロジェクト: cwdotson/FwNs
 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;
     }
 }
コード例 #15
0
 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;
 }
コード例 #16
0
ファイル: OtherType.cs プロジェクト: cwdotson/FwNs
 public override object ConvertSQLToCSharp(ISessionInterface session, object a)
 {
     if (a == null)
     {
         return(null);
     }
     return(((OtherData)a).GetObject());
 }
コード例 #17
0
ファイル: OtherType.cs プロジェクト: cwdotson/FwNs
 public override object ConvertToDefaultType(ISessionInterface session, object a)
 {
     if (!a.GetType().IsSerializable)
     {
         throw Error.GetError(0x15b9);
     }
     return(a);
 }
コード例 #18
0
 private int GetLength(ISessionInterface session, object o)
 {
     if (this.IsBinary)
     {
         return((int)((BinaryData)o).Length(session));
     }
     return(((string)o).Length);
 }
コード例 #19
0
ファイル: BinaryType.cs プロジェクト: cwdotson/FwNs
 public override object ConvertSQLToCSharp(ISessionInterface session, object a)
 {
     if (a == null)
     {
         return(null);
     }
     return(((IBlobData)a).GetBytes());
 }
コード例 #20
0
ファイル: SqlType.cs プロジェクト: cwdotson/FwNs
 public virtual object ConvertToTypeAdo(ISessionInterface session, object a, SqlType otherType)
 {
     if (otherType.IsLobType())
     {
         throw Error.GetError(0x15b9);
     }
     return(this.ConvertToType(session, a, otherType));
 }
コード例 #21
0
 public override object ConvertToType(ISessionInterface session, object a, SqlType othType)
 {
     if (a == null)
     {
         return(a);
     }
     return(this.CastOrConvertToType(session, a, othType, false));
 }
コード例 #22
0
 public long Size(ISessionInterface session, object data)
 {
     if (base.TypeCode == 40)
     {
         return(((IClobData)data).Length(session));
     }
     return(((string)data).Length);
 }
コード例 #23
0
ファイル: BinaryData.cs プロジェクト: cwdotson/FwNs
 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));
 }
コード例 #24
0
 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);
 }
コード例 #25
0
ファイル: UtlConnection.cs プロジェクト: cwdotson/FwNs
 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;
 }
コード例 #26
0
 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);
 }
コード例 #27
0
        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();
            }
        }
コード例 #28
0
ファイル: BinaryData.cs プロジェクト: cwdotson/FwNs
 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);
 }
コード例 #29
0
        public override object ConvertToDefaultType(ISessionInterface session, object a)
        {
            if (a == null)
            {
                return(a);
            }
            string str = a.ToString();

            return(this.ConvertToType(session, str, SqlType.SqlVarchar));
        }
コード例 #30
0
 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);
 }
コード例 #31
0
 public VeraMasterClass(ISessionInterface session, Action<MessageTypeEnum, string> messageCallBack)
 {
     this.Session = session;
     this.MessageCallBack = messageCallBack;
 }