Abstract: In software, the existence of module modules such as "System Configuration" and "Company situation" is necessary. The information in these modules usually needs to be modified by users. This article describes the design ideas and implementation processes of these functional modules.
In some generic software, information such as "System Configuration" and "company information" often needs to be allocated according to the actual situation. The specific effect is shown in:
Overview of design ideas and implementation steps:
1. the system configuration is stored in the t_setting table of the database.
2. settingdal is recommended for data table configuration.
3. Add the settingdal call code to the system location to display the system name and other functions.
Database design diagram:
Database Table Design Diagram
Then the code is implemented: Read and Write. The following describes only the method Signature implementation methods in various ways, ADO. net, EF, LINQ, etc. The public class settingdal {public void setvalue (string name, string value) {}; pubic void setvalue (string name, bool value) {}; // overload public void setvalue (string name, int value ){};
Public String getvalue (string name) {}; public bool getboolvalue (string name) {}; // overload public int getintvalue (string name ){};}
Note:
1. newid () is recommended for the default primary key ID ()
2. MessageBox () is not applicable to exceptions thrown at the Dal layer ();
3. Why not use app. config or properties. setting to store configuration information?
Local applet,Store configuration information using app. config or properties. SettingNo problem. However, the configuration information is stored locally. Once you change to another computer, the configuration information is gone.
In a large three-tier architecture C/S system, the client is variable and may have hundreds of clients. It is necessary to have the configuration information in the database.
L3 Architecture
"System Configuration" module-Production ideas and processes