Esempio n. 1
0
 private void Initialize(MethodGenerateOption option)
 {
     this.mOption       = option;
     this.mCmd          = new CodeVariableDeclarationStatement(this.mOption.CommandName, "cmd");
     this.mSql          = new CodeVariableDeclarationStatement(typeof(string), "sqlStr");
     this.mDr           = new CodeVariableDeclarationStatement(this.mOption.DataReaderName, "dr");
     this.MemberMethods = new List <CodeMemberMethod>();
 }
Esempio n. 2
0
        public void CreateMethod(MethodGenerateOption option)
        {
            this.Initialize(option);

            switch (option.MethodType)
            {
            default:
            case MethodType.Select:
                this.CreateSelect();
                break;

            case MethodType.Insert:
                this.CreateInset();
                break;

            case MethodType.Update:
                this.CreateUpdate();
                break;
            }
        }
Esempio n. 3
0
        public void MethodContent(DataTable dt, MethodType methodType, bool enableDataObjectMethod)
        {
            MethodGenerator      mg;
            MethodGenerateOption option = new MethodGenerateOption
            {
                CommandName    = this.m_Option.CommandName,
                DataBaseType   = this.DataBaseType,
                DataReaderName = this.m_Option.DataReaderName,
                DataTable      = dt,
                KeyColunmNames = this.m_keyColumnNames,
                SchemaKeyName  = this.m_Option.SchemaKeyName,
                TableName      = this.m_Option.TableName,
                MethodType     = methodType
            };

            mg = new MethodGenerator();
            mg.CreateMethod(option);

            this.m_MemberMethods = mg.MemberMethods;
        }