| | |
| | | //ä¸é®çææææä»¶ |
| | | private void btn_CreateFile_Click(object sender, EventArgs e) |
| | | { |
| | | var genCodeRootPath = ""; |
| | | try |
| | | { |
| | | projectNamePrefix = this.tb_ProjectNamePrefix.Text; |
| | |
| | | var str_enumList = this.tb_EnumList.Text.Trim(); |
| | | if (str_enumList.IndexOf(',') > -1) |
| | | { |
| | | str_enumList = str_enumList.Replace("\n",""); |
| | | str_enumList = str_enumList.Replace("\n", ""); |
| | | str_enumList = str_enumList.Replace("\t", ""); |
| | | str_enumList = str_enumList.Replace("\r", ""); |
| | | var arr_enumList = str_enumList.Split(','); |
| | |
| | | //çæModel |
| | | //CreateModelFile(columnList, tableName, filePrefixName, wcf_NameSpacePath, createPerson, chinaComment, entityName, modulelogo); |
| | | //CreateModelParamFile(columnList, tableName, filePrefixName, wcf_NameSpacePath, createPerson, chinaComment, entityName, modulelogo); |
| | | |
| | | genCodeRootPath = tbPath.Text + @"\" + tb_WCF_NameSpacePath.Text.Trim(); |
| | | var webFolerPath = tb_WCF_NameSpacePath.Text.Trim() + "_Web"; |
| | | #region å®ä½ç±» |
| | | var entityFilePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application.Contracts\Dtos\" + tb_EntityName.Text.Trim(); |
| | | var entityFilePath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application.Contracts\Dtos\" + tb_EntityName.Text.Trim(); |
| | | //1ãçæ å页æ¥è¯¢å®ä½ æä»¶ |
| | | str_generate = InputQueryModel_Generate.CreateQueryModelLText(param); |
| | | tf = TextHelper.Export2File_V2(entityFilePath, $"Get{param.EntityName}Input.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); |
| | |
| | | #region AppSerivice |
| | | |
| | | //8ãçæ IAppService æä»¶ |
| | | var appServiceFilePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application.Contracts\Services"; |
| | | var appServiceFilePath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application.Contracts\Services"; |
| | | str_generate = IAppService_Generate.CreateText(param); |
| | | tf = TextHelper.Export2File_V2(appServiceFilePath, $"I{param.EntityName}AppService.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); |
| | | |
| | | //9ãçæ AppService æä»¶ |
| | | appServiceFilePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application\Implements"; |
| | | appServiceFilePath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application\Implements"; |
| | | str_generate = AppService_Generate.CreateText(param); |
| | | tf = TextHelper.Export2File_V2(appServiceFilePath, $"{param.EntityName}AppService.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); |
| | | |
| | |
| | | #region Contorller |
| | | |
| | | //10ãçæ Contorller æä»¶ |
| | | var continerlllePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @"\Controller"; |
| | | var continerlllePath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @"\Controller"; |
| | | str_generate = Controller_Generate.CreateText(param); |
| | | tf = TextHelper.Export2File_V2(continerlllePath, $"{param.EntityName}Controller.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); |
| | | |
| | |
| | | #region Domain |
| | | |
| | | //11ãçæ IRepository æä»¶ |
| | | var iRepositoryPath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Domain\" + tb_EntityName.Text.Trim(); ; |
| | | var iRepositoryPath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Domain\" + tb_EntityName.Text.Trim(); ; |
| | | str_generate = IRepository_Generate.CreateText(param); |
| | | tf = TextHelper.Export2File_V2(iRepositoryPath, $"I{param.EntityName}Repository.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); |
| | | |
| | |
| | | #region EntityFrameworkCore |
| | | |
| | | //12ãçæ EfCoreRepository æä»¶ |
| | | var efCoreRepositoryPath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".EntityFrameworkCore\Repositories"; |
| | | var efCoreRepositoryPath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".EntityFrameworkCore\Repositories"; |
| | | str_generate = EfCoreRepository_Generate.CreateText(param); |
| | | tf = TextHelper.Export2File_V2(efCoreRepositoryPath, $"EfCore{param.EntityName}Repository.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); |
| | | |
| | |
| | | #endregion |
| | | |
| | | #region Web |
| | | var webRootPath = tbPath.Text + @"\web\src\widgets\" + tb_EntityName.Text.Trim(); |
| | | var webRootPath = genCodeRootPath + @"\" + webFolerPath + @"\src\widgets\" + tb_EntityName.Text.Trim(); |
| | | |
| | | //13ãçæ Index æä»¶ |
| | | str_generate = Index_Generate.CreateText(param); |
| | |
| | | |
| | | |
| | | //36ãçæ AutoMapperProfile æä»¶ |
| | | var autoMapFilePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application\MapperProfiles"; |
| | | var autoMapFilePath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application\MapperProfiles"; |
| | | str_generate = AutoMapperProfile_Generate.CreateText(param); |
| | | tf = TextHelper.Export2File_V2(autoMapFilePath, param.EntityName + $"AutoMapperProfile.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); |
| | | |
| | |
| | | } |
| | | //MessageBox.Show("çææä»¶æåï¼"); |
| | | //æåä¹åæå¼æä»¶å¤¹ |
| | | using (System.Diagnostics.Process.Start(this.tbPath.Text)) |
| | | using (System.Diagnostics.Process.Start(genCodeRootPath)) |
| | | { |
| | | |
| | | } |