⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 codemakerm.cs

📁 通过数据库结构自动 生成三层结构代码,相当不错的一款软件
💻 CS
📖 第 1 页 / 共 5 页
字号:
        }

        private void btn_SelAll2_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem item in this.listView2.Items)
            {
                if (!item.Checked)
                {
                    item.Checked = true;
                }
            }
        }

        private void btn_SelI_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem item in this.listView1.Items)
            {
                item.Checked = !item.Checked;
            }
        }

        private void btn_SelI2_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem item in this.listView2.Items)
            {
                item.Checked = !item.Checked;
            }
        }

        private void cmbox_PTab_SelectedIndexChanged(object sender, EventArgs e)
        {
            if ((this.cmbox_PTab.SelectedItem != null) && (this.cmbox_PTab.Text != "System.Data.DataRowView"))
            {
                string text = this.cmbox_PTab.Text;
                this.BindlistViewCol1(this.dbname, text);
            }
        }

        private void cmbox_STab_SelectedIndexChanged(object sender, EventArgs e)
        {
            if ((this.cmbox_STab.SelectedItem != null) && (this.cmbox_STab.Text != "System.Data.DataRowView"))
            {
                string text = this.cmbox_STab.Text;
                this.BindlistViewCol2(this.dbname, text);
            }
        }

        private void CodeMaker_Load(object sender, EventArgs e)
        {
        }

        private void CreatCS()
        {
            if (this.radbtn_Frame_One.Checked)
            {
                this.CreatCsOne();
            }
            if (this.radbtn_Frame_S3.Checked)
            {
                this.CreatCsS3();
            }
            if (this.radbtn_Frame_F3.Checked)
            {
                this.CreatCsF3();
            }
        }

        private void CreatCsF3()
        {
            if (this.radbtn_F3_Model.Checked)
            {
                this.CreatCsF3Model();
            }
            if (this.radbtn_F3_DAL.Checked)
            {
                this.CreatCsF3DAL();
            }
            if (this.radbtn_F3_IDAL.Checked)
            {
                this.CreatCsF3IDAL();
            }
            if (this.radbtn_F3_DALFactory.Checked)
            {
                this.CreatCsF3DALFactory();
            }
            if (this.radbtn_F3_BLL.Checked)
            {
                this.CreatCsF3BLL();
            }
        }

        private void CreatCsF3BLL()
        {
            string nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            string text = this.cmbox_PTab.Text;
            string text1 = this.cmbox_STab.Text;
            string modelName = this.txtClassName.Text;
            if (modelName == "")
            {
                modelName = text;
            }
            string bllName = modelName;
            string dalName = modelName;
            BuilderFrameF3 ef = new BuilderFrameF3(this.dbobj, this.dbname, this.tablename, modelName, bllName, dalName, this.GetFieldlistP(), this.GetKeyFieldsP(), nameSpace, folder, this.setting.DbHelperName);
            string bLLType = this.GetBLLType();
            string strContent = ef.GetBLLCode(bLLType, false, this.chk_CS_Exists.Checked, this.chk_CS_Add.Checked, this.chk_CS_Update.Checked, this.chk_CS_Delete.Checked, this.chk_CS_GetModel.Checked, this.chk_CS_GetModelByCache.Checked, this.chk_CS_GetList.Checked, this.chk_CS_GetList.Checked);
            this.SettxtContent("CS", strContent);
        }

        private void CreatCsF3DAL()
        {
            string text = this.txtProcPrefix.Text;
            string nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            string tableNameParent = this.cmbox_PTab.Text;
            string tableNameSon = this.cmbox_STab.Text;
            string modelName = this.txtClassName.Text;
            string modelNameSon = this.txtClassName2.Text;
            if (modelName == "")
            {
                modelName = tableNameParent;
            }
            if (modelNameSon == "")
            {
                modelNameSon = tableNameSon;
            }
            string bllName = modelName;
            string dalName = modelName;
            string dALNameSon = modelNameSon;
            BuilderFrameF3 ef = new BuilderFrameF3(this.dbobj, this.dbname, this.tablename, modelName, bllName, dalName, this.GetFieldlistP(), this.GetKeyFieldsP(), nameSpace, folder, this.setting.DbHelperName);
            string dALType = this.GetDALType();
            string strContent = ef.GetDALCodeTran(dALType, false, this.chk_CS_Exists.Checked, this.chk_CS_Add.Checked, this.chk_CS_Update.Checked, this.chk_CS_Delete.Checked, this.chk_CS_GetModel.Checked, this.chk_CS_GetList.Checked, text, tableNameParent, tableNameSon, modelName, modelNameSon, this.GetFieldlistP(), this.GetFieldlistS(), this.GetKeyFieldsP(), this.GetKeyFieldsS(), dalName, dALNameSon);
            this.SettxtContent("CS", strContent);
        }

        private void CreatCsF3DALFactory()
        {
            string nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            string text = this.cmbox_PTab.Text;
            string text1 = this.cmbox_STab.Text;
            string modelName = this.txtClassName.Text;
            if (modelName == "")
            {
                modelName = text;
            }
            string bllName = modelName;
            string dalName = modelName;
            string dALFactoryCode = new BuilderFrameF3(this.dbobj, this.dbname, this.tablename, modelName, bllName, dalName, this.GetFieldlistP(), this.GetKeyFieldsP(), nameSpace, folder, this.setting.DbHelperName).GetDALFactoryCode();
            this.SettxtContent("CS", dALFactoryCode);
        }

        private void CreatCsF3IDAL()
        {
            string nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            string text = this.cmbox_PTab.Text;
            string text1 = this.cmbox_STab.Text;
            string modelName = this.txtClassName.Text;
            if (modelName == "")
            {
                modelName = text;
            }
            string bllName = modelName;
            string dalName = modelName;
            string strContent = new BuilderFrameF3(this.dbobj, this.dbname, this.tablename, modelName, bllName, dalName, this.GetFieldlistP(), this.GetKeyFieldsP(), nameSpace, folder, this.setting.DbHelperName).GetIDALCode(false, this.chk_CS_Exists.Checked, this.chk_CS_Add.Checked, this.chk_CS_Update.Checked, this.chk_CS_Delete.Checked, this.chk_CS_GetModel.Checked, this.chk_CS_GetList.Checked, this.chk_CS_GetList.Checked);
            this.SettxtContent("CS", strContent);
        }

        private void CreatCsF3Model()
        {
            string text = this.txtProcPrefix.Text;
            string nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            string tableNameParent = this.cmbox_PTab.Text;
            string tableNameSon = this.cmbox_STab.Text;
            string tabName = this.txtClassName.Text;
            string modelClass = this.txtClassName2.Text;
            tabName = this.namerule.GetModelClass(tabName);
            modelClass = this.namerule.GetModelClass(modelClass);
            string strContent = new BuilderFrameF3(this.dbobj, this.dbname, nameSpace, folder, this.setting.DbHelperName).GetModelCode(tableNameParent, tabName, this.GetFieldlistP(), tableNameSon, modelClass, this.GetFieldlistS());
            this.SettxtContent("CS", strContent);
        }

        private void CreatCsOne()
        {
            string text = this.txtProcPrefix.Text;
            string nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            if (folder.Trim() != "")
            {
                nameSpace = nameSpace + "." + folder;
            }
            string modelName = this.txtClassName.Text;
            if (modelName == "")
            {
                modelName = this.tablename;
            }
            BuilderFrameOne one = new BuilderFrameOne(this.dbobj, this.dbname, this.tablename, modelName, this.GetFieldlistP(), this.GetKeyFieldsP(), nameSpace, folder, this.setting.DbHelperName);
            string dALType = this.GetDALType();
            string strContent = one.GetCode(dALType, false, this.chk_CS_Exists.Checked, this.chk_CS_Add.Checked, this.chk_CS_Update.Checked, this.chk_CS_Delete.Checked, this.chk_CS_GetModel.Checked, this.chk_CS_GetList.Checked, text);
            this.SettxtContent("CS", strContent);
        }

        private void CreatCsS3()
        {
            if (this.radbtn_F3_Model.Checked)
            {
                this.CreatCsS3Model();
            }
            if (this.radbtn_F3_DAL.Checked)
            {
                this.CreatCsS3DAL();
            }
            if (this.radbtn_F3_BLL.Checked)
            {
                this.CreatCsS3BLL();
            }
        }

        private void CreatCsS3BLL()
        {
            string text = this.txtProcPrefix.Text;
            string nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            string str3 = this.cmbox_PTab.Text;
            string str4 = this.cmbox_STab.Text;
            string tabName = this.txtClassName.Text;
            string modelClass = this.txtClassName2.Text;
            if (tabName == "")
            {
                tabName = str3;
            }
            if (modelClass == "")
            {
                modelClass = str4;
            }
            string bLLClass = tabName;
            string dALClass = tabName;
            string str9 = modelClass;
            tabName = this.namerule.GetModelClass(tabName);
            modelClass = this.namerule.GetModelClass(modelClass);
            bLLClass = this.namerule.GetBLLClass(bLLClass);
            dALClass = this.namerule.GetDALClass(dALClass);
            str9 = this.namerule.GetDALClass(str9);
            BuilderFrameS3 es = new BuilderFrameS3(this.dbobj, this.dbname, this.tablename, tabName, bLLClass, dALClass, this.GetFieldlistP(), this.GetKeyFieldsP(), nameSpace, folder, this.setting.DbHelperName);
            string bLLType = this.GetBLLType();
            string strContent = es.GetBLLCode(bLLType, false, this.chk_CS_Exists.Checked, this.chk_CS_Add.Checked, this.chk_CS_Update.Checked, this.chk_CS_Delete.Checked, this.chk_CS_GetModel.Checked, this.chk_CS_GetModelByCache.Checked, this.chk_CS_GetList.Checked);
            this.SettxtContent("CS", strContent);
        }

        private void CreatCsS3DAL()
        {
            string text = this.txtProcPrefix.Text;
            string nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            string tableNameParent = this.cmbox_PTab.Text;
            string tableNameSon = this.cmbox_STab.Text;
            string tabName = this.txtClassName.Text;
            string modelClass = this.txtClassName2.Text;
            if (tabName == "")
            {
                tabName = tableNameParent;
            }
            if (modelClass == "")
            {
                modelClass = tableNameSon;
            }
            string bLLClass = tabName;
            string dALClass = tabName;
            string str10 = modelClass;
            tabName = this.namerule.GetModelClass(tabName);
            modelClass = this.namerule.GetModelClass(modelClass);
            bLLClass = this.namerule.GetBLLClass(bLLClass);
            dALClass = this.namerule.GetDALClass(dALClass);
            str10 = this.namerule.GetDALClass(str10);
            BuilderFrameS3 es = new BuilderFrameS3(this.dbobj, this.dbname, this.tablename, tabName, bLLClass, dALClass, this.GetFieldlistP(), this.GetKeyFieldsP(), nameSpace, folder, this.setting.DbHelperName);
            string dALType = this.GetDALType();
            string strContent = es.GetDALCodeTran(dALType, false, this.chk_CS_Exists.Checked, this.chk_CS_Add.Checked, this.chk_CS_Update.Checked, this.chk_CS_Delete.Checked, this.chk_CS_GetModel.Checked, this.chk_CS_GetList.Checked, text, tableNameParent, tableNameSon, tabName, modelClass, this.GetFieldlistP(), this.GetFieldlistS(), this.GetKeyFieldsP(), this.GetKeyFieldsS(), dALClass, str10);
            this.SettxtContent("CS", strContent);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -