1, create a new project named: Volleyball, select the basic template.
Click OK. Create the project.
2. Right-click on the Model folder and add models Class: Model classes are: GzScore.cs and Players.cs
The specific code is as follows:
Public class Team
{
[Key]
public int TId {get; set;}
[Display (name = "team Name")]
Public string Tname {get; set;}
[Display (Name = "result")]
Public string TResult {get; set;}
public int Tparentid {get; set;}
}
Public class Ju
{
[Key]
public int JId {get; set;}
[Display (Name = "innings")]
public string Juci {get; set;}
[Display (Name = "score")]
public string Jscore {get; set;}
public int Tjid {get; set;}
Public virtual icollection<team> Team {get; set;}
Public virtual team Team {get; set;}
Public virtual score Score {get; set;}
}
Public class score
{
[Key]
public int SId {get; set;}
[Display (Name = "score")]
public int Ascore {get; set;}
[Display (Name = "score")]
public int Bscore {get; set;}
[Display (Name = "Remarks")]
Public string Note {get; set;}
public int Sjid {get; set;}
//public Virtual icollection<ju> Ju {get; set;}
//public Virtual Ju ju {get; set;}
//public Virtual Team Team {get; set;}
}
public class Countscoredbcontext:dbcontext
{
Public dbset<team> Team {get; set;}
Public dbset<ju> Ju {get; set;}
Public dbset<score> score {get; set;}
}
Once the model class has been created, it is also a foreshadowing of the next step to create the controller.
3. Right-click the Controller folder, select Add Controllers, then rename to HomeController, then click OK;
Right-click the index method within the controller to add a view for it: The code is as follows:
Public ActionResult Index ()
{
return View ();
}
Add a view with the following code:
@{
Viewbag.title = "Index";
}
@Html. ActionLink ("scorer", "Index", "Team")
@Html. ActionLink ("Audience", "Searchindex", "Spectator")
4. Generating other controllers as already mentioned in the previous blog post, no specific demonstrations are made here.
So the basic software is done.
Run as follows:
1, HomeController Enter the interface, select the Identity interface
2. Select a scorecard. The existing team can be added to the score or add new team, and then the team score to increase the deletion and check.
If both teams have any questions, they can challenge and make changes to the results.
If you want to select the details for adding the innings,
If you want to make a specific score in a game, you can select details
There are questions about one of these points that can still be challenged for editing and modification.
Until the end of the game, the scorer entered both winning and losing teams.
3, select the audience interface. Viewers can search for the score of the game they want to see.
Search results
If the audience wants to see specific details of the game, click on the details, jump page
If you want to continue to see the specific score, you can click the detailed
This is basically all of the functionality, and all the data is saved from the scoreboard to the database before the audience can search for the data they want. Specific code I will post on the next blog post.
The volleyball scoring program of MVC--(vii) Concrete realization