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 @@ +