This commit is contained in:
2018-07-22 15:18:30 +01:00
parent 9f4329fa12
commit 6db156716d
11 changed files with 527 additions and 14 deletions

View File

@ -115,7 +115,7 @@ namespace Yavsc.Controllers
{
return HttpNotFound();
}
ViewData["OwnerId"] = new SelectList(_context.ApplicationUser, "Id", "Owner", gitRepositoryReference.OwnerId);
ViewBag.OwnerId = new SelectList(_context.ApplicationUser, "Id", "Owner", gitRepositoryReference.OwnerId);
return View(gitRepositoryReference);
}

View File

@ -10,6 +10,8 @@ using Yavsc.Server.Helpers;
using Yavsc.Models.Workflow;
using Yavsc.Models.Payment;
using Yavsc.Server.Models.IT.SourceCode;
using Microsoft.AspNet.Mvc.Localization;
using Microsoft.Extensions.Localization;
namespace Yavsc.Controllers
{
@ -18,11 +20,17 @@ namespace Yavsc.Controllers
{
private ApplicationDbContext _context;
ILogger _logger;
IStringLocalizer<ProjectController> _localizer;
public ProjectController(ApplicationDbContext context, ILoggerFactory loggerFactory)
public ProjectController(ApplicationDbContext context,
ILoggerFactory loggerFactory,
IStringLocalizer<ProjectController> localizer
)
{
_context = context;
_localizer = localizer;
_logger = loggerFactory.CreateLogger<ProjectController>();
}
// GET: Project
@ -105,11 +113,14 @@ namespace Yavsc.Controllers
{
return HttpNotFound();
}
ViewData["ClientId"] = new SelectList(_context.ApplicationUser, "Id", "Client", project.ClientId);
ViewData["ActivityCode"] = new SelectList(_context.Activities, "Code", "Context", project.ActivityCode);
ViewData["PerformerId"] = new SelectList(_context.Performers, "PerformerId", "PerformerProfile", project.PerformerId);
ViewData["PaymentId"] = new SelectList(_context.PayPalPayments, "CreationToken", "Regularisation", project.PaymentId);
ViewData["Name"] = new SelectList(_context.GitRepositoryReference, "Path", "Repository", project.Name);
/* ViewBag.ClientId = new SelectList(_context.ApplicationUser, "Id", "Client", project.ClientId);
ViewBag.ActivityCodeItems = new SelectList(_context.Activities, "Code", "Context", project.ActivityCode);
ViewBag.PerformerId = new SelectList(_context.Performers, "PerformerId", "PerformerProfile", project.PerformerId);
ViewBag.PaymentId = new SelectList(_context.PayPalPayments, "CreationToken", "Regularisation", project.PaymentId);
ViewBag.Name = new SelectList(_context.GitRepositoryReference, "Path", "Repository", project.Name);
*/
ViewBag.Status = Yavsc.Extensions.EnumExtensions.GetSelectList(typeof(QueryStatus), _localizer, project.Status);
ViewBag.Repository = new SelectList(_context.GitRepositoryReference, "Path", "Repository", project.Repository);
return View(project);
}
@ -124,11 +135,6 @@ namespace Yavsc.Controllers
await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
ViewData["ClientId"] = new SelectList(_context.ApplicationUser, "Id", "Client", project.ClientId);
ViewData["ActivityCode"] = new SelectList(_context.Activities, "Code", "Context", project.ActivityCode);
ViewData["PerformerId"] = new SelectList(_context.Performers, "PerformerId", "PerformerProfile", project.PerformerId);
ViewData["PaymentId"] = new SelectList(_context.PayPalPayments, "CreationToken", "Regularisation", project.PaymentId);
ViewData["Name"] = new SelectList(_context.GitRepositoryReference, "Path", "Repository", project.Name);
return View(project);
}

View File

@ -17,7 +17,7 @@
<div class="form-group">
<label asp-for="OwnerId" class="control-label col-md-2">OwnerId</label>
<div class="col-md-10">
<select asp-for="OwnerId" class="form-control" />
<select asp-for="OwnerId" class="form-control" asp-items="@ViewBag.OwnerId" />
<span asp-validation-for="OwnerId" class="text-danger" />
</div>
</div>

View File

@ -51,7 +51,7 @@
<div class="form-group">
<label asp-for="Status" class="col-md-2 control-label"></label>
<div class="col-md-10">
<select asp-for="Status" class="form-control"></select>
<select asp-for="Status" class="form-control" asp-items="@ViewBag.Status"></select>
<span asp-validation-for="Status" class="text-danger" />
</div>
</div>