using AutoMapper; using DSWeb.Areas.MvcShipping.DB; using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace DSWeb.Areas.MvcShipping.Models.MsOpRule { public class OpRuleEditViewModel { public string GID { get; set; } public string Code { get; set; } public string Title { get; set; } public string RedAlertField { get; set; } public bool SaveDisable { get; set; } public bool Enable { get; set; } public string CompareType { get; set; } public List Items { get; set; } } public class OpRuleItemEditViewModel { public string Field { get; set; } public string Compare { get; set; } public string Value { get; set; } } public static class OpRuleEditViewModelExt { public static OpRule AsModel(this OpRuleEditViewModel src) { return Mapper.Map(src); } public static OpRule AsModel(this OpRuleEditViewModel src, OpRule dest) { return Mapper.Map(src, dest); } public static OpRuleEditViewModel AsEditViewModel(this OpRule src) { return Mapper.Map(src); } } public static class OpRuleItemEditViewModelExt { public static OpRuleItem AsModel(this OpRuleItemEditViewModel src) { return Mapper.Map(src); } public static OpRuleItem AsModel(this OpRuleItemEditViewModel src, OpRuleItem dest) { return Mapper.Map(src, dest); } public static List AsModelList(this IEnumerable src) { return Mapper.Map, List>(src); } public static OpRuleItemEditViewModel AsEditViewModel(this OpRuleItem src) { return Mapper.Map(src); } public static List AsEditViewModelList(this IEnumerable src) { return Mapper.Map, List>(src); } } }