The springbird ERP system quick development platform is based on a common three-tier architecture. The data access layer adopts the ibatis.net without SQL Injection risks, the presentation layer adopts Microsoft's latest Asp.net mvc3 razor template parsing engine and lightweight jquery easyui. The service layer adopts interface programming, the mature and reliable IOC and AOP framework spring.net are used to integrate the service layer, data access layer, and performance layer.Discuss QQ: 2262366309
To do well, you must first sharpen your tools. Springbird code generation tools are essential tools.
1. Layered Architecture of springbird code generator. Put service interfaces in the Contract Directory, put data in the DaO directory to access Dao, put data entities in the Entity directory, and put service implementation classes in the impl directory
2. Obtain the getoledbschematable method of oledb used by the database server.
1 /// <summary>
2 // obtain the architecture
3 /// </Summary>
4 /// <Param name = "connectionstring"> connection string </param>
5 // <Param name = "type"> type </param>
6 /// <Param name = "restrictions"> restricted set </param>
7 // <returns> architecture </returns>
8 Public datatable getschema (string connectionstring, guid type, object [] restrictions)
9 {
10 datatable result = NULL;
11 using (oledbconnection connection = new oledbconnection (connectionstring ))
12 {
13 connection. open ();
14 result = connection. getoledbschematable (type, restrictions );
15}
16
17 return result;
18}
3. The template definition uses the nvelocity template engine to provide the service interface itableservice. cs. VM.
1 using system. collections;
2 using system. Collections. Generic;
3 using $ {solution}. entity;
4
5 namespace $ {solution}. Contract
6 {
7 /// <summary>
8 // $ {table. Description} Service
9 /// </Summary>
10 public interface I $ {table. Alias} Service
11 {
12 /// <summary>
13 // get the $ {table. Description} set
14 /// </Summary>
15 /// <Param name = "Parameters"> parameter set </param>
16 /// <returns >$ {table. Description} set </returns>
17 ilist <$ {table. Alias}> get $ {table. Alias} s (idictionary parameters );
18
19 /// <summary>
20 // remove $ {table. Description}
21 /// </Summary>
22 // <Param name = "$ {key. camelalias}" >$ {key. Description} </param>
23 void remove $ {table. Alias} ($ {key. Type }$ {key. camelalias });
24
25 /// <summary>
26 // save $ {table. Description}
27 /// </Summary>
28 // <Param name = "$ {table. camelalias}" >$ {table. Description} </param>
29 void save $ {table. Alias} ($ {table. Alias }$ {table. camelalias });
30}
31}
4. The presentation layer uses winform for development and propertygrid for editing. The running effect is as follows: