I haven't written a blog for a long time. Besides the busy work, I have been thinking about how to integrate all my development experience and technical accumulation, I have developed many winform sharing software and Asp.net webform projects, and found that many things are closely related to each other. However, we are too busy and too lazy to sort them out, it is generally difficult to sort out the pipeline, but we have not stopped, and our dream will always come closer and come true. After a lot of projects, I found that people have a lot of inertia or inertia, so I have the opportunity to well organize the development success, optimize and optimize it, and it will become more and more convenient to use.
In all the developed project processes, many modules, such as permission management and Dictionary data management, are very common modules. This article will introduce them below, each project can use a common dictionary Data Management System (or a module is more suitable). Before introducing it, I would like to introduce my integration route and some ideas, as shown below:
All the content introduced in the framework is the things and features of the existing development framework. To learn about the multidimensional features of the winform framework, you can use the latest Shared Software Warehouse Management System. for details, referArticleAccording to the experiences summarized in the developed spare parts warehouse management system, the shared software not only integrates many excellent functions, one feature is that the data management module has also been sublimated.
In the winform framework, the permission management system and dictionary management system can all be made independent.ProgramYou can reference it in a program to query or obtain the relevant Dictionary data. For example, you can find a dictionary list of a key value as a drop-down list, some are SQL Server and some are access databases, so it is the best choice to support multiple databases.
In the dictionary data management project, we can see two different data access layers. The factory mode calls different data access layers through different configurations, to support sqlserver, access, and other databases, of course more database support can be expanded. Let's take a look at the project view as follows:
The configuration file is as follows:
<? XML version = "1.0" encoding = "UTF-8"?>
<Configuration>
<Configsections>
<Section name = "dataconfiguration"
Type = "Microsoft. Practices. enterpriselibrary. Data. configuration. databasesettings, Microsoft. Practices. enterpriselibrary. Data"/>
</Configsections>
<Connectionstrings>
<Add name = "dataaccess" providername = "system. data. oledb "connectionstring =" provider = Microsoft. jet. oledb.4.0; Data Source = E: \ My applications \ data dictionary \ sqldictionary \ WHC. dictionary. ui \ bin \ debug \ orderwater. MDB; user id = admin; Jet oledb: Database Password =; "/>
<Add name = "dataaccess2" providername = "system. Data. sqlclient"
Connectionstring = "Persist Security info = false; Data Source = (local); initial catalog = warehouse; user id = sa; Password = 123456"/>
</Connectionstrings>
<Dataconfiguration defaultdatabase = "dataaccess"/>
<Deleetask>
<! -- Software name -->
<Add key = "applicationname" value = "Shen Tian star Warehouse Management System"/>
<! -- Developer name -->
<Add key = "manufacturer" value = "Guangzhou ai Technology Co., Ltd."/>
<! -- Data dictionary database type: Access, sqlserver, etc. -->
<Add key = "componentdbtype" value = "access"/>
</Appsettings>
</Configuration>
We use dictionarydbtype to switch different databases without modifying them.CodeTo support multiple databases, of course, different database files need to be created for different databases, but the database structure is basically consistent.
Let's take a look at the final effect of the dictionary management module, as shown below:
After the dictionary data module is made into an independent program, one can run independently or call the class library in the Host Program to obtain the dictionary data, as shown below:
Private Void Initdictitem ()
{
This . Txtmanufacture. Items. Clear ();
This . Txtmanufacture. Items. addrange (dictitemutil. getdictbydicttype ( " Supplier " ));
This. Txtbigtype. Items. Clear ();
This. Txtbigtype. Items. addrange (dictitemutil. getdictbydicttype ("Spare Parts category"));
This . txtitemtype. items. clear ();
This . txtitemtype. items. addrange (dictitemutil. getdictbydicttype ( " spare parts Category " ));
This. Txtsource. Items. Clear ();
This. Txtsource. Items. addrange (dictitemutil. getdictbydicttype ("Source"));
This. Txtwarehouse. Items. Clear ();
This. Txtwarehouse. Items. addrange (dictitemutil. getallwarehouse (). toarray ());
This. Txtdept. Items. Clear ();
This. Txtdept. Items. addrange (dictitemutil. getdictbydicttype ("Department"));
}
the demo program called by the dictionary component module is also provided for download as follows:
http://files.cnblogs.com/wuhuacong/DictionaryDemo.rar