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.
259 lines
9.0 KiB
259 lines
9.0 KiB
4 years ago
|
using System.Data.Entity;
|
||
|
using CK.SCP.Models.ScpEntity;
|
||
|
|
||
|
namespace CK.SCP.Models
|
||
|
{
|
||
|
|
||
|
|
||
|
public class SqlDbConfiguration : DbConfiguration
|
||
|
{
|
||
|
public SqlDbConfiguration()
|
||
|
{
|
||
|
this.SetManifestTokenResolver(new Sql2008ManifestTokenResolver());
|
||
|
}
|
||
|
}
|
||
|
public class Sql2008ManifestTokenResolver : System.Data.Entity.Infrastructure.IManifestTokenResolver
|
||
|
{
|
||
|
public string ResolveManifestToken(System.Data.Common.DbConnection connection)
|
||
|
{
|
||
|
return "2008";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
public partial class ScpEntities : DbContext
|
||
|
{
|
||
|
public ScpEntities()
|
||
|
: base("name=ScpEntities")
|
||
|
{
|
||
|
}
|
||
|
public ScpEntities(string strConn)
|
||
|
: base(strConn)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public virtual DbSet<TA_BILLTYPE> TA_BILLTYPE { get; set; }
|
||
|
public virtual DbSet<TA_CONFIG> TA_CONFIG { get; set; }
|
||
|
public virtual DbSet<TA_PART> TA_PART { get; set; }
|
||
|
public virtual DbSet<TA_VEND_PART> TA_VEND_PART { get; set; }
|
||
|
public virtual DbSet<TA_VENDER> TA_VENDER { get; set; }
|
||
|
public virtual DbSet<TB_INVOICE> TB_INVOICE { get; set; }
|
||
|
public virtual DbSet<TB_INVOICE_DETAIL> TB_INVOICE_DETAIL { get; set; }
|
||
|
public virtual DbSet<TB_RECEIVE> TB_RECEIVE { get; set; }
|
||
|
public virtual DbSet<TB_RECEIVE_DETAIL> TB_RECEIVE_DETAIL { get; set; }
|
||
|
public virtual DbSet<TB_RETURN> TB_RETURN { get; set; }
|
||
|
public virtual DbSet<TB_RETURN_DETAIL> TB_RETURN_DETAIL { get; set; }
|
||
|
public virtual DbSet<TF_ASN> TF_ASN { get; set; }
|
||
|
public virtual DbSet<TF_ASN_DETAIL> TF_ASN_DETAIL { get; set; }
|
||
|
public virtual DbSet<TF_PO> TF_PO { get; set; }
|
||
|
public virtual DbSet<TF_PO_DETAIL> TF_PO_DETAIL { get; set; }
|
||
|
public virtual DbSet<TL_BASEDATA> TL_BASEDATA { get; set; }
|
||
|
public virtual DbSet<TL_BILL> TL_BILL { get; set; }
|
||
|
public virtual DbSet<TL_OPER> TL_OPER { get; set; }
|
||
|
public virtual DbSet<TS_BARCODE> TS_BARCODE { get; set; }
|
||
|
public virtual DbSet<TS_STOCK> TS_STOCK { get; set; }
|
||
|
public virtual DbSet<TS_UNI_API> TS_UNI_API { get; set; }
|
||
|
public virtual DbSet<TS_UNI_API_HIS> TS_UNI_API_HIS { get; set; }
|
||
|
public virtual DbSet<TT_CURRENCY> TT_CURRENCY { get; set; }
|
||
|
public virtual DbSet<TT_PROJECT> TT_PROJECT { get; set; }
|
||
|
|
||
|
public virtual DbSet<TT_UNIT> TT_UNIT { get; set; }
|
||
|
public virtual DbSet<V_POAll> V_POAll { get; set; }
|
||
|
public virtual DbSet<V_POAllDetail> V_POAllDetail { get; set; }
|
||
|
|
||
|
public virtual DbSet<V_BillShip> V_BillShip { get; set; }
|
||
|
public virtual DbSet<V_Receive> V_Receive { get; set; }
|
||
|
|
||
|
public virtual DbSet<V_BillShipDetail> V_BillShipDetail { get; set; }
|
||
|
public virtual DbSet<V_ReceiveDetail> V_ReceiveDetail { get; set; }
|
||
|
public virtual DbSet<V_BillInvoice> V_BillInvoice { get; set; }
|
||
|
|
||
|
public virtual DbSet<V_BillInvoiceDetail> V_BillInvoiceDetail { get; set; }
|
||
|
|
||
|
public virtual DbSet<V_POReport> V_POReport { get; set; }
|
||
|
public virtual DbSet<V_ReceiveReport> V_ReceiveReport { get; set; }
|
||
|
public virtual DbSet<V_QadOrder> V_QadOrder { get; set; }
|
||
|
public virtual DbSet<TB_QadOrder> TB_QadOrder { get; set; }
|
||
|
public virtual DbSet<TB_QadOrderDetail> TB_QadOrderDetail { get; set; }
|
||
|
|
||
|
|
||
|
public virtual DbSet<V_PlanMonth> V_PlanMonth { get; set; }
|
||
|
public virtual DbSet<TB_PlanMonth> TB_PlanMonth { get; set; }
|
||
|
public virtual DbSet<V_Stock> V_Stock { get; set; }
|
||
|
public virtual DbSet<V_Info> V_Info { get; set; }
|
||
|
public virtual DbSet<TA_Info> TA_Info { get; set; }
|
||
|
public virtual DbSet<TB_PublicData> TB_PublicData { get; set; }
|
||
|
public virtual DbSet<TA_BillNoType> TA_BillNoType { get; set; }
|
||
|
public virtual DbSet<TA_VEND_USER> TA_VEND_USER { get; set; }
|
||
|
public virtual DbSet<TA_Part_User> TA_Part_User { get; set; }
|
||
|
// public virtual DbSet<V_ReceiveList> V_ReceiveList { get; set; }
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||
|
{
|
||
|
modelBuilder.Entity<TA_BILLTYPE>()
|
||
|
.Property(e => e.Sep)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TA_PART>()
|
||
|
.Property(e => e.State)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TA_VEND_PART>()
|
||
|
.Property(e => e.VendPackQty)
|
||
|
.HasPrecision(18, 5);
|
||
|
|
||
|
modelBuilder.Entity<TA_VENDER>()
|
||
|
.Property(e => e.VendAbbCode)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TB_INVOICE_DETAIL>()
|
||
|
.Property(e => e.Qty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TB_INVOICE_DETAIL>()
|
||
|
.Property(e => e.Price)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TB_INVOICE_DETAIL>()
|
||
|
.Property(e => e.PackQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TB_RECEIVE_DETAIL>()
|
||
|
.Property(e => e.BillQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TB_RECEIVE_DETAIL>()
|
||
|
.Property(e => e.ReceivedQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TB_RECEIVE_DETAIL>()
|
||
|
.Property(e => e.Price)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
|
||
|
|
||
|
modelBuilder.Entity<TB_RETURN_DETAIL>()
|
||
|
.Property(e => e.BillQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TB_RETURN_DETAIL>()
|
||
|
.Property(e => e.ReceivedQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TB_RETURN_DETAIL>()
|
||
|
.Property(e => e.Price)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TB_RETURN_DETAIL>()
|
||
|
.Property(e => e.PackQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TF_ASN_DETAIL>()
|
||
|
.Property(e => e.BillQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TF_ASN_DETAIL>()
|
||
|
.Property(e => e.Price)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TF_ASN_DETAIL>()
|
||
|
.Property(e => e.PackQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TF_PO_DETAIL>()
|
||
|
.Property(e => e.BillQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TF_PO_DETAIL>()
|
||
|
.Property(e => e.ShippedQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TF_PO_DETAIL>()
|
||
|
.Property(e => e.ReceivedQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TF_PO_DETAIL>()
|
||
|
.Property(e => e.Price)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TF_PO_DETAIL>()
|
||
|
.Property(e => e.PackQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TL_BASEDATA>()
|
||
|
.Property(e => e.LogType)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TL_BASEDATA>()
|
||
|
.Property(e => e.DataType)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TL_OPER>()
|
||
|
.Property(e => e.LogType)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TS_BARCODE>()
|
||
|
.Property(e => e.BarCode)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TS_BARCODE>()
|
||
|
.Property(e => e.FullBarCode)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TS_BARCODE>()
|
||
|
.Property(e => e.PartCode)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TS_BARCODE>()
|
||
|
.Property(e => e.VendPartCode)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TS_BARCODE>()
|
||
|
.Property(e => e.Batch)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TS_BARCODE>()
|
||
|
.Property(e => e.ProduceDate)
|
||
|
.HasPrecision(3);
|
||
|
|
||
|
modelBuilder.Entity<TS_BARCODE>()
|
||
|
.Property(e => e.SerialNum)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TS_BARCODE>()
|
||
|
.Property(e => e.Qty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TS_BARCODE>()
|
||
|
.Property(e => e.BillNum)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TS_BARCODE>()
|
||
|
.Property(e => e.VendId)
|
||
|
.IsUnicode(false);
|
||
|
|
||
|
modelBuilder.Entity<TS_BARCODE>()
|
||
|
.Property(e => e.PackQty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TS_STOCK>()
|
||
|
.Property(e => e.Qty)
|
||
|
.HasPrecision(19, 4);
|
||
|
|
||
|
modelBuilder.Entity<TS_UNI_API>()
|
||
|
.Property(e => e.Qty)
|
||
|
.HasPrecision(18, 5);
|
||
|
|
||
|
modelBuilder.Entity<TS_UNI_API_HIS>()
|
||
|
.Property(e => e.Qty)
|
||
|
.HasPrecision(18, 5);
|
||
|
}
|
||
|
}
|
||
|
}
|