You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Dispatch/Models/GrabViewListViewModel.cs

39 lines
1.0 KiB
C#

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<GrabViewListViewModel> AsGrabViewListViewModelList(this IEnumerable<GrabInfo> model)
{
return Mapper.Map<IEnumerable<GrabInfo>, List<GrabViewListViewModel>>(model);
}
}
}