From da08bc5368c12eaf23c014ba988263b9f3410594 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 16 Jan 2017 15:34:05 +0100 Subject: [PATCH] WIP --- Yavsc/Controllers/EstimateController.cs | 6 ++- Yavsc/Controllers/FrontOfficeController.cs | 25 +++++++++++ Yavsc/Filters/LanguageActionFilter.cs | 4 +- Yavsc/Helpers/EventHelpers.cs | 3 +- ...16002541_bookQueryActivityCode.Designer.cs | 1 - .../20170116002541_bookQueryActivityCode.cs | 2 - .../ApplicationDbContextModelSnapshot.cs | 2 - .../Models/Messaging/BookQueryProviderInfo.cs | 2 + .../Yavsc.Resources.YavscLocalisation.en.resx | 4 ++ .../Yavsc.Resources.YavscLocalisation.resx | 3 +- Yavsc/Views/FrontOffice/BillAcquitment.cshtml | 0 Yavsc/Views/FrontOffice/BillValidation.cshtml | 0 .../EstimateClientValidation.cshtml | 0 .../FrontOffice/EstimateProValidation.cshtml | 0 .../Shared/DisplayTemplates/BookQuery.cshtml | 45 +++++++++++++++++++ .../Shared/DisplayTemplates/Estimate.cshtml | 27 +++++++++++ 16 files changed, 113 insertions(+), 11 deletions(-) create mode 100644 Yavsc/Views/FrontOffice/BillAcquitment.cshtml create mode 100644 Yavsc/Views/FrontOffice/BillValidation.cshtml create mode 100644 Yavsc/Views/FrontOffice/EstimateClientValidation.cshtml create mode 100644 Yavsc/Views/FrontOffice/EstimateProValidation.cshtml create mode 100644 Yavsc/Views/Shared/DisplayTemplates/BookQuery.cshtml create mode 100644 Yavsc/Views/Shared/DisplayTemplates/Estimate.cshtml diff --git a/Yavsc/Controllers/EstimateController.cs b/Yavsc/Controllers/EstimateController.cs index f57d3216..594508bf 100644 --- a/Yavsc/Controllers/EstimateController.cs +++ b/Yavsc/Controllers/EstimateController.cs @@ -101,11 +101,13 @@ namespace Yavsc.Controllers _context.Estimates .Add(estimate); _context.SaveChanges(); - + var query = _context.BookQueries.FirstOrDefault( + q=>q.Id == estimate.CommandId + ); var perfomerProfile = _context.Performers .Include( perpr => perpr.Performer).FirstOrDefault( - x=>x.PerformerId == estimate.Query.PerformerId + x=>x.PerformerId == query.PerformerId ); var command = _context.BookQueries.FirstOrDefault( cmd => cmd.Id == estimate.CommandId diff --git a/Yavsc/Controllers/FrontOfficeController.cs b/Yavsc/Controllers/FrontOfficeController.cs index fc28846f..70f18539 100644 --- a/Yavsc/Controllers/FrontOfficeController.cs +++ b/Yavsc/Controllers/FrontOfficeController.cs @@ -120,5 +120,30 @@ namespace Yavsc.Controllers throw new Exception("No data"); return View("Estimate.pdf",estimate); } + + [Authorize] + public IActionResult EstimateProValidation() + { + throw new NotImplementedException(); + + } + + [Authorize] + public IActionResult EstimateClientValidation() + { + throw new NotImplementedException(); + + } + [Authorize] + public IActionResult BillValidation() + { + throw new NotImplementedException(); + + } + [Authorize] + public IActionResult BillAcquitment() + { + throw new NotImplementedException(); + } } } diff --git a/Yavsc/Filters/LanguageActionFilter.cs b/Yavsc/Filters/LanguageActionFilter.cs index 61c60b31..8bb4852d 100644 --- a/Yavsc/Filters/LanguageActionFilter.cs +++ b/Yavsc/Filters/LanguageActionFilter.cs @@ -46,10 +46,10 @@ namespace Yavsc } if (culture != null) { #if DNX451 - System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(culture); + // System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(culture); System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture); #else - CultureInfo.CurrentCulture = new CultureInfo(culture); + // CultureInfo.CurrentCulture = new CultureInfo(culture); CultureInfo.CurrentUICulture = new CultureInfo(culture); #endif } diff --git a/Yavsc/Helpers/EventHelpers.cs b/Yavsc/Helpers/EventHelpers.cs index f65d352b..d50970e6 100644 --- a/Yavsc/Helpers/EventHelpers.cs +++ b/Yavsc/Helpers/EventHelpers.cs @@ -19,7 +19,8 @@ namespace Yavsc.Helpers EventDate = query.EventDate, Location = query.Location, Id = query.Id, - Reason = query.Reason + Reason = query.Reason, + ActivityCode = query.ActivityCode }; return yaev; } diff --git a/Yavsc/Migrations/20170116002541_bookQueryActivityCode.Designer.cs b/Yavsc/Migrations/20170116002541_bookQueryActivityCode.Designer.cs index a865e0ce..ce9c7fdf 100644 --- a/Yavsc/Migrations/20170116002541_bookQueryActivityCode.Designer.cs +++ b/Yavsc/Migrations/20170116002541_bookQueryActivityCode.Designer.cs @@ -1,7 +1,6 @@ using System; using Microsoft.Data.Entity; using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; using Microsoft.Data.Entity.Migrations; using Yavsc.Models; diff --git a/Yavsc/Migrations/20170116002541_bookQueryActivityCode.cs b/Yavsc/Migrations/20170116002541_bookQueryActivityCode.cs index 988c74c8..08db76d4 100644 --- a/Yavsc/Migrations/20170116002541_bookQueryActivityCode.cs +++ b/Yavsc/Migrations/20170116002541_bookQueryActivityCode.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using Microsoft.Data.Entity.Migrations; namespace Yavsc.Migrations diff --git a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs index 50ba8019..958d7744 100644 --- a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1,8 +1,6 @@ using System; using Microsoft.Data.Entity; using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/Yavsc/Models/Messaging/BookQueryProviderInfo.cs b/Yavsc/Models/Messaging/BookQueryProviderInfo.cs index b34cf5f6..9290c894 100644 --- a/Yavsc/Models/Messaging/BookQueryProviderInfo.cs +++ b/Yavsc/Models/Messaging/BookQueryProviderInfo.cs @@ -15,6 +15,8 @@ namespace Yavsc.Model public decimal? Previsional { get; set; } public string Reason { get; set; } + + public string ActivityCode { get; set; } } } diff --git a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx index a41d6026..3f9767bd 100644 --- a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx +++ b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx @@ -323,6 +323,10 @@ {0} has been notified of your query, you should be fast contacted regarding his calendar, {0} should be available for this booking + Paramètres musicien (l'instrument) + Paramètres Dj (le compte SoundCloud.com) + Paramètres formation (les partenaires) + Paramètres généraux: une couleur musicale You need to be authenticated in order to contact a performer You're not administrator diff --git a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx index 15f25814..c2b434b7 100644 --- a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx +++ b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx @@ -358,6 +358,7 @@ Titre à Double identification + Activité Utilisateur Coût unitaire Se désinscrire Utiliser un compte local pour se connecter @@ -374,7 +375,7 @@ {0} à été notifié de votre demande, vous devriez être contacté rapidement Au vu de son calendrier, {0} devrait être disponible pour ce rendez-vous - Paramètres musicien (l'instrument) + Paramètres musicien (l'instrument) Paramètres Dj (le compte SoundCloud.com) Paramètres formation (les partenaires) Paramètres généraux: une couleur musicale diff --git a/Yavsc/Views/FrontOffice/BillAcquitment.cshtml b/Yavsc/Views/FrontOffice/BillAcquitment.cshtml new file mode 100644 index 00000000..e69de29b diff --git a/Yavsc/Views/FrontOffice/BillValidation.cshtml b/Yavsc/Views/FrontOffice/BillValidation.cshtml new file mode 100644 index 00000000..e69de29b diff --git a/Yavsc/Views/FrontOffice/EstimateClientValidation.cshtml b/Yavsc/Views/FrontOffice/EstimateClientValidation.cshtml new file mode 100644 index 00000000..e69de29b diff --git a/Yavsc/Views/FrontOffice/EstimateProValidation.cshtml b/Yavsc/Views/FrontOffice/EstimateProValidation.cshtml new file mode 100644 index 00000000..e69de29b diff --git a/Yavsc/Views/Shared/DisplayTemplates/BookQuery.cshtml b/Yavsc/Views/Shared/DisplayTemplates/BookQuery.cshtml new file mode 100644 index 00000000..5eda4d76 --- /dev/null +++ b/Yavsc/Views/Shared/DisplayTemplates/BookQuery.cshtml @@ -0,0 +1,45 @@ +@model BookQuery + +
+ +
+ @Html.DisplayNameFor(model => model.EventDate) +
+
+ @Html.DisplayFor(model => model.EventDate) +
+ +
+ @Html.DisplayNameFor(model => model.Client) +
+
+ @Html.DisplayFor(model => model.Client.UserName) +
+ +
+ @Html.DisplayNameFor(model => model.Location.Address) +
+
+ @Html.DisplayFor(model => model.Location.Address) +
+ +
+ @Html.DisplayNameFor(model => model.PerformerProfile) +
+
+ @Html.DisplayFor(model => model.PerformerProfile.Performer.UserName) +
+ +
+ @Html.DisplayNameFor(model => model.ValidationDate) +
+
+ @if (Model.ValidationDate==null) { + @SR["NotValidated"] + } + else { + @Html.DisplayFor(model => model.ValidationDate) + } +
+ +
\ No newline at end of file diff --git a/Yavsc/Views/Shared/DisplayTemplates/Estimate.cshtml b/Yavsc/Views/Shared/DisplayTemplates/Estimate.cshtml new file mode 100644 index 00000000..3dd0133d --- /dev/null +++ b/Yavsc/Views/Shared/DisplayTemplates/Estimate.cshtml @@ -0,0 +1,27 @@ +@model Estimate +
+
+ @Html.DisplayNameFor(model => model.Title) +
+
+ @Html.DisplayFor(model => model.Title) +
+ +
+ @Html.DisplayNameFor(model => model.Description) +
+
+ @Html.DisplayFor(model => model.Description) +
+ +
+ @Html.DisplayNameFor(model => model.Bill) +
+
+ @foreach (var cl in Model.Bill) { + @await Html.PartialAsync("BillingLine", cl); + } +
+
+ +@await Component.InvokeAsync("Estimate",Model.Id)