Beispiel #1
0
 public MigrateData(DbTypesEnum toDbType, string tableName)
 {
     tableSet           = toDbType == DbTypesEnum.Oracle ? new MsSqlTableSet() : new OracleTableSet();
     tableSet.MsRows    = this.MsRows;
     tableSet.OraRows   = this.OracleRows;
     tableSet.TableName = tableName;
 }
        public static bool ContainsTableName(DbTypesEnum dbType, string tableName)
        {
            IDictionary <string, TablePair> tableNameDictionary = dbType == DbTypesEnum.MsSql
                                                                     ? MsSqlTableNameDictionary
                                                                     : OracleTableNameDictionary;

            return(tableNameDictionary.ContainsKey(tableName));
        }
        void Create(DbTypesEnum enumValue)
        {
            var type = ByteParserFactory.Create(enumValue);
            SingleFieldExplporer newItem = new SingleFieldExplporer();

            newItem.EnumValue                  = enumValue;
            newItem.CustomDisplayText          = type.TypeName;
            newItem.ButtonText                 = "Add";
            newItem.CustomButtonPressedCommand = new RelayCommand <SingleFieldExplporer>(OnButtonPressed);
            Fields.Add(newItem);
        }
        public static TablePair FindByTableName(DbTypesEnum dbType, string tableName)
        {
            IDictionary <string, TablePair> tableNameDictionary = dbType == DbTypesEnum.MsSql
                                                                     ? MsSqlTableNameDictionary
                                                                     : OracleTableNameDictionary;

            if (!tableNameDictionary.ContainsKey(tableName))
            {
                throw new KeyNotFoundException();
            }

            return(tableNameDictionary[tableName]);
        }
        public void AddNewDefinitionItem(DbTypesEnum type = DbTypesEnum.Integer)
        {
            if (_tableDefinitionModel.Definition == null)
            {
                return;
            }

            _tableDefinitionModel.Definition.ColumnDefinitions.Add(new DbColumnDefinition()
            {
                Name = "Unknown Field", Type = type
            });
            _tableDefinitionModel.TriggerUpdates();
            Update();
        }
Beispiel #6
0
        public static IByteParser Create(DbTypesEnum typeEnum)
        {
            switch (typeEnum)
            {
            case DbTypesEnum.String:
                return(ByteParsers.String);

            case DbTypesEnum.String_ascii:
                return(ByteParsers.StringAscii);

            case DbTypesEnum.Optstring:
                return(ByteParsers.OptString);

            case DbTypesEnum.Optstring_ascii:
                return(ByteParsers.OptStringAscii);

            case DbTypesEnum.Integer:
                return(ByteParsers.Int32);

            case DbTypesEnum.Int64:
                return(ByteParsers.Int64);

            case DbTypesEnum.Short:
                return(ByteParsers.Short);

            case DbTypesEnum.UShort:
                return(ByteParsers.UShort);

            case DbTypesEnum.Single:
                return(ByteParsers.Single);

            case DbTypesEnum.Float16:
                return(ByteParsers.Float16);

            case DbTypesEnum.Boolean:
                return(ByteParsers.Bool);

            case DbTypesEnum.uint32:
                return(ByteParsers.UInt32);

            case DbTypesEnum.Byte:
                return(ByteParsers.Byte);

            case DbTypesEnum.List:
                throw new NotImplementedException();
            }
            throw new NotImplementedException();
        }