Create.cshtml 2.58 KB
Newer Older
julescournut's avatar
julescournut committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
@model MVC.Models.FightModels

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>


@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.Name, new { @type = "text", @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Challenger1, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.Challenger1.ID, ViewBag.ListHouses as IEnumerable<SelectListItem>, "", new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Challenger1, "", new { @class = "text-danger" })
				@Html.ActionLink("Create new house", "../House/Create")
            </div>
        </div>
		
        <div class="form-group">
            @Html.LabelFor(model => model.Challenger2, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.Challenger2.ID, ViewBag.ListHouses as IEnumerable<SelectListItem>, "", new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Challenger2, "", new { @class = "text-danger" })
				@Html.ActionLink("Create new house", "../House/Create")
            </div>
        </div>
		
        <div class="form-group">
            @Html.LabelFor(model => model.War, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.War.ID, ViewBag.ListWar as IEnumerable<SelectListItem>, "", new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.War, "", new { @class = "text-danger" })
				@Html.ActionLink("Create new war", "../War/Create")
            </div>
        </div>

Clément's avatar
Clément committed
52
53
54
55
56
            <div class="form-group">
                <div class="col-md-offset-2 col-md-10">
                    <input type="submit" value="Create" class="btn btn-default" />

                </div>
julescournut's avatar
julescournut committed
57
58
59
60
61
62
63
64
65
66
67
            </div>
    </div>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}