using sbcLabSystem.Data.Domain.Account; using System; namespace sbcLabSystem.Models.Backstage { public class UserRequestInfoModel { public int Id { get; set; } public bool IsSelected { get; set; } public string CompanyName { get; set; } public string LabName { get; set; } public string Address { get; set; } public string Province { get; set; } public string City { get; set; } public string District { get; set; } public string PostCode { get; set; } public string ManagerName { get; set; } public string ManagerPhone { get; set; } public string ManagerFax { get; set; } public string ManagerMobile { get; set; } public string ManagerEmail { get; set; } public string OperatorName { get; set; } public string OperatorPhone { get; set; } public string OperatorFax { get; set; } public string OperatorMobile { get; set; } public string OperatorEmail { get; set; } public int ProjectId { get; set; } public DateTime RequestTime { get; set; } //更新时间 public DateTime UpdateTime { get; set; } //状态 public int State { get; set; } //实验室用户编号 public string LabCode { get; set; } //用户名 public string LabLoginName { get; set; } //实验室密码 public string LabPassword { get; set; } //备注 public string Remarks { get; set; } public string taxNo { get; set; } public static UserRequestInfoModel FromEntity(UserRequestInfo entity) { if (entity == null) { return new UserRequestInfoModel(); } UserRequestInfoModel viewModel = new UserRequestInfoModel() { Id = entity.Id, CompanyName = entity.CompanyName, LabName = entity.LabName, Address = entity.Address, Province = entity.Province, City = entity.City, District = entity.District, PostCode = entity.PostCode, ManagerName = entity.ManagerName, ManagerPhone = entity.ManagerPhone, ManagerFax = entity.ManagerFax, ManagerMobile = entity.ManagerMobile, ManagerEmail = entity.ManagerEmail, OperatorName = entity.OperatorName, OperatorPhone = entity.OperatorPhone, OperatorFax = entity.OperatorFax, OperatorMobile = entity.OperatorMobile, OperatorEmail = entity.OperatorEmail, ProjectId = entity.ProjectId, RequestTime = entity.RequestTime, UpdateTime = entity.UpdateTime, State = entity.State, LabCode = entity.LabCode, LabLoginName = entity.LabLoginName, LabPassword = entity.LabPassword, Remarks = entity.Remarks, taxNo = entity.taxNo, }; return viewModel; } public static UserRequestInfo FromEntity(UserRequestInfoModel entity) { UserRequestInfo viewModel = new UserRequestInfo() { Id = entity.Id, CompanyName = entity.CompanyName, LabName = entity.LabName, Address = entity.Address, Province = entity.Province, City = entity.City, District = entity.District, PostCode = entity.PostCode, ManagerName = entity.ManagerName, ManagerPhone = entity.ManagerPhone, ManagerFax = entity.ManagerFax, ManagerMobile = entity.ManagerMobile, ManagerEmail = entity.ManagerEmail, OperatorName = entity.OperatorName, OperatorPhone = entity.OperatorPhone, OperatorFax = entity.OperatorFax, OperatorMobile = entity.OperatorMobile, OperatorEmail = entity.OperatorEmail, ProjectId = entity.ProjectId, RequestTime = entity.RequestTime, UpdateTime = entity.UpdateTime, State = entity.State, LabCode = entity.LabCode, LabLoginName = entity.LabLoginName, LabPassword = entity.LabPassword, Remarks = entity.Remarks, taxNo = entity.taxNo, }; return viewModel; } } }