Technical analysis of Clock Maintenance Management System (i) MVC Architecture build 1.1 new project
The first step: Open the VS2010 interface, click on the upper left corner file, click New, select Project
1.1 (Fig. 1)
The second step: click on the Site Web type, select the ASP. MVC3 Web application, enter the project name in the name (solution name), location can choose the path of the project, click OK after completion
1.1 (Fig. 2)
Step three: Select the Empty project, click OK, and then the MVC project is created successfully
1.1 (Fig. 3)
1.1 (Fig. 4)
1.2 Creating controllers and views
First step: Right click on Controllers (Controller), click Add, select Controller, then enter the name of the creation controller, click OK, build the controller to complete
1.2 (Fig. 5)
1.2 (Fig. 6)
Step Two: Select Add View in Controller
1.2 (Fig. 7)
1.2 (Fig. 8)
1.2 (Fig. 9)
1.2 (Fig. 10)
1.3 The addition of the models layer
First step, right click to select Models, click Add, select New Item
1.3 (Fig. 11)
Second step: Select the data template, click the ADO entity Class Database model, enter the entity class database name
1.3 (Fig. 12)
Step three: Select Generate from Database and click Next
1.3 (Fig. 13)
Fourth Step: Click New Connection, select the data source (SQL Service), login The server name, enter the account number and password,
Select the name of the database you want to connect to, click Test, if the test succeeds, click OK, select the sensitive character in the Entity Data Model Wizard, enter the entity class database name Click Next
1.3 (Fig. 14)
1.3 (Fig. 15)
Fifth step: Select all the tables and click Finish
1.3 (Fig. 16)
1.3 (Fig. 17)
Technical analysis of Clock Maintenance Management System (i) MVC Architecture Building