using Dapper; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Models; using System; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TaskManager.Controllers; namespace WpfApp4 { public class JobDbContext:DbContext { public JobDbContext(DbContextOptions options) : base(options) { } public JobDbContext() { this.Database.SetCommandTimeout(System.TimeSpan.FromMinutes(50)); } public JobDbContext(string strConn) { this.Database.SetCommandTimeout(System.TimeSpan.FromMinutes(50)); } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { // 配置数据库连接字符串 optionsBuilder.UseSqlServer(App.HangfireConfig.ConnectionString); } public DbSet SupplierBaseInfos { get; set; } public DbSet PersonnelQualificationInfos { get; set; } public DbSet BOMMasterDatas { get; set; } public DbSet MaterialMasterDatas { get; set; } public DbSet ProcessEquipments { get; set; } public DbSet ProcessTechnologies { get; set; } // 计划数据 public DbSet MonthlyProductionPlans { get; set; } public DbSet MaterialRequirementPlanM6s { get; set; } public DbSet DailyMaterialRequirementPlans { get; set; } public DbSet PlanningAgreements { get; set; } public DbSet PurchaseOrders { get; set; } // 生产过程数据 public DbSet IncomingInspectionDatas { get; set; } public DbSet ProductionSchedulingDatas { get; set; } public DbSet ProcessControlQualityDatas { get; set; } public DbSet ProductionProcessDatas { get; set; } public DbSet FirstPassYields { get; set; } public DbSet WorkstationFirstPassYields { get; set; } public DbSet DefectBusinessDatas { get; set; } public DbSet EnvironmentalBusinessDatas { get; set; } public DbSet EquipmentOEEs { get; set; } public DbSet OEETimeDetailses { get; set; } // 物流配送数据 public DbSet WeldingToAssemblyVehicleses { get; set; } public DbSet PaintingToAssemblyVehicleses { get; set; } public DbSet SequencedSupplies { get; set; } public DbSet KanbanDeliveryNotes { get; set; } public DbSet ReturnGoodsNotes { get; set; } public DbSet CheryRDCSharedInventories { get; set; } public DbSet DailyMRPStatusMonitorings { get; set; } public DbSet DailyMRPWarningTrends { get; set; } public DbSet SupplierSharedInventoryMornings { get; set; } public DbSet SupplierSharedInventoryEvenings { get; set; } // 其他数据 public DbSet AttachmentDatas { get; set; } // 配置实体映射 protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); // 配置表名 // 其他配置... } } }