using AutoMapper; using DSWeb.Areas.Dispatch.DB; using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace DSWeb.Areas.Dispatch.Models { public class GrabViewListViewModel { public string GID { get; set; } public string InfoClient { get; set; } public bool IsGrab { get; set; } public DateTime? GrabTime { get; set; } public string GrabStatus { get { return IsGrab ? "已抢单" : "未抢单"; } } public string GrabTimeStr { get { return GrabTime.HasValue ? GrabTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; } } } public static class GrabViewListViewModelExt { public static List AsGrabViewListViewModelList(this IEnumerable model) { return Mapper.Map, List>(model); } } }