diff --git a/Yavsc/Controllers/FrontOfficeController.cs b/Yavsc/Controllers/FrontOfficeController.cs index db4720df..282d64bb 100644 --- a/Yavsc/Controllers/FrontOfficeController.cs +++ b/Yavsc/Controllers/FrontOfficeController.cs @@ -58,8 +58,8 @@ namespace Yavsc.Controllers return View(result); } - [Route("Book/{id}"), HttpPost, AllowAnonymous] - public ActionResult Book(BookQuery bookQuery) + [Route("Profiles/{id}"), HttpPost, AllowAnonymous] + public ActionResult Profiles(BookQuery bookQuery) { if (ModelState.IsValid) { @@ -85,7 +85,7 @@ namespace Yavsc.Controllers return View("Index"); } ViewBag.Activities = _context.ActivityItems(null); - return View("Book", _context.Performers.Include(p => p.Performer).Where + return View("Profiles", _context.Performers.Include(p => p.Performer).Where (p => p.Active).OrderBy( x => x.MinDailyCost )); diff --git a/Yavsc/Controllers/HairTaintsController.cs b/Yavsc/Controllers/HairTaintsController.cs index 33edfc18..49bf9502 100644 --- a/Yavsc/Controllers/HairTaintsController.cs +++ b/Yavsc/Controllers/HairTaintsController.cs @@ -1,12 +1,13 @@ using System.Threading.Tasks; using Microsoft.AspNet.Authorization; using Microsoft.AspNet.Mvc; +using Microsoft.AspNet.Mvc.Rendering; using Microsoft.Data.Entity; +using Yavsc.Models; +using Yavsc.Models.Haircut; namespace Yavsc.Controllers { - using Models; - using Models.Haircut; [Authorize("AdministratorOnly")] public class HairTaintsController : Controller { @@ -14,13 +15,14 @@ namespace Yavsc.Controllers public HairTaintsController(ApplicationDbContext context) { - _context = context; + _context = context; } // GET: HairTaints public async Task Index() { - return View(await _context.HairTaint.ToListAsync()); + var applicationDbContext = _context.HairTaint.Include(h => h.Color); + return View(await applicationDbContext.ToListAsync()); } // GET: HairTaints/Details/5 @@ -43,6 +45,7 @@ namespace Yavsc.Controllers // GET: HairTaints/Create public IActionResult Create() { + ViewBag.ColorId = new SelectList(_context.Color, "Id", "Name"); return View(); } @@ -57,6 +60,7 @@ namespace Yavsc.Controllers await _context.SaveChangesAsync(); return RedirectToAction("Index"); } + ViewBag.ColorId = new SelectList(_context.Color, "Id", "Name", hairTaint.ColorId); return View(hairTaint); } @@ -73,6 +77,7 @@ namespace Yavsc.Controllers { return HttpNotFound(); } + ViewBag.ColorId = new SelectList(_context.Color, "Id", "Name",hairTaint.ColorId); return View(hairTaint); } @@ -87,6 +92,7 @@ namespace Yavsc.Controllers await _context.SaveChangesAsync(); return RedirectToAction("Index"); } + ViewBag.ColorId = new SelectList(_context.Color, "Id", "Name", hairTaint.ColorId); return View(hairTaint); } diff --git a/Yavsc/Models/Billing/NominatvieCommand.cs b/Yavsc/Models/Billing/NominativeServiceCommand.cs similarity index 62% rename from Yavsc/Models/Billing/NominatvieCommand.cs rename to Yavsc/Models/Billing/NominativeServiceCommand.cs index 8c2bb031..e824acf6 100644 --- a/Yavsc/Models/Billing/NominatvieCommand.cs +++ b/Yavsc/Models/Billing/NominativeServiceCommand.cs @@ -2,14 +2,38 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Yavsc.Interfaces.Workflow; using Yavsc.Models.Market; using Yavsc.Models.Workflow; +using YavscLib; namespace Yavsc.Models.Billing { - public class NominativeServiceCommand : Query where T:Service + public abstract class NominativeServiceCommand : IBaseTrackedEntity, IQuery { + public DateTime DateCreated + { + get; set; + } + + public DateTime DateModified + { + get; set; + } + + public string UserCreated + { + get; set; + } + + public string UserModified + { + get; set; + } + + public QueryStatus Status { get; set; } + [Required] public string ClientId { get; set; } diff --git a/Yavsc/Models/Haircut/HairCutQuery.cs b/Yavsc/Models/Haircut/HairCutQuery.cs new file mode 100644 index 00000000..1464f0ee --- /dev/null +++ b/Yavsc/Models/Haircut/HairCutQuery.cs @@ -0,0 +1,14 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Yavsc.Models.Billing; + +namespace Yavsc.Models.Haircut +{ + public class HairCutQuery : NominativeServiceCommand + { + [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id { get; set; } + HairPrestation [] Prestations { get; set; } + } +} \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairCutQueryEvent.cs b/Yavsc/Models/Haircut/HairCutQueryEvent.cs index 6077945b..900b7b6e 100644 --- a/Yavsc/Models/Haircut/HairCutQueryEvent.cs +++ b/Yavsc/Models/Haircut/HairCutQueryEvent.cs @@ -1,4 +1,4 @@ -namespace Yavsc.Models.Messaging +namespace Yavsc.Models.Haircut { public class HairCutQueryEvent : BookQueryProviderInfo, IEvent { @@ -27,5 +27,7 @@ namespace Yavsc.Models.Messaging set; } + + HairCutQuery Data { get; set; } } } \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairPrestation.cs b/Yavsc/Models/Haircut/HairPrestation.cs index 351d66bb..e3825420 100644 --- a/Yavsc/Models/Haircut/HairPrestation.cs +++ b/Yavsc/Models/Haircut/HairPrestation.cs @@ -1,13 +1,11 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Yavsc.Models.Market; namespace Yavsc.Models.Haircut { - public class HairPrestation + public class HairPrestation : Service { - [Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public long Id { get; set;} - public HairLength Length { get; set; } public HairCutGenders Gender { get; set; } public bool Cut { get; set; } diff --git a/Yavsc/Models/Haircut/HairTaint.cs b/Yavsc/Models/Haircut/HairTaint.cs index 9026fb19..09c1cec0 100644 --- a/Yavsc/Models/Haircut/HairTaint.cs +++ b/Yavsc/Models/Haircut/HairTaint.cs @@ -13,6 +13,9 @@ namespace Yavsc.Models.Haircut public string Brand { get; set; } [Required] - public Color Color {get; set;} + public long ColorId { get; set; } + + [ForeignKeyAttribute("ColorId")] + public virtual Color Color {get; set;} } } \ No newline at end of file diff --git a/Yavsc/Models/Workflow/BookQuery.cs b/Yavsc/Models/Workflow/BookQuery.cs index 11dd3a1b..9f7edec7 100644 --- a/Yavsc/Models/Workflow/BookQuery.cs +++ b/Yavsc/Models/Workflow/BookQuery.cs @@ -12,7 +12,7 @@ namespace Yavsc.Models.Workflow /// Query, for a date, with a given perfomer, at this given place. /// - public class BookQuery : NominativeServiceCommand, IBaseTrackedEntity + public class BookQuery : NominativeServiceCommand { /// /// The command identifier diff --git a/Yavsc/Models/Workflow/Query.cs b/Yavsc/Models/Workflow/Query.cs index 369bb300..c619f78b 100644 --- a/Yavsc/Models/Workflow/Query.cs +++ b/Yavsc/Models/Workflow/Query.cs @@ -6,28 +6,8 @@ namespace Yavsc.Models.Workflow using Models.Market; using YavscLib; - public class Query

: IBaseTrackedEntity where P : BaseProduct + public interface IQuery: IBaseTrackedEntity { - public DateTime DateCreated - { - get; set; - } - - public DateTime DateModified - { - get; set; - } - - public string UserCreated - { - get; set; - } - - public string UserModified - { - get; set; - } - QueryStatus Status { get; set; } } diff --git a/Yavsc/Views/Command/BookHaircutStar.cshtml b/Yavsc/Views/Command/BookHaircutStar.cshtml new file mode 100644 index 00000000..9e631dc3 --- /dev/null +++ b/Yavsc/Views/Command/BookHaircutStar.cshtml @@ -0,0 +1,207 @@ +@model HairPrestationQuery +@{ ViewData["Title"] = "Proposition de rendez-vous "+ +@SR["to"]+" "+ Model.PerformerProfile.Performer.UserName ++" ["+SR[ViewBag.Activity.Code]+"]"; } + + + + + +@section header { + +} +@section scripts{ + +} +

@ViewData["Title"]

+
+
+

@SR["Fill in your book query"]

+
+
+
+
+ Votre évennement + +
+
+
+
+
+ + + + +
+
+ + + +
+
+
+ +
+
+
+
+
+ + +
    +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ + +@Html.HiddenFor(model=>model.Location.Latitude) + @Html.HiddenFor(model=>model.Location.Longitude) +
+
+
+
+
+
+
+
+
+ +
+
+@Html.HiddenFor(model=>model.ClientId) +@Html.HiddenFor(model=>model.PerformerId) +@Html.HiddenFor(model=>model.ActivityCode) +
+ + +
+ +@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } diff --git a/Yavsc/Views/Command/Create.cshtml b/Yavsc/Views/Command/Create.cshtml index cdb9d8c5..dc385204 100644 --- a/Yavsc/Views/Command/Create.cshtml +++ b/Yavsc/Views/Command/Create.cshtml @@ -1,5 +1,7 @@ @model BookQuery -@{ ViewData["Title"] = SR["Book "+ViewBag.Activity.Code]; } +@{ ViewData["Title"] = "Proposition de rendez-vous "+ +@SR["to"]+" "+ Model.PerformerProfile.Performer.UserName ++" ["+SR[ViewBag.Activity.Code]+"]"; } diff --git a/Yavsc/Views/FrontOffice/HArts.chtml b/Yavsc/Views/FrontOffice/HArts.chtml new file mode 100644 index 00000000..dadf8034 --- /dev/null +++ b/Yavsc/Views/FrontOffice/HArts.chtml @@ -0,0 +1,16 @@ +@model IEnumerable + +@{ + ViewData["Title"] = "Book - " + (ViewBag.Activity?.Name ?? SR["Any"]); +} +@ViewBag.Activity.Description + +@foreach (var profile in Model) { +
+ @Html.DisplayFor(m=>m) +
+ + + +
+} diff --git a/Yavsc/Views/FrontOffice/Profiles.cshtml b/Yavsc/Views/FrontOffice/Profiles.cshtml index ee399d0a..88ed7d0e 100644 --- a/Yavsc/Views/FrontOffice/Profiles.cshtml +++ b/Yavsc/Views/FrontOffice/Profiles.cshtml @@ -11,7 +11,7 @@
- +
} diff --git a/Yavsc/Views/HairTaints/Create.cshtml b/Yavsc/Views/HairTaints/Create.cshtml index d758783e..0c9210ec 100644 --- a/Yavsc/Views/HairTaints/Create.cshtml +++ b/Yavsc/Views/HairTaints/Create.cshtml @@ -18,6 +18,12 @@ +
+ +
+ +
+
diff --git a/Yavsc/Views/HairTaints/Edit.cshtml b/Yavsc/Views/HairTaints/Edit.cshtml index 5e0ab9aa..0b7d68b2 100644 --- a/Yavsc/Views/HairTaints/Edit.cshtml +++ b/Yavsc/Views/HairTaints/Edit.cshtml @@ -19,6 +19,13 @@
+
+ +
+ + +
+
diff --git a/Yavsc/Views/HairTaints/Index.cshtml b/Yavsc/Views/HairTaints/Index.cshtml index 358094f5..5a02d5cb 100644 --- a/Yavsc/Views/HairTaints/Index.cshtml +++ b/Yavsc/Views/HairTaints/Index.cshtml @@ -14,6 +14,9 @@ @Html.DisplayNameFor(model => model.Brand) + + @Html.DisplayNameFor(model => model.Color) + @@ -22,6 +25,9 @@ @Html.DisplayFor(modelItem => item.Brand) + + @Html.DisplayFor(modelItem => item.Color) + Edit | Details |