FlatFeeDiscount

vnext
Paul Schneider 8 years ago
parent d09189f830
commit a2319dd026
8 changed files with 39 additions and 27 deletions

@ -116,7 +116,7 @@ namespace Yavsc.Controllers
}
[AllowAnonymous,ValidateAntiForgeryToken]
[ValidateAntiForgeryToken]
public ActionResult HairCut(string performerId, string activityCode)
{
HairPrestation pPrestation=null;
@ -136,12 +136,15 @@ namespace Yavsc.Controllers
|| pPrestation.Tech == HairTechnos.Mech ) ? "":"hidden";
ViewBag.TechClass = ( pPrestation.Gender == HairCutGenders.Women ) ? "":"hidden";
ViewData["PerfPrefs"] = _context.BrusherProfile.Single(p=>p.UserId == performerId);
var result = new HairCutView {
HairBrusher = _context.Performers.Include(
var perfer = _context.Performers.Include(
p=>p.Performer
).Single(p=>p.PerformerId == performerId),
Topic = pPrestation
} ;
).Single(p=>p.PerformerId == performerId);
var result = new HairCutQuery {
PerformerProfile = perfer,
PerformerId = perfer.PerformerId,
ClientId = User.GetUserId(),
Prestation = pPrestation
};
return View(result);
}

@ -132,5 +132,8 @@ namespace Yavsc.Models.Haircut
public decimal CarePrice { get; set; }
[Display(Name="Remise au forfait coupe+technique"),DisplayFormat(DataFormatString="{0:C}")]
public decimal FlatFeeDiscount { get; set; }
}
}

@ -11,7 +11,14 @@ namespace Yavsc.Models.Haircut
{
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
HairPrestation Prestation { get; set; }
[Required]
public long PrestationId { get; set; }
[ForeignKey("PrestationId")]
public virtual HairPrestation Prestation { get; set; }
[Required]
public Location Location { get; set; }

@ -1,12 +0,0 @@
using Yavsc.Models.Haircut;
using Yavsc.Models.Workflow;
namespace Yavsc.ViewModels.Haircut
{
public class HairCutView
{
public PerformerProfile HairBrusher { get; set; }
public HairPrestation Topic { get; set; }
}
}

@ -261,13 +261,21 @@
<span asp-validation-for="ShortFoldingPrice" class="text-danger" />
</div>
</div>
<div class="form-group">
<label asp-for="FlatFeeDiscount" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="FlatFeeDiscount" class="form-control" />
<span asp-validation-for="FlatFeeDiscount" class="text-danger" />
</div>
</div>
model.ShortFoldingPrice
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Save" class="btn btn-default" />
</div>
</div>
</fieldset>
</div>
</form>

@ -36,9 +36,7 @@
</dl>
</fieldset>
<fieldset>
<legend>Tarifs hors coiffure ou coupe</legend>
<legend>Tarifs divers</legend>
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.ShampooPrice)
@ -53,7 +51,12 @@
<dd>
@Html.DisplayFor(model => model.CarePrice)
</dd>
<dt>
@Html.DisplayNameFor(model => model.FlatFeeDiscount)
</dt>
<dd>
@Html.DisplayFor(model => model.FlatFeeDiscount)
</dd>
</dl>
</fieldset>

@ -1,4 +1,4 @@
@model HairCutView
@model HairCutQuery
@{ ViewData["Title"] = $"{ViewBag.Activity.Name}: Votre commande"; }
@await Html.PartialAsync("BrusherProfileScript",ViewData["PerfPrefs"])
@section scripts {
@ -124,7 +124,7 @@
<h2>@ViewData["Title"]</h2>
@Html.DisplayFor(m=>m.HairBrusher)
@Html.DisplayFor(m=>m.PerformerProfile)
<form asp-controller="HairCutCommand" asp-action="HairCut">
<div class="form-horizontal">

@ -31,7 +31,7 @@
@if (act.Children.Count>0) {
<p><em>@act.Name</em><br/>
@act.Description </p>
<a asp-route-id="@act.Code">
<a asp-route-id="@act.Code" class="btn btn-default">
@foreach (Activity c in act.Children) {
@if (!c.Hidden) { @Html.DisplayFor(subact=>c) }
}

Loading…