Leaf Input Details

This commit is contained in:
2016-12-16 09:17:42 -05:00
parent 0d9bd7260c
commit 8dc1e0422c
33 changed files with 488 additions and 40 deletions
+7 -4
View File
@@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations;
using AutoMapper;
using LeafWeb.Core.DAL;
using LeafWeb.Core.Entities;
namespace LeafWeb.WebCms.Models
{
@@ -36,18 +37,20 @@ namespace LeafWeb.WebCms.Models
static LeafInputCreate()
{
Mapper.CreateMap<LeafInputCreate, Core.Entities.LeafInput>()
Mapper.CreateMap<LeafInputCreate, LeafInput>()
.ForMember(dest => dest.PhotosynthesisType, opt => opt.Ignore());
Mapper.CreateMap<LeafInput, LeafInputCreate>()
.ForMember(dest => dest.PhotosynthesisType, opt => opt.Ignore());
}
public LeafInputCreate()
{
//PhotosynthesisType = new SelectListViewModel();
PhotosynthesisType = new SelectListViewModel();
}
public Core.Entities.LeafInput GetLeafInput(DataService db)
public LeafInput GetLeafInput(DataService db)
{
var leafInput = new Core.Entities.LeafInput();
var leafInput = new LeafInput();
Mapper.Map(this, leafInput);
leafInput.PhotosynthesisType = db.GetPhotosynthesisType(PhotosynthesisType.Selected);