A step-by-step introduction to the development framework based on SqlSugar (28)–Quickly build a system parameter management interface
When referring to some industry system software, I found a very good system function – system parameter management, which is equivalent to fragmenting and managing any basic system parameters. One value can be read at a time for management, which is conducive to We can quickly handle business needs, which is a very good function. This essay simulates this function, based on the SqlSugar development framework, and uses code generation tools to quickly generate the system parameter management interface and related business class generation.
When referring to some industry system software, I found a very good system function – system parameter management, which is equivalent to fragmenting and managing any basic system parameters. One value can be read at a time for management. This helps us quickly deal with business needs, which is a very good feature. This essay simulates this function, based on the SqlSugar development framework, and uses code generation tools to quickly generate the system parameter management interface and related business class generation.
1. Comparison of reference and specific implementation effects
The reference interface effect is as follows.
Usually based on the development framework of SqlSugar and the interface effect of DevExpress, the Winform interface built is as follows.
2. Quickly build system parameter management interface and background business code
In order to generate business code and UI interface content, we must first design the database. Based on the database table, we can use the code generation tool Database2Sharp to quickly generate relevant business code and Winform interface code.
System parameter information should be designed to include a large category parameter directory and a specific parameter item, as shown in the following database table design based on SQL Server (designed based on PoweDesigner to facilitate the generation of Sql execution).
The major category directories are designed as shown below. For convenience, they are designed as a tree structure.
The parameter item table design is as follows.
Generate the relevant Sql and build the relevant table structure in the database.
Then use the code generation tool to generate the relevant code.
Open the code generation tool and expand the relevant database table. Since we choose to generate the interface based on the SqlSugar development framework architecture, we select the corresponding interface generation [SqlSugar Framework Winform Interface Generation].
In the pop-up [General Winform Interface Generation] panel, check the relevant setting information and customize the UI interface, as shown in the following interface effect.
Using the code generation tool, an interface effect similar to the design form below will be generated by default.
In order to display a multi-level parameter directory, we need to imitate a tree list on the left side, so that we can better view the relevant parameter information, which is equivalent to classifying and managing parameter items.
So we added a split panel area control of SplitContainerControl to the generated form interface, and placed a tree list and query box on the left side, as shown below.
3. Quickly build background business code for system parameter management
What is introduced above is the interface generation of Winform. In order to make the system run smoothly, we also need to access the relevant system parameter table directories and project access business codes. General business codes need to have CRUD and other routines. Operation code, but fortunately based on the framework, we only need to generate a simple class, which inherits from the base class and has these operations by default. There is no need to write code repeatedly, which simplifies code processing and improves development efficiency.
Similarly, we use the existing table structure information to quickly generate relevant business files based on the code generation tool, and then merge them into the system framework.608017.png” alt=”” width=”651″ height=”403″ loading=”lazy”>
The interface effect of editing the details is as follows.
The above is the entire process of using the code generation tool to quickly generate the system parameter management interface and related business class generation based on the SqlSugar development framework. I hope it will be beneficial to everyone’s development and processing.
Introduction to SqlSugar development framework: https://www.iqidi.com/Framework/sugarIndex.htm
Series of articles:
“Step-by-step introduction to the development framework based on SqlSugar (1)–Design and use of framework basic classes”
“Step-by-step introduction to the development framework based on SqlSugar (2)–Query processing based on intermediate tables”
“Step-by-step introduction to the development framework based on SqlSugar (3)–implementing the integrated development of the code generation tool Database2Sharp”
“Step-by-step introduction to the development framework based on SqlSugar (4)–Automatic assignment of GUID primary keys in the data access base class”
“Step-by-step introduction to the development framework based on SqlSugar (5)–Using interface injection in the service layer to implement IOC control inversion”
“Step-by-step introduction to the development framework based on SqlSugar (6)–Injecting user identity information interface into the base class interface”
“Step-by-step introduction to the development framework based on SqlSugar (7) — Using the option mode [Options] in the file upload module to process regular uploads and FTP file uploads”
“Step-by-step introduction to the development framework based on SqlSugar (8) – Implementing user operation logging in base class function encapsulation”
“A step-by-step introduction to the development framework based on SqlSugar (9) — Combining Winform controls to implement field permission control”
“Step-by-step introduction to the development framework based on SqlSugar (10)–Using the encapsulation of axios components to achieve access to back-end API data and unified encapsulation processing of base classes”
“A step-by-step introduction to the development framework based on SqlSugar (11)–A summary of using TypeScript and Vue3’s Setup syntax sugar to write pages and components”
“A step-by-step introduction to the development framework based on SqlSugar (12) — splitting the page module content into components to achieve divide and conquer processing”
“A step-by-step introduction to the development framework based on SqlSugar (13) – Encapsulation based on the upload component of ElementPlus for easy project use”
“Step-by-step introduction to the development framework based on SqlSugar (14)–Injection and use of global objects based on Vue3+TypeScript”
“Step-by-step introduction to the development framework based on SqlSugar (15) – Integrating code generation tools to generate front-end interfaces”
“Step-by-step introduction to the development framework based on SqlSugar (16)–Function introduction of the workflow module”
“Step-by-step introduction to the development framework based on SqlSugar (17)–Cache processing based on CSRedis”
“A step-by-step introduction to the development framework based on SqlSugar (18)–Based on the code generation tool Database2Sharp, quickly generate the front-end interface and Winform interface of Vue3+TypeScript”
“Step-by-step introduction to the development framework based on SqlSugar (19)–Function introduction of mobile front-end based on UniApp+Vue”
“Step-by-step introduction to the development framework based on SqlSugar (20) – Implementing multi-condition query processing on the mobile terminal based on UniApp+Vue”
“Step-by-step introduction to the development framework based on SqlSugar (21) – Add some escape information output to the workflow list page and perform content conversion on the backend”
“Step-by-step introduction to the development framework based on SqlSugar (22) – Unified form editing and form details viewing processing in the front-end workflow module of Vue3+TypeScript”
“A step-by-step introduction to the development framework based on SqlSugar (23) – Smoothly increasing the demand for Web API docking in the Winform side management system”
“Step-by-step introduction to the development framework based on SqlSugar (24)–Using Serialize.Linq to serialize and deserialize Lambda expressions”
A step-by-step introduction to the development framework based on SqlSugar (25) – Multi-terminal message communication based on SignalR
A step-by-step introduction to the development framework based on SqlSugar (26)–implementing local upload, FTP upload, and Alibaba Cloud OSS upload into one process
A step-by-step introduction to the development framework based on SqlSugar (27)–Integration of database operations based on MongoDB
A step-by-step introduction to the development framework based on SqlSugar (28)–Quickly build a system parameter management interface
Focus on code generation tools, .Net/.NetCore framework architecture and software development, as well as various Vue.js front-end technology applications. He is the author of Winform development framework/hybrid development framework, WeChat development framework, Bootstrap development framework, ABP development framework, SqlSugar development framework and other framework products.
Please indicate the source for reprinting: Writer: Wu Huacong http://www.iqidi.com