You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

95 lines
3.9 KiB

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<JobDbContext> 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<SupplierBaseInfo> SupplierBaseInfos { get; set; }
public DbSet<PersonnelQualificationInfo> PersonnelQualificationInfos { get; set; }
public DbSet<BOMMasterData> BOMMasterDatas { get; set; }
public DbSet<MaterialMasterData> MaterialMasterDatas { get; set; }
public DbSet<ProcessEquipment> ProcessEquipments { get; set; }
public DbSet<ProcessTechnology> ProcessTechnologies { get; set; }
// 计划数据
public DbSet<MonthlyProductionPlan> MonthlyProductionPlans { get; set; }
public DbSet<MaterialRequirementPlanM6> MaterialRequirementPlanM6s { get; set; }
public DbSet<DailyMaterialRequirementPlan> DailyMaterialRequirementPlans { get; set; }
public DbSet<PlanningAgreement> PlanningAgreements { get; set; }
public DbSet<PurchaseOrder> PurchaseOrders { get; set; }
// 生产过程数据
public DbSet<IncomingInspectionData> IncomingInspectionDatas { get; set; }
public DbSet<ProductionSchedulingData> ProductionSchedulingDatas { get; set; }
public DbSet<ProcessControlQualityData> ProcessControlQualityDatas { get; set; }
public DbSet<ProductionProcessData> ProductionProcessDatas { get; set; }
public DbSet<FirstPassYield> FirstPassYields { get; set; }
public DbSet<WorkstationFirstPassYield> WorkstationFirstPassYields { get; set; }
public DbSet<DefectBusinessData> DefectBusinessDatas { get; set; }
public DbSet<EnvironmentalBusinessData> EnvironmentalBusinessDatas { get; set; }
public DbSet<EquipmentOEE> EquipmentOEEs { get; set; }
public DbSet<OEETimeDetails> OEETimeDetailses { get; set; }
// 物流配送数据
public DbSet<WeldingToAssemblyVehicles> WeldingToAssemblyVehicleses { get; set; }
public DbSet<PaintingToAssemblyVehicles> PaintingToAssemblyVehicleses { get; set; }
public DbSet<SequencedSupply> SequencedSupplies { get; set; }
public DbSet<KanbanDeliveryNote> KanbanDeliveryNotes { get; set; }
public DbSet<ReturnGoodsNote> ReturnGoodsNotes { get; set; }
public DbSet<CheryRDCSharedInventory> CheryRDCSharedInventories { get; set; }
public DbSet<DailyMRPStatusMonitoring> DailyMRPStatusMonitorings { get; set; }
public DbSet<DailyMRPWarningTrend> DailyMRPWarningTrends { get; set; }
public DbSet<SupplierSharedInventoryMorning> SupplierSharedInventoryMornings { get; set; }
public DbSet<SupplierSharedInventoryEvening> SupplierSharedInventoryEvenings { get; set; }
// 其他数据
public DbSet<AttachmentData> AttachmentDatas { get; set; }
// 配置实体映射
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
// 配置表名
// 其他配置...
}
}
}