Пример #1
0
        public override EVRWResult AccessData(AccessDataType dataType, int data, object obj)
        {
            string sObj = Convert.ToString(obj);

            VerifyResult(_cco.AccessData((int)dataType, ref data, ref sObj));
            return(new EVRWResult(data, sObj));
        }
Пример #2
0
        private CodeSnippetExpression GetDataType(string type)
        {
            IDataType             de = null;
            CodeSnippetExpression cs = new CodeSnippetExpression();

            switch (this.mOption.DataBaseType)
            {
            case AccessDataBaseType.MsSql:
                de = new MSSQLDataType();
                break;

            case AccessDataBaseType.Access:
                de = new AccessDataType();
                break;
            }
            cs = de.GetDataType(type);

            return(cs);
        }
Пример #3
0
 private static bool IsValidSize(AccessDataType dataType, int size)
 {
     if (dataType != AccessDataType.Text)
     {
         return (size == GetDefaultSize(dataType));
     }
     return ((size >= 1) && (size <= 0xff));
 }
Пример #4
0
 private static bool IsValidNumericScale(AccessDataType dataType, int numericScale, int numericPrecision)
 {
     if (dataType != AccessDataType.Decimal)
     {
         return (numericScale == GetDefaultNumericScale(dataType));
     }
     return ((numericScale >= 0) && (numericScale <= numericPrecision));
 }
Пример #5
0
 private static bool IsValidNumericPrecision(AccessDataType dataType, int numericPrecision)
 {
     if (dataType != AccessDataType.Decimal)
     {
         return (numericPrecision == GetDefaultNumericPrecision(dataType));
     }
     return ((numericPrecision >= 1) && (numericPrecision <= 0x1c));
 }
Пример #6
0
 private static int GetDefaultNumericScale(AccessDataType dataType)
 {
     return 0;
 }
Пример #7
0
        private static int GetDefaultNumericPrecision(AccessDataType dataType)
        {
            switch (dataType)
            {
                case AccessDataType.LongInteger:
                    return 10;

                case AccessDataType.Byte:
                    return 3;

                case AccessDataType.Currency:
                    return 0x13;

                case AccessDataType.Decimal:
                    return 0x12;

                case AccessDataType.Double:
                    return 15;

                case AccessDataType.Integer:
                    return 5;

                case AccessDataType.Single:
                    return 7;
            }
            return 0;
        }
Пример #8
0
        internal static int GetDefaultSize(AccessDataType dataType)
        {
            switch (dataType)
            {
                case AccessDataType.Text:
                    return 50;

                case AccessDataType.YesNo:
                    return 2;
            }
            return 0;
        }
Пример #9
0
 public static bool SupportsSize(AccessDataType dataType)
 {
     AccessDataType type = dataType;
     return (type == AccessDataType.Text);
 }
Пример #10
0
 public static bool SupportsNumericScale(AccessDataType dataType)
 {
     AccessDataType type = dataType;
     return (type == AccessDataType.Decimal);
 }
Пример #11
0
 public static bool SupportsIdentity(AccessDataType dataType)
 {
     AccessDataType type = dataType;
     return (type == AccessDataType.LongInteger);
 }
Пример #12
0
 public static bool SupportsAutoGenerate(AccessDataType dataType)
 {
     AccessDataType type = dataType;
     return (type == AccessDataType.ReplicationID);
 }
Пример #13
0
 public static bool SupportsAllowNulls(AccessDataType dataType)
 {
     if (dataType == AccessDataType.YesNo)
     {
         return false;
     }
     return true;
 }
Пример #14
0
        public static Interop.AdoxDataType ConvertAccessToAdoxDataType(AccessDataType accessType)
        {
            switch (accessType)
            {
                case AccessDataType.ReplicationID:
                    return Interop.AdoxDataType.GUID;

                case AccessDataType.LongInteger:
                    return Interop.AdoxDataType.Integer;

                case AccessDataType.Byte:
                    return Interop.AdoxDataType.UnsignedTinyInt;

                case AccessDataType.Currency:
                    return Interop.AdoxDataType.Currency;

                case AccessDataType.DateTime:
                    return Interop.AdoxDataType.Date;

                case AccessDataType.Decimal:
                    return Interop.AdoxDataType.Numeric;

                case AccessDataType.Double:
                    return Interop.AdoxDataType.Double;

                case AccessDataType.Memo:
                    return Interop.AdoxDataType.LongVarWChar;

                case AccessDataType.Integer:
                    return Interop.AdoxDataType.SmallInt;

                case AccessDataType.OleObject:
                    return Interop.AdoxDataType.LongVarBinary;

                case AccessDataType.Single:
                    return Interop.AdoxDataType.Single;

                case AccessDataType.Text:
                    return Interop.AdoxDataType.VarWChar;

                case AccessDataType.YesNo:
                    return Interop.AdoxDataType.Boolean;
            }
            throw new ArgumentException();
        }