diff --git a/Yavsc/Controllers/CommandController.cs b/Yavsc/Controllers/CommandController.cs index 4b2a2d62..90c7d682 100644 --- a/Yavsc/Controllers/CommandController.cs +++ b/Yavsc/Controllers/CommandController.cs @@ -91,19 +91,23 @@ namespace Yavsc.Controllers /// /// /// - public IActionResult Create(string id) + public IActionResult Create(string id, string activityCode) { if (string.IsNullOrWhiteSpace(id)) throw new InvalidOperationException( "This method needs a performer id" ); + if (string.IsNullOrWhiteSpace(activityCode)) + throw new InvalidOperationException( + "This method needs an activity code" + ); var pro = _context.Performers.Include( x => x.Performer).FirstOrDefault( x => x.PerformerId == id ); if (pro == null) return HttpNotFound(); - + ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == activityCode); ViewBag.GoogleSettings = _googleSettings; var userid = User.GetUserId(); var user = _userManager.FindByIdAsync(userid).Result; diff --git a/Yavsc/Views/Command/Create.cshtml b/Yavsc/Views/Command/Create.cshtml index 33c1a6ed..0ebb5b3d 100644 --- a/Yavsc/Views/Command/Create.cshtml +++ b/Yavsc/Views/Command/Create.cshtml @@ -1,6 +1,6 @@ @model BookQuery @{ - ViewData["Title"] = SR["Book "+Model.PerformerProfile.ActivityCode]; + ViewData["Title"] = SR["Book "+ViewBag.Activity.Code]; } @section header{ @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } diff --git a/Yavsc/Views/FrontOffice/Book.cshtml b/Yavsc/Views/FrontOffice/Book.cshtml index 6f77f910..9acda2a1 100644 --- a/Yavsc/Views/FrontOffice/Book.cshtml +++ b/Yavsc/Views/FrontOffice/Book.cshtml @@ -10,6 +10,7 @@ await Html.RenderPartialAsync("PerformerProfile", profile) ;
+
}