Submit all LeafInputFiles together
This commit is contained in:
@@ -14,23 +14,23 @@ namespace LeafWeb.Web.Controllers
|
||||
{
|
||||
public class LeafCharterController : ControllerBase
|
||||
{
|
||||
public ActionResult Index(int leafInputFileId)
|
||||
public ActionResult Index(int leafInputId)
|
||||
{
|
||||
var hasLeafOutputFile =
|
||||
DataService
|
||||
.GetLeafInputFile(leafInputFileId)?
|
||||
.LeafOutputFiles?
|
||||
.GetLeafInput(leafInputId)?
|
||||
.OutputFiles?
|
||||
.FirstOrDefault(f => f.IsLeafChartFile) != null;
|
||||
|
||||
return View(leafInputFileId);
|
||||
return View(leafInputId);
|
||||
}
|
||||
|
||||
public ActionResult LeafCharts(int leafInputFileId, int number)
|
||||
public ActionResult LeafCharts(int leafInputId, int number)
|
||||
{
|
||||
var leafOutputFile =
|
||||
DataService
|
||||
.GetLeafInputFile(leafInputFileId)?
|
||||
.LeafOutputFiles?
|
||||
.GetLeafInput(leafInputId)?
|
||||
.OutputFiles?
|
||||
.FirstOrDefault(f => f.IsLeafChartFile);
|
||||
|
||||
if (leafOutputFile == null)
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace LeafWeb.Web.Controllers
|
||||
// convert viewModel into Model
|
||||
var leafInput = viewModel.GetFileInput(DataService);
|
||||
// load files into LeafInputFile
|
||||
leafInput.Files =
|
||||
leafInput.InputFiles =
|
||||
(from f in files
|
||||
let bytes = System.IO.File.ReadAllBytes(f.FullName)
|
||||
select new LeafInputFile {Filename = f.Name, Contents = bytes}).ToList();
|
||||
@@ -89,7 +89,7 @@ namespace LeafWeb.Web.Controllers
|
||||
|
||||
var logger = LogManager.GetCurrentClassLogger();
|
||||
logger.Info("LeafInput: {0} Added, {1}, {2}, {3}", leafInput.Id, leafInput.Identifier, leafInput.SiteId, leafInput.Email);
|
||||
logger.Info("LeafInputFiles: {0}, Queued", leafInput.Files.Select(f => f.Id.ToString()).Join(", "));
|
||||
logger.Info("LeafInputFiles: {0}, Queued", leafInput.InputFiles.Select(f => f.Id.ToString()).Join(", "));
|
||||
|
||||
HangfireStartup.TriggerPiscalProcessQueue();
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using LeafWeb.Web.ViewModels.LeafOutput;
|
||||
using LeafWeb.Web.ViewModels.ResultStatus;
|
||||
|
||||
namespace LeafWeb.Web.Controllers
|
||||
{
|
||||
public class LeafOutputController : ControllerBase
|
||||
public class ResultStatusController : ControllerBase
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
var viewModel =
|
||||
DataService.GetLeafInputFiles()
|
||||
DataService.GetLeafInputs()
|
||||
.OrderByDescending(f => f.Id)
|
||||
.ToList()
|
||||
.Select(f => new LeafOutputViewModel(f));
|
||||
.Select(leafInput => new ResultStatusViewModel(leafInput));
|
||||
return View(viewModel);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user