Beispiel #1
0
        public void Assign( ISchemaType newvalue )
        {
            if( newvalue == null )
            {
                SetEmpty(true);
                SetNull(true);
                return;
            }

            if( newvalue.IsEmpty() )
            {
                Reset();
                SetEmpty(true);
                SetNull(newvalue.IsNull());
                return;
            }
            isEmpty = false;
            isNull = false;
            if( newvalue is SchemaDateTime )
            {
                System.DateTime dtNow = System.DateTime.Now;
                System.DateTime dt = ((SchemaDateTime)newvalue).Value;
                myValue = new System.DateTime( dtNow.Year, dtNow.Month, dtNow.Day, dt.Hour, dt.Minute, dt.Second, dt.Millisecond );
                eTZ = ((SchemaDateTime)newvalue).HasTimezone;
                offsetTZ = ((SchemaDateTime)newvalue).TimezoneOffset;
            }
            else if( newvalue is SchemaTime )
            {
                System.DateTime dtNow = System.DateTime.Now;
                System.DateTime dt = ((SchemaTime)newvalue).Value;
                myValue = new System.DateTime( dtNow.Year, dtNow.Month, dtNow.Day, dt.Hour, dt.Minute, dt.Second, dt.Millisecond );
                eTZ = ((SchemaTime)newvalue).HasTimezone;
                offsetTZ = ((SchemaTime)newvalue).offsetTZ;
            }
            else if( newvalue is SchemaString )
                Parse( newvalue.ToString() );
            else
            {
                try
                {
                    Parse( newvalue.ToString() );
                }
                catch (StringParseException)
                {
                    throw new TypesIncompatibleException( newvalue, this );
                }
            }
        }
Beispiel #2
0
        public void Assign( ISchemaType newvalue )
        {
            if( newvalue == null )
            {
                SetNull(true);
                SetEmpty(true);
                return;
            }

            if( newvalue.IsEmpty() )
            {
                SetEmpty(true);
                SetNull( newvalue.IsNull() );
                return;
            }

            Parse(newvalue.ToString());
        }
Beispiel #3
0
        public void Assign( ISchemaType newvalue )
        {
            if( newvalue == null )
            {
                SetNull( true );
                SetEmpty( true );
                return;
            }

            if( newvalue.IsEmpty() )
            {
                myValue = 0;
                SetNull( newvalue.IsNull() );
                SetEmpty( true );
                return;
            }
            if( newvalue is ISchemaTypeNumber )
            {
                isEmpty = false;
                isNull = false;
                myValue = ((ISchemaTypeNumber)newvalue).LongValue();
            }
            else
                throw new TypesIncompatibleException(newvalue, this);
        }
Beispiel #4
0
        public void Assign( ISchemaType newvalue )
        {
            if( newvalue == null )
            {
                SetNull(true);
                SetEmpty(true);
                myValue = "";
                return;
            }

            if( newvalue.IsEmpty() )
            {
                isEmpty = true;
                SetNull( newvalue.IsNull() );
                myValue = "";
                return;
            }
            myValue = newvalue.ToString();
            isEmpty = (myValue.Length == 0 );
            isNull = false;
        }
Beispiel #5
0
        public void Assign( ISchemaType newvalue )
        {
            if( newvalue == null )
            {
                SetNull(true);
                SetEmpty(true);
                return;
            }

            if( newvalue.IsEmpty() )
            {
                SetEmpty(true);
                SetNull(newvalue.IsNull());
                return;
            }

            if( newvalue is SchemaBinaryBase )
            {
                SchemaBinaryBase obj = ((SchemaBinaryBase)newvalue);
                myValue = obj.Value;
                isEmpty = obj.IsEmpty();
            }
            else
            {
                try
                {
                    Parse( newvalue.ToString() );
                }
                catch (StringParseException)
                {
                    throw new TypesIncompatibleException( newvalue, this );
                }
            }
        }
Beispiel #6
0
        public void Assign( ISchemaType newvalue )
        {
            if( newvalue == null )
            {
                SetEmpty(true);
                SetNull(true);
                return;
            }

            if( newvalue.IsEmpty() )
            {
                myValue = new TimeSpan(0);
                months = 0;
                years = 0;
                SetEmpty( true );
                SetNull( newvalue.IsNull() );
                return;
            }
            isEmpty = false;
            if( newvalue is SchemaDuration )
            {
                myValue = ((SchemaDuration)newvalue).myValue;
                months = ((SchemaDuration)newvalue).months;
                years = ((SchemaDuration)newvalue).years;
                isEmpty = ((SchemaDuration)newvalue).isEmpty;
                isNull = ((SchemaDuration)newvalue).isNull;
            }
            else if( newvalue is SchemaString )
                Parse( newvalue.ToString() );
            else
            {
                try
                {
                    Parse( newvalue.ToString() );
                }
                catch (StringParseException)
                {
                    throw new TypesIncompatibleException( newvalue, this );
                }
            }
        }
Beispiel #7
0
        public void Assign( ISchemaType newvalue )
        {
            if( newvalue == null )
            {
                SetNull(true);
                SetEmpty(true);
                return;
            }

            if( newvalue.IsEmpty() )
            {
                Value = System.DateTime.Now; // actual date and time
                isEmpty = true;
                SetNull( newvalue.IsNull() );
                return;
            }
            if( newvalue is SchemaDateTime )
            {
                SchemaDateTime dt = ((SchemaDateTime)newvalue);
                myValue = dt.myValue;
                eTZ = dt.eTZ;
                offsetTZ = dt.offsetTZ;
                isEmpty = dt.isEmpty;
                isNull = dt.isNull;
            }
            else if( newvalue is SchemaDate )
            {
                System.DateTime dt = ((SchemaDate)newvalue).Value;
                myValue = new System.DateTime( dt.Year, dt.Month, dt.Day, 0, 0, 0);
                eTZ = ETZ.Missing;
                offsetTZ = 0;
                isEmpty = newvalue.IsEmpty();
                isNull = newvalue.IsNull();
            }
            else
            {
                try
                {
                    Parse( newvalue.ToString() );
                }
                catch (StringParseException)
                {
                    throw new TypesIncompatibleException( newvalue, this );
                }
            }
        }
Beispiel #8
0
        public void Assign( ISchemaType newvalue )
        {
            if( newvalue == null )
            {
                SetNull(true);
                SetEmpty(true);
                return;
            }

            if( newvalue.IsEmpty() )
            {
                Reset();
                isEmpty = true;
                SetNull( newvalue.IsNull() );
                return;
            }
            isEmpty = false;
            isNull = false;
            if( newvalue is SchemaDate )
            {
                System.DateTime dt = ((SchemaDate)newvalue).Value;
                myValue = new System.DateTime( dt.Year, dt.Month, dt.Day );
                eTZ = ETZ.Missing;
                offsetTZ = 0;
            }
            else if( newvalue is SchemaDateTime )
            {
                System.DateTime dt = ((SchemaDateTime)newvalue).Value;
                myValue = new System.DateTime( dt.Year, dt.Month, dt.Day );
                eTZ = ETZ.Missing;
                offsetTZ = 0;
            }
            else if( newvalue is SchemaString )
            {
                Parse( newvalue.ToString() );
            }
            else
            {
                try
                {
                    Parse( newvalue.ToString() );
                }
                catch (StringParseException)
                {
                    throw new TypesIncompatibleException( newvalue, this );
                }
            }
        }
Beispiel #9
0
		public void Assign( ISchemaType newvalue )
		{
			if( newvalue == null || newvalue.IsEmpty() ) 
			{
				Value = DateTime.Now; // actual date and time
				isEmpty = true;
				isNull = true;
				return;
			}
			if( newvalue is SchemaDateTime )
			{
				SchemaDateTime dt = ((SchemaDateTime)newvalue);
				myValue = dt.myValue;
				eTZ = dt.eTZ;
				offsetTZ = dt.offsetTZ;
				isEmpty = dt.isEmpty;
				isNull = dt.isNull;
			}
			else if( newvalue is SchemaDate )
			{
				DateTime dt = ((SchemaDate)newvalue).Value;
				myValue = new DateTime( dt.Year, dt.Month, dt.Day, 0, 0, 0);
				eTZ = ETZ.Missing;
				offsetTZ = 0;
				isEmpty = newvalue.IsEmpty();
				isNull = newvalue.IsNull();
			}
			else if( newvalue is SchemaString )
				Parse( newvalue.ToString() );
			else
				throw new TypesIncompatibleException( newvalue, this );
		}