コード例 #1
0
        private void BLLGenerate()
        {
            var sbTemp = new StringBuilder();

            if (rbPreview.Checked)
            {
                DbOperateBase dbOperateBase = new BLLControl(this.listCheckedTables[0].TabPascalName, this.prefixNameSpace, this.prefixClass,
                                                             this.prefixModel, this.checkedListBox1);
                sbTemp                    = dbOperateBase.Generate();
                rtbPreview.Text           = sbTemp.ToString();
                tabControl1.SelectedIndex = 1;
            }
            else //Generate File
            {
                foreach (Table t in this.listCheckedTables)
                {
                    DbOperateBase dbOperateBase = new BLLControl(this.listCheckedTables[0].TabPascalName, this.prefixNameSpace, this.prefixClass,
                                                                 this.prefixModel, this.checkedListBox1);
                    sbTemp = dbOperateBase.Generate();
                    generateFile("BLL", t.TabPascalName, sbTemp);
                }
                if (sbTemp.ToString() == string.Empty)
                {
                    return;
                }
                openGenerateFile("Success in generate Business Layer Files!", "C:\\GeneFile\\BLL\\");
            }
        }