Exemplo n.º 1
0
        /// <summary>
        /// 取得程式碼產生物件的實體
        /// </summary>
        private void GetCodeBase()
        {
            List <string>   keys = new List <string>();
            GeneratorOption option;

            foreach (object key in clbKeys.CheckedItems)
            {
                keys.Add(key.ToString());
            }

            option = new GeneratorOption
            {
                ConnectionString = paramsEditor1.CurrentConnectionString,
                TableName        = paramsEditor1.CurrentTableName,
                SchemaKeyName    = "IsKeyColumn",
                KeyColunmNames   = keys
            };

            switch (paramsEditor1.CurrentDbType)
            {
            default:
            case "MSSQL":
                this.m_CodeGenerator = new CodeGeneratorMsSql(option);
                break;

            case "Access":
                this.m_CodeGenerator = new CodeGeneratorAccess(option);
                break;
            }
        }
 public void LoadOptions(GeneratorOption option)
 {
     this.Length         = option.Length;
     this.SmallLetters   = option.SmallLetters;
     this.CapitalLetters = option.SmallLetters;
     this.Digits         = option.Digits;
     this.SpecialChars   = option.SpecialChars;
     Generate();
 }
Exemplo n.º 3
0
        private void CreateGenerator()
        {
            GeneratorOption option = new GeneratorOption
            {
                ConnectionString = paramsEditor1.CurrentConnectionString,
                TableName        = paramsEditor1.CurrentTableName
            };

            switch (paramsEditor1.CurrentDbType)
            {
            default:
            case "MSSQL":
                this.m_CodeGenerator = new CodeGeneratorMsSql(option);
                break;

            case "Access":
                this.m_CodeGenerator = new CodeGeneratorAccess(option);
                break;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 取得程式碼產生物件的實體
        /// </summary>
        protected void GetCodeBase()
        {
            string          keyName = string.Empty;
            List <string>   keys    = new List <string>();
            GeneratorOption option;

            //主索引值的Column Name
            if (!string.IsNullOrEmpty(txtSchemaKeyName.Text))
            {
                keyName = txtSchemaKeyName.Text;
            }
            else
            {
                keyName = "IsKey";
            }
            //自定的主索引值
            foreach (object key in clbkeys.CheckedItems)
            {
                keys.Add(key.ToString());
            }

            option = new GeneratorOption
            {
                ConnectionString = paramsEditor1.CurrentConnectionString,
                TableName        = paramsEditor1.CurrentTableName,
                SchemaKeyName    = keyName,
                KeyColunmNames   = keys
            };

            switch (paramsEditor1.CurrentDbType)
            {
            default:
            case "MSSQL":
                this.m_CodeGenerator = new CodeGeneratorMsSql(option);
                break;

            case "Access":
                this.m_CodeGenerator = new CodeGeneratorAccess(option);
                break;
            }
        }
Exemplo n.º 5
0
 public CodeGeneratorMsSql(GeneratorOption option) : base(option)
 {
 }
Exemplo n.º 6
0
 public CodeGeneratorAccess(GeneratorOption option) : base(option)
 {
 }