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

📄 codemaker.cs

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

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

        private void btn_SetKey_Click(object sender, EventArgs e)
        {
            this.list_KeyField.Items.Clear();
            foreach (ListViewItem item in this.listView1.Items)
            {
                if (item.Checked)
                {
                    this.list_KeyField.Items.Add(item.SubItems[1].Text);
                }
            }
            this.lblkeycount.Text = this.list_KeyField.Items.Count.ToString() + "个主键";
        }

        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.txtClassName.Text;
            if (text == "")
            {
                text = this.tablename;
            }
            string tabName = text;
            string dALClass = text;
            text = this.namerule.GetModelClass(text);
            tabName = this.namerule.GetBLLClass(tabName);
            dALClass = this.namerule.GetDALClass(dALClass);
            BuilderFrameF3 ef = new BuilderFrameF3(this.dbobj, this.dbname, this.tablename, text, tabName, dALClass, this.GetFieldlist(), this.GetKeyFields(), nameSpace, folder, this.setting.DbHelperName);
            string bLLType = this.GetBLLType();
            string strContent = ef.GetBLLCode(bLLType, this.chk_CS_GetMaxID.Checked, 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 tabName = this.txtClassName.Text;
            if (tabName == "")
            {
                tabName = this.tablename;
            }
            string bLLClass = tabName;
            string dALClass = tabName;
            tabName = this.namerule.GetModelClass(tabName);
            bLLClass = this.namerule.GetBLLClass(bLLClass);
            dALClass = this.namerule.GetDALClass(dALClass);
            BuilderFrameF3 ef = new BuilderFrameF3(this.dbobj, this.dbname, this.tablename, tabName, bLLClass, dALClass, this.GetFieldlist(), this.GetKeyFields(), nameSpace, folder, this.setting.DbHelperName);
            string dALType = this.GetDALType();
            string strContent = ef.GetDALCode(dALType, this.chk_CS_GetMaxID.Checked, 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 CreatCsF3DALFactory()
        {
            string nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            string text = this.txtClassName.Text;
            if (text == "")
            {
                text = this.tablename;
            }
            string tabName = text;
            string dALClass = text;
            text = this.namerule.GetModelClass(text);
            tabName = this.namerule.GetBLLClass(tabName);
            dALClass = this.namerule.GetDALClass(dALClass);
            string dALFactoryCode = new BuilderFrameF3(this.dbobj, this.dbname, this.tablename, text, tabName, dALClass, this.GetFieldlist(), this.GetKeyFields(), 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.txtClassName.Text;
            if (text == "")
            {
                text = this.tablename;
            }
            string tabName = text;
            string dALClass = text;
            text = this.namerule.GetModelClass(text);
            tabName = this.namerule.GetBLLClass(tabName);
            dALClass = this.namerule.GetDALClass(dALClass);
            string strContent = new BuilderFrameF3(this.dbobj, this.dbname, this.tablename, text, tabName, dALClass, this.GetFieldlist(), this.GetKeyFields(), nameSpace, folder, this.setting.DbHelperName).GetIDALCode(this.chk_CS_GetMaxID.Checked, 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 nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            string text = this.txtClassName.Text;
            if (text == "")
            {
                text = this.tablename;
            }
            string tabName = text;
            string dALClass = text;
            text = this.namerule.GetModelClass(text);
            tabName = this.namerule.GetBLLClass(tabName);
            dALClass = this.namerule.GetDALClass(dALClass);
            string modelCode = new BuilderFrameF3(this.dbobj, this.dbname, this.tablename, text, tabName, dALClass, this.GetFieldlist(), this.GetKeyFields(), nameSpace, folder, this.setting.DbHelperName).GetModelCode();
            this.SettxtContent("CS", modelCode);
        }

        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.GetFieldlist(), this.GetKeyFields(), nameSpace, folder, this.setting.DbHelperName);
            string dALType = this.GetDALType();
            string strContent = one.GetCode(dALType, this.chk_CS_GetMaxID.Checked, 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 nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            string text = this.txtClassName.Text;
            if (text == "")
            {
                text = this.tablename;
            }
            string tabName = text;
            string dALClass = text;
            text = this.namerule.GetModelClass(text);
            tabName = this.namerule.GetBLLClass(tabName);
            dALClass = this.namerule.GetDALClass(dALClass);
            BuilderFrameS3 es = new BuilderFrameS3(this.dbobj, this.dbname, this.tablename, text, tabName, dALClass, this.GetFieldlist(), this.GetKeyFields(), nameSpace, folder, this.setting.DbHelperName);
            string bLLType = this.GetBLLType();
            string strContent = es.GetBLLCode(bLLType, this.chk_CS_GetMaxID.Checked, 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 tabName = this.txtClassName.Text;
            if (tabName == "")
            {
                tabName = this.tablename;
            }
            string bLLClass = tabName;
            string dALClass = tabName;
            tabName = this.namerule.GetModelClass(tabName);
            bLLClass = this.namerule.GetBLLClass(bLLClass);
            dALClass = this.namerule.GetDALClass(dALClass);
            BuilderFrameS3 es = new BuilderFrameS3(this.dbobj, this.dbname, this.tablename, tabName, bLLClass, dALClass, this.GetFieldlist(), this.GetKeyFields(), nameSpace, folder, this.setting.DbHelperName);
            string dALType = this.GetDALType();
            string strContent = es.GetDALCode(dALType, this.chk_CS_GetMaxID.Checked, 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 CreatCsS3Model()
        {
            string nameSpace = this.txtNameSpace.Text.Trim();
            string folder = this.txtNameSpace2.Text.Trim();
            string text = this.txtClassName.Text;
            if (text == "")
            {
                text = this.tablename;
            }
            string tabName = text;
            string dALClass = text;
            text = this.namerule.GetModelClass(text);
            tabName = this.namerule.GetBLLClass(tabName);
            dALClass = this.namerule.GetDALClass(dALClass);
            string modelCode = new BuilderFrameS3(this.dbobj, this.dbname, this.tablename, text, tabName, dALClass, this.GetFieldlist(), this.GetKeyFields(), nameSpace, folder, this.setting.DbHelperName).GetModelCode();
            this.SettxtContent("CS", modelCode);
        }

        private void CreatDB()
        {
            if (this.radbtn_DB_Proc.Checked)
            {
                this.CreatDBProc();
            }
            else

⌨️ 快捷键说明

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