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 { //列表viewmodel的包装类 public class OpRuleListViewModelList { public int Total { get; set; } public List List { get; set; } } //列表viewmodel public class OpRuleListViewModel { 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 EnableDisableTime { get; set; } } //检查时获取列表viewmodel public class OpRuleCheckListViewModel { public string Title { get; set; } public string RedAlertField { get; set; } public bool SaveDisable { get; set; } public string CompareType { get; set; } public List Items { get; set; } } //检查时获取item的列表的viewmodel public class OpRuleItemCheckListViewModel { public string Field { get; set; } public string Compare { get; set; } public string Value { get; set; } } //列表拓展 public static class OpRuleListViewModelExt { public static List AsListViewModelList(this IEnumerable src) { return Mapper.Map, List>(src); } } //检查列表拓展 public static class OpRuleCheckListViewModelExt { public static OpRuleCheckListViewModel AsCheckListViewModel(this OpRule src) { return Mapper.Map(src); } public static List AsCheckListViewModelList(this IEnumerable src) { return Mapper.Map, List>(src); } public static List AsCheckListViewModelList(this IEnumerable src) { return Mapper.Map, List>(src); } } }