The inspiration for this article comes from the Entity Framework of ASP. NET MVC 6, the official project Contoso University fictitious database in Microsoft MSDN
The original link is as follows;
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
For the actual needs of the project, the data structures considered include: production line staff, production line equipment, product model, process data and other information.
Public classUserInfo { Public stringUserID {Get;Set; } Public stringUserName {Get;Set; } Public intUserage {Get;Set; } Public stringUserskill {Get;Set; } Public stringUserjob {Get;Set; } Public stringuserrole {Get;Set; } Public stringUserStatus {Get;Set; } Public stringUserfingerprint {Get;Set; } Public stringUserteamnum {Get;Set; } PublicDateTime Usertime {Get;Set; } Public stringUserPassword {Get;Set; } Public VirtualIcollection<deviceinfo> Deviceinfoes {Get;Set; } Public VirtualIcollection<productinfo> Productinfoes {Get;Set; } }
//Device Public classDeviceInfo { Public intDeviceID {Get;Set; } Public stringdevicename {Get;Set; } PublicDatetime? Devicetimebought {Get;Set; } PublicDatetime? Devicetimeuseall {Get;Set; } PublicDatetime? Devicetimeuseraftermaintain {Get;Set; } PublicDatetime? Devicetimeusethistime {Get;Set; } PublicDatetime? Devicemaintaintime {Get;Set; } Public stringDevieceuser {Get;Set; } Public stringdevicebelonging {Get;Set; } Public stringDeviceruncycyle {Get;Set; } Public stringDevicepartnum {Get;Set; } Public int? ProductID {Get;Set; } Public stringUserID {Get;Set; } Public VirtualUserInfo UserInfo {Get;Set; } Public VirtualProductInfo ProductInfo {Get;Set; } }
Public classProductInfo { Public intProductID {Get;Set; } Public stringDeviceID {Get;Set; } Public stringUserID {Get;Set; } Public intProductpipelinenum {Get;Set; } Public intProductordernum {Get;Set; } Public stringProductmark {Get;Set; } Public float? Productparameter {Get;Set; } Public float? productdifference {Get;Set; } Public float? Productrunout {Get;Set; } Public stringProductrivetpart {Get;Set; } Public stringProductrivet2part {Get;Set; } Public stringProductrubpart {Get;Set; } Public stringProducthubpart {Get;Set; } Public stringProductsuckpart {Get;Set; } Public stringProductpadpart {Get;Set; } Public stringProductteamnum {Get;Set; } Public stringProductstatus {Get;Set; } PublicDatetime? Productstarttime {Get;Set; } PublicDatetime? Productfinishedtime {Get;Set; } Public BOOLProductresult {Get;Set; } Public VirtualUserInfo UserInfo {Get;Set; } Public VirtualDeviceInfo DeviceInfo {Get;Set; } }
//Parameterdata Public classParameterdate { PublicDatetime? Pdpicktime {Get;Set; } Public stringPdrunout {Get;Set; } Public stringpddifference {Get;Set; } Public stringpdpressure {Get;Set; } Public stringPdstatus {Get;Set; } Public stringPdcountid {Get;Set; } Public stringProductID {Get;Set; } Public stringDeviceID {Get;Set; } Public stringUserID {Get;Set; } Public VirtualUserInfo UserInfo {Get;Set; } Public VirtualProductInfo ProductInfo {Get;Set; } Public VirtualDeviceInfo DeviceInfo {Get;Set; } }
By designing the database to correlate the data and implement CRUD operations, the next section continues to follow the article's thinking.
ASP. NET MVC Entity Framework database Exercise (i)