| | |
| | |  |
| | | |
| | | using GenerateCode_WeiBen_WMS.Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | /// </summary> |
| | | public class InputModel_Generate : BaseGenerate |
| | | { |
| | | public static string CreateQueryModelLText(string Modulelogo, |
| | | string ChinaComment, List<ColumnModel> columnNameList, string entityName) |
| | | public static string CreateQueryModelLText(GenerateCodeParam param) |
| | | { |
| | | var str = TextHelper.ReadText(@"Templete\Entity\InputModel模æ¿.txt"); |
| | | var str = TextHelper.ReadText(@"Templete\Entity\InputQueryModel模æ¿.txt"); |
| | | CommonReplace(ref str); |
| | | |
| | | str = str.Replace("$ChinaComment$", ChinaComment);//ä¸ææ³¨é |
| | | str = str.Replace("$EntityName$", entityName); |
| | | |
| | | str = str.Replace("$Modulelogo$", Modulelogo);//模åç®å |
| | | |
| | | //å¤ç å页æ¥è¯¢é¨å |
| | | string attrString = ""; |
| | | |
| | | List<ColumnModel> newColumnNameList = ListHelper.OnlyRemoveId(columnNameList); |
| | | List<ColumnModel> newColumnNameList = ListHelper.OnlyRemoveId(param.ColumnNameList); |
| | | for (int i = 0; i < newColumnNameList.Count; ++i) |
| | | { |
| | | attrString += StructStrHelper.GenerateAttributeForQueryModel(newColumnNameList[i]); |
| | |
| | | |
| | | //å¤ç æ°å¢é¨å |
| | | attrString = ""; |
| | | newColumnNameList = ListHelper.RemoveIdCreatorModifier(columnNameList); |
| | | newColumnNameList = ListHelper.RemoveIdCreatorModifier(param.ColumnNameList); |
| | | for (int i = 0; i < newColumnNameList.Count; ++i) |
| | | { |
| | | attrString += StructStrHelper.GenerateAttribute(i,newColumnNameList[i]); |
| | |
| | | <Compile Include="Generate\BLL_Generate.cs" /> |
| | | <Compile Include="Generate\DAL_Generate.cs" /> |
| | | <Compile Include="Generate\Procedure_Generate.cs" /> |
| | | <Compile Include="Model\GenerateCodeParam.cs" /> |
| | | <Compile Include="Model\Enum\DataBaseEnum.cs" /> |
| | | <Compile Include="Model\Enum\DataTypeEnum.cs" /> |
| | | <Compile Include="Model\ListItem.cs" /> |
| | |
| | | <Content Include="Templete\Entity\AddModel模æ¿.txt"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </Content> |
| | | <Content Include="Templete\Entity\InputQueryModel模æ¿.txt"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </Content> |
| | | <Content Include="Templete\Entity\OutputModel模æ¿.txt"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </Content> |
| | |
| | | using System.Windows.Forms.VisualStyles; |
| | | using GenerateCode_WeiBen_WMS.DataBaseFactory; |
| | | using GenerateCode_WeiBen_WMS.Const; |
| | | using GenerateCode_WeiBen_WMS.Model; |
| | | |
| | | namespace GenerateCode_GEBrilliantFactory |
| | | { |
| | |
| | | string str_generate = ""; |
| | | bool tf; |
| | | |
| | | GenerateCodeParam param = new GenerateCodeParam() |
| | | { |
| | | Modulelogo = modulelogo, |
| | | ChinaComment = chinaComment, |
| | | NameSpacePath = wcf_NameSpacePath, |
| | | ColumnNameList = columnList, |
| | | EntityName = entityName |
| | | }; |
| | | |
| | | //çæModel |
| | | //CreateModelFile(columnList, tableName, filePrefixName, wcf_NameSpacePath, createPerson, chinaComment, entityName, modulelogo); |
| | | //CreateModelParamFile(columnList, tableName, filePrefixName, wcf_NameSpacePath, createPerson, chinaComment, entityName, modulelogo); |
| | | |
| | | //çæ InputModel æä»¶ |
| | | str_generate = InputModel_Generate.CreateQueryModelLText(modulelogo, chinaComment, columnList, entityName); |
| | | //1ãçæ å页æ¥è¯¢ æä»¶ |
| | | str_generate = InputModel_Generate.CreateQueryModelLText(param); |
| | | tf = TextHelper.Export2File_V2(tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application.Contracts\Dtos\" + tb_EntityName.Text.Trim(), tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); |
| | | |
| | | ////çæ OutputModel æä»¶ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using GenerateCode_GEBrilliantFactory; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace GenerateCode_WeiBen_WMS.Model |
| | | { |
| | | /// <summary> |
| | | /// çæä»£ç åæ° |
| | | /// </summary> |
| | | public class GenerateCodeParam |
| | | { |
| | | /// <summary> |
| | | /// 模åç®å |
| | | /// </summary> |
| | | public string Modulelogo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ææ³¨é |
| | | /// </summary> |
| | | public string ChinaComment { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååå表 |
| | | /// </summary> |
| | | public List<ColumnModel> ColumnNameList { get; set; } = new List<ColumnModel>(); |
| | | |
| | | /// <summary> |
| | | /// å®ä½åç§° |
| | | /// </summary> |
| | | public string EntityName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å½åç©ºé´ |
| | | /// </summary> |
| | | public string NameSpacePath { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.$NameSpacePath$.Application.Contracts.Dtos.$EntityName$; |
| | | |
| | | /// <summary> |
| | | /// $ChinaComment$æ¥è¯¢åæ° |
| | | /// </summary> |
| | | public class Get$EntityName$Input : ExtensiblePagedAndSortedResultRequestDto |
| | | { |
| | | |
| | | #region å
³é®åæ¥è¯¢ |
| | | |
| | | /// <summary> |
| | | /// å
³é®åæ¨¡ç³æ¥è¯¢ï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public string searchVal { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éç¨æ¥è¯¢é
ç½® (1:æ¨¡ç³æ¥è¯¢ , 2:ç²¾åæ¥è¯¢)ï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public SearchFilterModeEnum searchVal_FilterMode { get; set; } = SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åæç´¢ç»ä»¶ä¼ éçéç¨æ¥è¯¢é
ç½®ç屿§åï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | [NoAutoQuery] |
| | | public string str_searchFormInputAttrs { get; set; } |
| | | /// <summary> |
| | | /// åæç´¢ç»ä»¶ä¼ éçéç¨æ¥è¯¢é
ç½®ç屿§åï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public List<string> searchFormInputAttrs |
| | | { |
| | | get |
| | | { |
| | | if (!string.IsNullOrEmpty(str_searchFormInputAttrs)) |
| | | { |
| | | return str_searchFormInputAttrs.Split(',').ToList(); |
| | | } |
| | | return new List<string>(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | $QueryAttributes$ |
| | | } |
| | | namespace Admin.NET.Application |
| | | { |
| | | /// <summary> |
| | | /// å页æ¥è¯¢$ChinaComment$è¾å
¥åæ° |
| | | /// </summary> |
| | | public class $EntityName$PageInput : PageInputCustomBase |
| | | { |
| | | $QueryAttributes$ |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ°å¢$ChinaComment$è¾å
¥åæ° |
| | | /// </summary> |
| | | public class Add$EntityName$Input : BasicsDEntity |
| | | { |
| | | $AddAttributes$ |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°$ChinaComment$è¾å
¥åæ° |
| | | /// </summary> |
| | | public class Update$EntityName$Input : Add$EntityName$Input |
| | | { |
| | | [Required(ErrorMessage = "Id主é®ä¸è½ä¸ºç©º")] |
| | | public virtual new long Id { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤$ChinaComment$è¾å
¥åæ° |
| | | /// </summary> |
| | | public class Delete$EntityName$Input |
| | | { |
| | | public List<long> Id { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å个æ¥è¯¢$ChinaComment$è¾å
¥åæ° |
| | | /// </summary> |
| | | public class Query$EntityName$Input : BaseId |
| | | { |
| | | |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using GenerateCode_WeiBen_WMS.Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Configuration; |
| | | using System.Data; |
| | |
| | | /// </summary> |
| | | public class CommonHelper |
| | | { |
| | | /// <summary> |
| | | /// éç¨æ¿æ¢å符串 |
| | | /// </summary> |
| | | /// <param name="param"></param> |
| | | /// <param name="str"></param> |
| | | public static void CommonReplaceStr(GenerateCodeParam param, ref string str) |
| | | { |
| | | str = str.Replace("$NameSpacePath$", param.NameSpacePath);//å½åç©ºé´ |
| | | str = str.Replace("$ChinaComment$", param.ChinaComment);//ä¸ææ³¨é |
| | | str = str.Replace("$EntityName$", param.EntityName);//å®ä½ç±»å |
| | | str = str.Replace("$Modulelogo$", param.Modulelogo);//模åç®å |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// é¦åæ¯å°å |