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.

52 lines
1.4 KiB
C#

11 months ago
using AutoMapper;
using DSWeb.Areas.Dispatch.DB;
using DSWeb.Dispatch.DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace DSWeb.Areas.Dispatch.Models
{
public class DriverAuditViewModel
{
public string GID { get; set; }
public string DriverName { get; set; }
public string Tel { get; set; }
public bool IsAudit { get; set; }
public string AuditStatsName { get; set; }
public string RegName { get; set; }
public string InfoClient { get; set; }
}
public static class DriverAuditViewModelExt
{
private static InfoClientDAL infoClientDAL = new InfoClientDAL();
public static DriverAuditViewModel AsDriverAuditViewModel(this DriverInfo model)
{
return Mapper.Map<DriverAuditViewModel>(model);
}
public static List<DriverAuditViewModel> AsDriverAuditViewModelList(this IEnumerable<DriverInfo> model)
{
return Mapper.Map<IEnumerable<DriverInfo>, List<DriverAuditViewModel>>(model);
}
public static DriverInfo AsDriverModel(this DriverAuditViewModel model)
{
return Mapper.Map<DriverInfo>(model);
}
public static DriverInfo AsDriverModel(this DriverAuditViewModel model, DriverInfo dest)
{
return Mapper.Map(model, dest);
}
}
}