diff --git a/Yavsc/Controllers/HairCutCommandController.cs b/Yavsc/Controllers/HairCutCommandController.cs index 2d603259..e0134ab7 100644 --- a/Yavsc/Controllers/HairCutCommandController.cs +++ b/Yavsc/Controllers/HairCutCommandController.cs @@ -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); } diff --git a/Yavsc/Models/Haircut/BrusherProfile.cs b/Yavsc/Models/Haircut/BrusherProfile.cs index fe47ad46..845ef59b 100644 --- a/Yavsc/Models/Haircut/BrusherProfile.cs +++ b/Yavsc/Models/Haircut/BrusherProfile.cs @@ -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; } } } \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairCutQuery.cs b/Yavsc/Models/Haircut/HairCutQuery.cs index c4960ffd..1d086e15 100644 --- a/Yavsc/Models/Haircut/HairCutQuery.cs +++ b/Yavsc/Models/Haircut/HairCutQuery.cs @@ -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; } diff --git a/Yavsc/ViewModels/Haircut/HairCutView.cs b/Yavsc/ViewModels/Haircut/HairCutView.cs deleted file mode 100644 index 7d96f750..00000000 --- a/Yavsc/ViewModels/Haircut/HairCutView.cs +++ /dev/null @@ -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; } - } -} \ No newline at end of file diff --git a/Yavsc/Views/BrusherProfile/Edit.cshtml b/Yavsc/Views/BrusherProfile/Edit.cshtml index b5d94997..f87e18f7 100644 --- a/Yavsc/Views/BrusherProfile/Edit.cshtml +++ b/Yavsc/Views/BrusherProfile/Edit.cshtml @@ -261,13 +261,21 @@ +
+ +
+ + +
+
-model.ShortFoldingPrice
+ + diff --git a/Yavsc/Views/BrusherProfile/Index.cshtml b/Yavsc/Views/BrusherProfile/Index.cshtml index 618382c0..c44b13aa 100644 --- a/Yavsc/Views/BrusherProfile/Index.cshtml +++ b/Yavsc/Views/BrusherProfile/Index.cshtml @@ -36,9 +36,7 @@
-Tarifs hors coiffure ou coupe - - +Tarifs divers
@Html.DisplayNameFor(model => model.ShampooPrice) @@ -53,7 +51,12 @@
@Html.DisplayFor(model => model.CarePrice)
- +
+ @Html.DisplayNameFor(model => model.FlatFeeDiscount) +
+
+ @Html.DisplayFor(model => model.FlatFeeDiscount) +
diff --git a/Yavsc/Views/HairCutCommand/HairCut.cshtml b/Yavsc/Views/HairCutCommand/HairCut.cshtml index 0e9d6ef5..e82245f7 100644 --- a/Yavsc/Views/HairCutCommand/HairCut.cshtml +++ b/Yavsc/Views/HairCutCommand/HairCut.cshtml @@ -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 @@

@ViewData["Title"]

-@Html.DisplayFor(m=>m.HairBrusher) +@Html.DisplayFor(m=>m.PerformerProfile)
diff --git a/Yavsc/Views/Home/Index.cshtml b/Yavsc/Views/Home/Index.cshtml index 22327c0d..bf3eff2a 100755 --- a/Yavsc/Views/Home/Index.cshtml +++ b/Yavsc/Views/Home/Index.cshtml @@ -31,7 +31,7 @@ @if (act.Children.Count>0) {

@act.Name
@act.Description

- + @foreach (Activity c in act.Children) { @if (!c.Hidden) { @Html.DisplayFor(subact=>c) } }