zoukankan      html  css  js  c++  java
  • asp.net mvc entity framework 数据库 练习(一)

    本文启发的思路来源于asp.net mvc 6 的entity framework,微软MSDN中的官方项目contoso university 虚构的数据库

    原文链接如下;

    https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application

    针对项目中的实际需求,考虑使用的数据结构包括:生产线员工,生产线设备,产品型号,工艺数据等信息。

        public class UserInfo
        {
            public string UserID { get; set; }
            public string UserName { get; set; }
            public int UserAge { get; set; }
            public string UserSkill { get; set; }
            public string UserJob { get; set; }
            public string UserRole { get; set; }
            public string UserStatus { get; set; }
            public string UserFingerPrint { get; set; }
            public string UserTeamNum { get; set; }
            public DateTime UserTime { get; set; }
            public string UserPassword { get; set; }
    
            public virtual ICollection<DeviceInfo> DeviceInfoes { get; set; }
            public virtual ICollection<ProductInfo> ProductInfoes { get; set; }
        }
        //Device 
        public class DeviceInfo
        {
            public int DeviceID { get; set; }
            public string DeviceName { get; set; }
            public DateTime? DeviceTimeBought { get; set; }
            public DateTime? DeviceTimeUseAll { get; set; }
            public DateTime? DeviceTimeUserAfterMaintain { get; set; }
            public DateTime? DeviceTimeUseThisTime { get; set; }
            public DateTime? DeviceMaintainTime { get; set; }
            public string DevieceUser { get; set; }
            public string DeviceBelonging { get; set; }
            public string DeviceRunCycyle { get; set; }
            public string DevicepartNum { get; set; }
            public int? ProductID { get; set; }
            public string UserID { get; set; }
    
            public virtual UserInfo UserInfo { get; set; }
            public virtual ProductInfo ProductInfo { get; set; }
    
        }
        public class ProductInfo
        {
            public int ProductID { get; set; }
            public string DeviceID { get; set; }
            public string UserID { get; set; }
            public int ProductpipeLineNum { get; set; }
            public int ProductOrderNum { get; set; }
            public string ProductMark { get; set; }
            public float? ProductParameter { get; set; }
            public float? ProductDifference { get; set; }
            public float? ProductRunOut { get; set; }
            public string ProductRivetPart { get; set; }
            public string ProductRivet2Part { get; set; }
            public string ProductRubPart { get; set; }
            public string ProductHubPart { get; set; }
            public string ProductSuckPart { get; set; }
            public string ProductPadPart { get; set; }
            public string ProductTeamNum { get; set; }
            public string ProductStatus { get; set; }
            public DateTime? ProductStartTime { get; set; }
            public DateTime? ProductFinishedTime { get; set; }
            public bool ProductResult { get; set; }
    
            public virtual UserInfo UserInfo { get; set; }
            public virtual DeviceInfo DeviceInfo { get; set; }
    
    
        }
        //ParameterData
        public class ParameterDate
        {
    
            public DateTime? PDPickTime { get; set; }
            public string PDRunout { get; set; }
            public string PDDifference { get; set; }
            public string PDPressure { get; set; }
            public string PDStatus { get; set; }
            public string PDCountID { get; set; }
            public string ProductID { get; set; }
    
            public string DeviceID { get; set; }
            public string UserID { get; set; }
    
            public virtual UserInfo UserInfo { get; set; }
            public virtual ProductInfo ProductInfo { get; set; }
            public virtual DeviceInfo DeviceInfo { get; set; }
        }

    通过设计数据库将数据关联起来,实现crud操作,下一节内容继续按照文章的思路继续。

  • 相关阅读:
    Vue组件
    Vue内置指令
    [vue插件]基于vue2.x的电商图片放大镜插件
    Vue过渡与动画
    一个 VUE 组件:实现子元素 scroll 父元素容器不跟随滚动(兼容PC、移动端)
    ORM进阶之Hibernate中对象的三大状态解析
    jQuery的CSS操作
    SqlCommand.DeriveParameters failed
    Web Service学习-CXF开发Web Service实例demo(一)
    去哪网实习总结:如何配置数据库连接(JavaWeb)
  • 原文地址:https://www.cnblogs.com/ThreeS/p/9535530.html
Copyright © 2011-2022 走看看