zoukankan      html  css  js  c++  java
  • 排球积分程序(六)——View的编码

    Index视图

    @{
        ViewBag.Title = "选择功能";
    }
    
    <h2>选择功能</h2>
    <p>
        @Html.ActionLink("计分", "Count")
    
        @Html.ActionLink("查询", "Search")
    </p>

    Count视图

    @model MvcVolleyball.Models.Team
    @{
        ViewBag.Title = "选择队伍";
    }
    @using (Html.BeginForm("Count","Volleyball",FormMethod.Post)) {
        @Html.ValidationSummary(true)
        
    <div class="editor-label">
                @Html.LabelFor(model => model.teamId, "选择主队")
            </div>
            <div class="editor-field">
                @Html.DropDownList("teamId", String.Empty)
                @Html.ValidationMessageFor(model => model.teamId)
            </div>
        <div class="editor-label">
                @Html.LabelFor(model => model.teamId, "选择客队")
            </div>
            <div class="editor-field">
                @Html.DropDownList("teamId", String.Empty)
                @Html.ValidationMessageFor(model => model.teamId)
            </div>
      <p>
             <input type="submit" value="确定" />
            </p>
    }

    CountScore视图

    @{
        ViewBag.Title = "计分程序";
    }
    
    <h2>计分</h2>
    <table><tr><td>主队:@ViewBag.hostteam</td>
        
    <td>客队:@ViewBag.guestteam</td></tr>
    <tr><td>         
               主队得分队员:@Html.DropDownList("hostMember" )              
        </td>
        <td>客队得分队员:@Html.DropDownList("guestMember" )</td>
        
    </tr>
        <tr><td>@Html.ActionLink("主队加分", "addScore", new {teamIds=ViewBag.teamId})</td>
    
            <td>@Html.ActionLink("客队加分", "addScore", new {teamIds=ViewBag.teamId})</td>
        </tr>
        <tr>
            <td>
                  主队得分: @ViewBag.hostteamscores
            </td>
    
            <td>
                 客队得分:@ViewBag.guestteamscores
            </td>
        </tr>
        </table>
    
    
       

    Search视图

    @model MvcVolleyball.Models.Team
    @{
        ViewBag.Title = "选择查询队伍";
    }
    
    <h2>SearchTeam</h2>
    @using (Html.BeginForm("Search","Volleyball",FormMethod.Post)) {
        @Html.ValidationSummary(true)
        
    <div class="editor-label">
                @Html.LabelFor(model => model.teamId, "选择查询队伍")
            </div>
            <div class="editor-field">
                @Html.DropDownList("teamId", String.Empty)
                @Html.ValidationMessageFor(model => model.teamId)
            </div>
      <p>
             <input type="submit" value="确定" />
            </p>
    }

    TeamScore视图

    @model IEnumerable<MvcVolleyball.Models.HostTeamScore>
    @{
        ViewBag.Title = "队伍得分";
    }
    
    <h2>队伍得分</h2>
    <table>
        <tr>
            <th>
               局数
            </th>
            <th>
                队名
            </th>
            <th>
                得分队员
            </th>
            <th>
                得分
            </th>
            <th></th>
        </tr>
    
    @foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.inningNum)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.team.teamName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.memberId)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.hostTeamScore)
            </td>
            </tr>
    }
        </table>
  • 相关阅读:
    em
    How to locate a path?
    云图说 | 揭秘云硬盘高可靠性的秘密,速来围观
    【华为云技术分享】开发团队中的任务没人领取,你头疼吗?
    介绍一种更方便的代理池实现方案
    4行Python代码生成图像验证码
    【华为云技术分享】机器学习(02)——学习资料链接
    【华为云技术分享】华为开发者大会HDC.Cloud带你探索强化学习三大挑战及落地实践
    【华为云技术分享】【一统江湖的大前端(8)】matter.js 经典物理
    华为开发者大会HDC.Cloud硬核技术解读:知识图谱构建流程及方法
  • 原文地址:https://www.cnblogs.com/colorful-Ji/p/7074274.html
Copyright © 2011-2022 走看看