using iWareCommon.Common.Entity; using iWareCommon.Utils; using iWareDataCore.ORM; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWareDataCore.BASE.Entity { public class WebOrderDetailViewEntity : ICommonEntity { /// /// 1物料主键 /// public int Id { get; set; } public string RequestOrder { get; set; } public string ListNo { get; set; } public int WebOrderId { get; set; } public int? SequenceNo { get; set; } public string MaterialNo { get; set; } public string NestingNo { get; set; } public string NestingName { get; set; } public int? MaterialId { get; set; } public int? Quantity { get; set; } public string ArticleNumber { get; set; } public string Grade { get; set; } public string ClassifiCation { get; set; } public string ProfileType { get; set; } public string Length { get; set; } public string Density { get; set; } public string WebHeight { get; set; } public string WebThickness { get; set; } public string FlangeWidth { get; set; } public string FlangeThickness { get; set; } public string SectionDim { get; set; } public string UnitWeight { get; set; } public string Remark { get; set; } public DateTime CreateTime { get; set; } /// /// 无参构造 /// public WebOrderDetailViewEntity() { } /// /// 有参构造 /// /// orm映射的类 public WebOrderDetailViewEntity(WebOrderDetailView webOrderDetailView) { EntityPropHelper.CopyProp(webOrderDetailView, this, GetColumnMap()); } /// /// 将对象转换成ORM中的类型 /// /// Orm中的BASEMaterial类型 public WebOrderDetailView ToOrm() { WebOrderDetailView webOrderDetailView = new WebOrderDetailView(); EntityPropHelper.CopyProp(this, webOrderDetailView, GetColumnMap()); return webOrderDetailView; } /// /// 获取自定义角色类中的字段名为键,orm中对象的字段名为值的字段 /// /// public static Dictionary GetColumnMap() { return new Dictionary() { { "Id", "id"}, { "RequestOrder", "requestorder"}, { "ListNo", "listno"}, { "WebOrderId", "weborderid"}, { "SequenceNo", "sequenceno"}, { "MaterialNo", "materialno"}, { "NestingNo", "nestingno"}, { "NestingName", "nestingname"}, { "MaterialId", "materialid"}, { "Quantity", "quantity"}, { "ArticleNumber", "articlenumber"}, { "Grade", "grade"}, { "ClassifiCation", "classification"}, { "ProfileType", "profiletype"}, { "Length", "length"}, { "Density", "density"}, { "WebHeight", "webheight"}, { "WebThickness", "webthickness"}, { "FlangeWidth", "flangewidth"}, { "FlangeThickness", "flangethickness"}, { "SectionDim", "sectiondim"}, { "UnitWeight", "unitweight"}, { "Remark", "remark"}, { "CreateTime", "createtime"} }; } /// /// 根据 /// /// 字段 /// public static string GetColumnName(string name) { var columnMap = GetColumnMap(); return columnMap.ContainsKey(name) ? columnMap[name] : name; } /// /// 获取对应的表名 /// /// 表名 public static string GetTableName() { return "[dbo].[WebOrderDetailView]"; } } }