using DIXWeb.Entity.BasicInfo; using DIXWeb.Entity.GlobalM; using DIXWeb.Entity.Power; using DIXWeb.Entity.Workflow; using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DIXWeb.DAL { public class DBContext : DbContext { static string _ConnectionString { get { return System.Configuration.ConfigurationManager.ConnectionStrings["DIX"].ToString(); } } //无参构造方法 public DBContext() : base(_ConnectionString) { this.Database.CommandTimeout = 5184000; //关闭初始化策略(Code First连接现有数据库) try { System.Data.Entity.Database.SetInitializer(null); } catch (Exception er) { throw new Exception("数据库连接失败:" + _ConnectionString + "," + er.Message); } } public DbSet OrgInfo { get; set; }//组织表 public DbSet RoleInfo { get; set; }//角色表 public DbSet PowerInfo { get; set; }//权限表 public DbSet UserInfo { get; set; }//人员表 public DbSet MenuInfo { get; set; }//菜单表表 public DbSet UserInRole { get; set; }//人员角色表 public DbSet PowerInRole { get; set; }//角色权限表 public DbSet PowerInRes { get; set; }//权限菜单表 public DbSet BillType { get; set; }//单据类型 public DbSet Workflow { get; set; }//单据类型 public DbSet WorkflowNodeType { get; set; }//审批节点类型 public DbSet WorkflowNode { get; set; }//审批节点 public DbSet WorkflowOrgType { get; set; }//审批节点-组织类型 public DbSet WorkflowRoleType { get; set; }//审批节点-角色类型 public DbSet WorkflowNodeDetail { get; set; }//审批节点详细 public DbSet WorkflowRoute { get; set; }//审批路由 public DbSet _DatabaseLink { get; set; } public DbSet _Goods { get; set; } public DbSet WebUser { get; set; } public DbSet _GoodSort { get; set; } public DbSet _CostComputeStyle { get; set; } public DbSet _GoodProperty { get; set; } public DbSet _Unit { get; set; } public DbSet _InvoiceType { get; set; } public DbSet _AccountItem { get; set; } public DbSet _AccountSort { get; set; } public DbSet _AlarmSetting { get; set; } public DbSet _BOM { get; set; } public DbSet _VBOM { get; set; } public DbSet _GoodUnit { get; set; } public DbSet _WorkList { get; set; } public DbSet _Warehouse { get; set; } public DbSet _BankAccount { get; set; } } }