DS7/DSWeb/Areas/Dispatch/Models/DriverRegistViewModel.cs

41 lines
989 B
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 DriverRegistViewModel
{
public string DriverName { get; set; }
public string Tel { get; set; }
public string OpenId { get; set; }
public string RegName { get; set; }
public bool IsAudit { get; set; }
}
public static class DriverRegistExt
{
public static DriverInfo AsDriverInfo(this DriverRegistViewModel model)
{
return Mapper.Map<DriverInfo>(model);
}
public static DriverInfo AsDriverInfo(this DriverRegistViewModel model, DriverInfo dest)
{
return Mapper.Map(model, dest);
}
public static DriverRegistViewModel AsDriverRegistViewModel(this DriverInfo model)
{
return Mapper.Map<DriverRegistViewModel>(model);
}
}
}