예제 #1
0
        private void GenerateTableColumns(string outPutFile = "")
        {
            var codeMaker  = new PDMCodeMaker(this.xmlDocument, this.CompanyName, this.Project, this.Author, DateTime.Now.Year.ToString(), DateTime.Now.ToString("yyyy-MM-dd"), this.GetClassName(), "Table", this.GetTableName(), this.GetDescription());
            var codeString = codeMaker.DBSQL();

            if (string.IsNullOrEmpty(outPutFile))
            {
                var fileName = this.GetClassName() + "TableColumns.sql";
                var codeForm = new CodeView(codeString)
                {
                    FileName = fileName, Name = fileName
                };
                PageUtility.AddSinglePage(codeForm, fileName, mainfrm);
            }
            else
            {
                PDMCodeMaker.WriteCode(outPutFile, true, codeString);
            }
        }
예제 #2
0
        private void GenerateService(string outPutFile = "")
        {
            var file = Application.StartupPath + "\\Templates\\Service.cst";
            var code = CodeMakerLibary.GetTemplate(file);

            code = ReplaceAssemblyInfo(code);
            if (string.IsNullOrEmpty(outPutFile))
            {
                var fileName = this.GetClassName() + "Service.cs";
                var codeForm = new CodeView(code)
                {
                    FileName = fileName, Name = fileName
                };
                PageUtility.AddSinglePage(codeForm, fileName, mainfrm);
            }
            else
            {
                PDMCodeMaker.WriteCode(outPutFile, true, code);
            }
        }
예제 #3
0
        private void GengerateMvcEntity(string outPutFile = "")
        {
            var codeMaker = new PDMCodeMaker(this.xmlDocument, this.CompanyName, this.Project, this.Author, DateTime.Now.Year.ToString(), DateTime.Now.ToString("yyyy-MM-dd"), this.GetClassName(), "Entity", this.GetTableName(), this.GetDescription())
            {
                MVCEntity = true
            };
            var codeString = codeMaker.BuilderEntity();

            if (string.IsNullOrEmpty(outPutFile))
            {
                var fileName = this.GetClassName() + "Entity.cs";
                var codeForm = new CodeView(codeString)
                {
                    FileName = fileName, Name = fileName
                };
                //PageUtility.AddSinglePage(codeForm, fileName, mainfrm);
                PageUtility.AddTabPage(fileName, codeForm, mainfrm);
            }
            else
            {
                PDMCodeMaker.WriteCode(outPutFile, true, codeString);
            }
        }
예제 #4
0
        private void GenerateManager(string outPutFile = "")
        {
            //以模版方式生成
            //string file = Application.StartupPath + "\\Templates\\Manager.cst";
            //string code = CodeMakerLibary.GetTemplate(file);
            //code = ReplaceAssemblyInfo(code);

            var codeMaker  = new PDMCodeMaker(this.xmlDocument, this.CompanyName, this.Project, this.Author, DateTime.Now.Year.ToString(), DateTime.Now.ToString("yyyy-MM-dd"), this.GetClassName(), "Manager", this.GetTableName(), this.GetDescription());
            var codeString = codeMaker.BuilderManager(null);

            if (string.IsNullOrEmpty(outPutFile))
            {
                var fileName = this.GetClassName() + "Manager.Generate.cs";
                var codeForm = new CodeView(codeString)
                {
                    FileName = fileName, Name = fileName
                };
                PageUtility.AddSinglePage(codeForm, fileName, mainfrm);
            }
            else
            {
                PDMCodeMaker.WriteCode(outPutFile, true, codeString);
            }
        }