eeacfebec9
Adjust namespace
49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
using System.Web.Mvc;
|
|
using LeafWeb.WebCms.Models;
|
|
|
|
namespace LeafWeb.WebCms.Controllers
|
|
{
|
|
public class LeafInputController : BaseController
|
|
{
|
|
public ActionResult Create()
|
|
{
|
|
var viewModel = new LeafInputCreate();
|
|
HydrateCreateViewModel(viewModel);
|
|
return PartialView(viewModel);
|
|
}
|
|
|
|
//[HttpParamAction]
|
|
[HttpPost]
|
|
public ActionResult Submit(LeafInputCreate viewModel)
|
|
{
|
|
if (!ModelState.IsValid)
|
|
return CurrentUmbracoPage();
|
|
|
|
// directory name is the sessionID
|
|
//var files = GetBackloadDirectoryFiles(Session.SessionID);
|
|
|
|
//if (!files.Any())
|
|
// ModelState.AddModelError("Files", "Must select at least one file");
|
|
|
|
//if (ModelState.IsValid && !IsHttpParamActionMatch()) // HttpParamMatch indicates it's backing out from Confirm
|
|
//{
|
|
// // Go to confirmation
|
|
// var confirmViewModel = new ConfirmViewModel(viewModel, files.Select(f => f.Name).ToArray());
|
|
// HydrateCreateViewModel(confirmViewModel);
|
|
|
|
// return View("Confirm", confirmViewModel);
|
|
//}
|
|
|
|
HydrateCreateViewModel(viewModel);
|
|
return CurrentUmbracoPage();
|
|
}
|
|
|
|
private void HydrateCreateViewModel(dynamic viewModel)
|
|
{
|
|
if (viewModel.PhotosynthesisType == null)
|
|
viewModel.PhotosynthesisType = new SelectListViewModel();
|
|
if (viewModel.PhotosynthesisType.ListItems == null)
|
|
viewModel.PhotosynthesisType.ListItems = GetPhotosynthesisTypeSelectList();
|
|
}
|
|
}
|
|
} |