I'm developing a project in MVC 3 (CRUD)... I want to create a reservation for a tennis court...
Page:
So, when I type a "Start time" ("heure de début" in French) I want to increase the "FinishTime" in red ("heure de fin" in French) dynamically... If it's a simple match increase by 1:00 and if not by 2:00...
I'm beginner in MvC3 so I have no idea how to do that... Of course, I'm not request that you make my work but the right method to do that and if it's possible an example...
View:
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>Reservation</legend>
<div class="editor-label">
@Html.LabelFor(model => model.Date)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Date)
@Html.ValidationMessageFor(model => model.Date)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.StartTime)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.StartTime)
@Html.ValidationMessageFor(model => model.StartTime)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Simple)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Simple)
@Html.ValidationMessageFor(model => model.Simple)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.FinishTime)
</div>
<div class="editor-fieldFinishTime">
@Html.DisplayFor(model => model.FinishTime)
@Html.ValidationMessageFor(model => model.FinishTime)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Customer.Name)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Customer.Name)
@Html.ValidationMessageFor(model => model.Customer.Name)
</div>
<div class="editor-label">
@Html.Label("Terrain N°")
</div>
<div class="editor-field">
@Html.DropDownListFor(c=>c.TennisCourtID,ViewBag.TennisCourtID as SelectList)
</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
I've forget to precise that all clubs can have different schedule... For example:
Club 1: Simple: 1:00 Double: 2:00
Club2: Simple: 1:30 Double: 2:30
So in my database's table TennisClub I have an attribute SimpleGameTime and DoubleGameTime... Sorry :(