diff --git a/Yavsc/Controllers/CommandController.cs b/Yavsc/Controllers/CommandController.cs index 90c7d682..1cdfcd85 100644 --- a/Yavsc/Controllers/CommandController.cs +++ b/Yavsc/Controllers/CommandController.cs @@ -111,7 +111,7 @@ namespace Yavsc.Controllers ViewBag.GoogleSettings = _googleSettings; var userid = User.GetUserId(); var user = _userManager.FindByIdAsync(userid).Result; - return View(new BookQuery(new Location(),DateTime.Now.AddHours(4)) + return View(new BookQuery(activityCode,new Location(),DateTime.Now.AddHours(4)) { PerformerProfile = pro, PerformerId = pro.PerformerId, @@ -125,6 +125,7 @@ namespace Yavsc.Controllers [ValidateAntiForgeryToken] public async Task Create(BookQuery command) { + var uid = User.GetUserId(); var prid = command.PerformerId; if (string.IsNullOrWhiteSpace(uid) @@ -181,6 +182,7 @@ namespace Yavsc.Controllers $"{yaev.Message}\r\n-- \r\n{yaev.Previsional}\r\n{yaev.EventDate}\r\n" ); } + ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == command.ActivityCode); ViewBag.GoogleSettings = _googleSettings; return View("CommandConfirmation",command); } diff --git a/Yavsc/Models/Bank/BankIdentity.cs b/Yavsc/Models/Bank/BankIdentity.cs index 9d58b1b4..fe960d49 100644 --- a/Yavsc/Models/Bank/BankIdentity.cs +++ b/Yavsc/Models/Bank/BankIdentity.cs @@ -2,7 +2,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Yavsc.Model.Bank +namespace Yavsc.Models.Bank { public class BankIdentity { diff --git a/Yavsc/Models/Booking/BookQuery.cs b/Yavsc/Models/Booking/BookQuery.cs index 3309d9a5..6cbfbeb8 100644 --- a/Yavsc/Models/Booking/BookQuery.cs +++ b/Yavsc/Models/Booking/BookQuery.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Newtonsoft.Json; using Yavsc.Models.Billing; using Yavsc.Models.Relationship; @@ -10,37 +11,49 @@ namespace Yavsc.Models.Booking /// Query, for a date, with a given perfomer, at this given place. /// - public class BookQuery : NominativeServiceCommand { - /// - /// The command identifier - /// - [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public long Id {get; set; } + public class BookQuery : NominativeServiceCommand + { + /// + /// The command identifier + /// + [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id { get; set; } - [Display(Name="Event date")] - public DateTime EventDate{ + [Display(Name = "Event date")] + public DateTime EventDate + { get; set; - } - public Location Location { + } + public Location Location + { get; set; - } - - public LocationType LocationType { - set; + } + + public LocationType LocationType + { + set; get; } - public string Reason { get; set; } - + public string Reason { get; set; } + public BookQuery() { } - public BookQuery(Location eventLocation, DateTime eventDate) - { - Location = eventLocation; - EventDate = eventDate; - } + public BookQuery(string activityCode, Location eventLocation, DateTime eventDate) + { + Location = eventLocation; + EventDate = eventDate; + ActivityCode = activityCode; + } + + [Required] + public string ActivityCode { get; set; } + + [ForeignKey("ActivityCode"),JsonIgnore] + public virtual Activity Context  { get; set ; } + } } \ No newline at end of file diff --git a/Yavsc/Models/Forms/Field.cs b/Yavsc/Models/Forms/Field.cs index 2513a46f..5c5e2c6b 100644 --- a/Yavsc/Models/Forms/Field.cs +++ b/Yavsc/Models/Forms/Field.cs @@ -1,9 +1,9 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using Yavsc.Model.Forms.Validation; -namespace Yavsc.Model.Forms +namespace Yavsc.Models.Forms { + using Validation; public abstract class Field { [Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)] diff --git a/Yavsc/Models/Forms/FieldSet.cs b/Yavsc/Models/Forms/FieldSet.cs index 93ebae4f..2d5f8716 100644 --- a/Yavsc/Models/Forms/FieldSet.cs +++ b/Yavsc/Models/Forms/FieldSet.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Yavsc.Model.Forms +namespace Yavsc.Models.Forms { public class FieldSet { diff --git a/Yavsc/Models/Forms/Validation/Method.cs b/Yavsc/Models/Forms/Validation/Method.cs index 13649d94..bc1d4f54 100644 --- a/Yavsc/Models/Forms/Validation/Method.cs +++ b/Yavsc/Models/Forms/Validation/Method.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Yavsc.Model.Forms.Validation +namespace Yavsc.Models.Forms.Validation { public class Method { diff --git a/Yavsc/Models/Forms/Validation/Required.cs b/Yavsc/Models/Forms/Validation/Required.cs index 3008c121..b309e898 100644 --- a/Yavsc/Models/Forms/Validation/Required.cs +++ b/Yavsc/Models/Forms/Validation/Required.cs @@ -1,4 +1,4 @@ -namespace Yavsc.Model.Forms.Validation +namespace Yavsc.Models.Forms.Validation { public class Required : Method { diff --git a/Yavsc/Models/Identity/ApplicationUser.cs b/Yavsc/Models/Identity/ApplicationUser.cs index 708163a8..944a3d23 100644 --- a/Yavsc/Models/Identity/ApplicationUser.cs +++ b/Yavsc/Models/Identity/ApplicationUser.cs @@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Yavsc.Models.Identity; using Yavsc.Models.Chat; -using Yavsc.Model.Bank; +using Yavsc.Models.Bank; using Yavsc.Models.Access; namespace Yavsc.Models diff --git a/Yavsc/ViewModels/Manage/AddBankInfoViewModel.cs b/Yavsc/ViewModels/Manage/AddBankInfoViewModel.cs index 7969a518..0f459bf1 100644 --- a/Yavsc/ViewModels/Manage/AddBankInfoViewModel.cs +++ b/Yavsc/ViewModels/Manage/AddBankInfoViewModel.cs @@ -1,6 +1,6 @@ namespace Yavsc.ViewModels.Manage { - using Model.Bank; + using Models.Bank; public class AddBankInfoViewModel { public BankIdentity Data{get; private set; } diff --git a/Yavsc/ViewModels/Manage/IndexViewModel.cs b/Yavsc/ViewModels/Manage/IndexViewModel.cs index b9ae1619..2864a2c5 100644 --- a/Yavsc/ViewModels/Manage/IndexViewModel.cs +++ b/Yavsc/ViewModels/Manage/IndexViewModel.cs @@ -3,7 +3,7 @@ using Microsoft.AspNet.Identity; namespace Yavsc.ViewModels.Manage { - using Model.Bank; + using Models.Bank; using Models; using Models.Workflow; public class IndexViewModel diff --git a/Yavsc/Views/Command/CommandConfirmation.cshtml b/Yavsc/Views/Command/CommandConfirmation.cshtml index 2540b909..2b3d91b3 100644 --- a/Yavsc/Views/Command/CommandConfirmation.cshtml +++ b/Yavsc/Views/Command/CommandConfirmation.cshtml @@ -1,7 +1,7 @@ @model BookQuery @using Yavsc.Models.Google.Messaging @{ - ViewData["Title"] = SR["Command confirmation"]+" "+SR[Model.PerformerProfile.ActivityCode]; + ViewData["Title"] = SR["Command confirmation"]+" "+ViewBag.Activity.Name; }

@ViewData["Title"]

diff --git a/Yavsc/Views/Command/Create.cshtml b/Yavsc/Views/Command/Create.cshtml index d9f575e7..20c6d9c1 100644 --- a/Yavsc/Views/Command/Create.cshtml +++ b/Yavsc/Views/Command/Create.cshtml @@ -1,15 +1,11 @@ -@model BookQuery -@{ - ViewData["Title"] = SR["Book "+ViewBag.Activity.Code]; -} -@section header{ - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } - - - - - +@model BookQuery +@{ ViewData["Title"] = SR["Book "+ViewBag.Activity.Code]; } + + + + +@section header { -} +} @section scripts{ }

@ViewData["Title"]

@@ -122,73 +117,85 @@ $(document).ready(function(){

@SR["Fill in your book query"]


-
+
-
-Votre évennement - -
-
-
-
-
- - +
+ Votre évennement + +
+
+
+
+
+ + - -
+ +
+
+ + +
- - -
- -
-
+
+
+
+
+
+ + @Html.HiddenFor(model=>model.Location.Latitude) @Html.HiddenFor(model=>model.Location.Longitude) +
+
+
-
-
- -
- @Html.HiddenFor(model=>model.Client.Id) - @Html.HiddenFor(model=>model.PerformerId) - + +
+
+
+
- - - +
+@Html.HiddenFor(model=>model.Client.Id) @Html.HiddenFor(model=>model.PerformerId) +
+ + + +@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } diff --git a/Yavsc/wwwroot/css/bootstrap.css b/Yavsc/wwwroot/css/bootstrap.css index 9b52dc05..d697226d 100644 --- a/Yavsc/wwwroot/css/bootstrap.css +++ b/Yavsc/wwwroot/css/bootstrap.css @@ -6458,7 +6458,6 @@ button.close { margin: 1px; text-indent: -999px; cursor: pointer; - background-color: #000 \9; background-color: rgba(0, 0, 0, 0); border: 1px solid #fff; border-radius: 10px;