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.
 
 
 
 
 

274 lines
13 KiB

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")
{
this.Database.CommandTimeout = 120;
}
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<TB_FACTORY> TB_FACTORY { 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_ARRIVE> TB_ARRIVE { get; set; }
public virtual DbSet<TB_ARRIVE_DETAIL> TB_ARRIVE_DETAIL { 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_REJECT> TB_REJECT { get; set; }
public virtual DbSet<TB_REJECT_DETAIL> TB_REJECT_DETAIL { get; set; }
public virtual DbSet<TA_FACTORY_CONFIG> TA_FACTORY_CONFIG { 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_ReceiveReport> V_ReceiveReport { 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<TA_REVICE_PORT> TA_REVICE_PORT { get; set; }
public virtual DbSet<TB_PENING_ITEMS> TB_PENING_ITEMS { get; set; }
public virtual DbSet<TB_ASK> TB_ASK { get; set; }
public virtual DbSet<V_TB_ASK> V_TB_ASK { get; set; }
public virtual DbSet<TB_ASK_DETAIL> TB_ASK_DETAIL { get; set; }
public virtual DbSet<V_TB_ASK_DETAIL> V_TB_ASK_DETAIL { get; set; }
public virtual DbSet<TB_PO> TB_PO { get; set; }
public virtual DbSet<TB_PO_DETAIL> TB_PO_DETAIL { get; set; }
public virtual DbSet<TB_ASN> TB_ASN { get; set; }
public virtual DbSet<TB_ASN_DETAIL> TB_ASN_DETAIL { get; set; }
public virtual DbSet<V_TB_PO> V_TB_PO { get; set; }
public virtual DbSet<V_TB_PO_DETAIL> V_TB_PO_DETAIL { get; set; }
public virtual DbSet<V_TB_ASN> V_TB_ASN { get; set; }
public virtual DbSet<V_TB_ASN_DETAIL> V_TB_ASN_DETAIL { get; set; }
public virtual DbSet<TA_LANGUAGE> TA_LANGUAGE { get; set; }
public virtual DbSet<TB_CONTRACT> TB_CONTRACT { get; set; }
public virtual DbSet<TB_CONTRACT_DETAIL> TB_CONTRACT_DETAIL { get; set; }
public virtual DbSet<TB_CONTRACT_DETAIL_PRICE> TB_CONTRACT_DETAIL_PRICE { get; set; }
public virtual DbSet<V_TB_RECEIVE> V_TB_RECEIVE { get; set; }
public virtual DbSet<V_TB_RECEIVE_DETAIL> V_TB_RECEIVE_DETAIL { get; set; }
public virtual DbSet<V_TB_ARRIVE> V_TB_ARRIVE { get; set; }
public virtual DbSet<V_TB_ARRIVE_DETAIL> V_TB_ARRIVE_DETAIL { get; set; }
public virtual DbSet<V_TB_REJECT> V_TB_REJECT { get; set; }
public virtual DbSet<V_TB_REJECT_DETAIL> V_TB_REJECT_DETAIL { get; set; }
public virtual DbSet<TS_BARCODE_RULE> TS_BARCODE_RULE { get; set; }
public virtual DbSet<V_TB_INVOICE_DETAIL> V_TB_INVOICE_DETAIL { get; set; }
public virtual DbSet<V_TB_INVOICE> V_TB_INVOICE { get; set; }
public virtual DbSet<V_TB_INVOICE_DETAIL_RED> V_TB_INVOICE_DETAIL_RED { get; set; }
public virtual DbSet<V_TB_INVOICE_RED> V_TB_INVOICE_RED { get; set; }
public virtual DbSet<V_TB_RECEIVE_LIST> V_TB_RECEIVE_LIST { get; set; }
public virtual DbSet<TB_PRINT_COUNT> TB_PRINT_COUNT { get; set; }
public virtual DbSet<V_TB_ASN_DETAIL_VIEW> V_TB_ASN_DETAIL_VIEW { get; set; }
public virtual DbSet<V_TA_VENDER> V_TA_VENDER { get; set; }
public virtual DbSet<V_TB_INCOMPLETE_ASK> V_TB_INCOMPLETE_ASK { get; set; }
public virtual DbSet<V_TB_PALLET_DETAIL> V_TB_PALLET_DETAIL { get; set; }
public virtual DbSet<V_TB_PALLET> V_TB_PALLET { get; set; }
public virtual DbSet<TB_PALLET_DETAIL> TB_PALLET_DETAIL { get; set; }
public virtual DbSet<TB_PALLET> TB_PALLET { get; set; }
public virtual DbSet<TB_QUALITY> TB_QUALITY { get; set; }
public virtual DbSet<V_TB_QUALITY> V_TB_QUALITY { get; set; }
public virtual DbSet<V_TB_RETURN> V_TB_RETURN { get; set; }
public virtual DbSet<TB_RETURN> TB_RETURN { get; set; }
public virtual DbSet<V_TB_INVOICE_ASK> V_TB_INVOICE_ASK { get; set; }
public virtual DbSet<V_TB_ASK_DETAIL_PACKAGE> V_TB_ASK_DETAIL_PACKAGE { get; set; }
public virtual DbSet<TS_BARCODE_RULE_CUSTOM> TS_BARCODE_RULE_CUSTOM { get; set; }
public virtual DbSet<TS_BARCODE_CUSTOM> TS_BARCODE_CUSTOM { get; set; }
public virtual DbSet<V_TA_VEND_PART> V_TA_VEND_PART { get; set; }
public virtual DbSet<TB_PRICE> TB_PRICE { get; set; }
public virtual DbSet<TB_FORECAST> TB_FORECAST { get; set; }
public virtual DbSet<V_TB_FORECAST> V_TB_FORECAST { get; set; }
public virtual DbSet<TB_RECEIVE_DETAIL_QAD> TB_RECEIVE_DETAIL_QAD { get; set; }
public virtual DbSet<TB_RECEIVE_QAD> TB_RECEIVE_QAD { get; set; }
public virtual DbSet<TM_HYANTOLIN_REVIEW> TM_HYANTOLIN_REVIEW { get; set; }
public virtual DbSet<TB_CLAIM_APPEND> TB_CLAIM_APPEND { get; set; }
public virtual DbSet<V_TM_HYANTOLIN_REVIEW> V_TM_HYANTOLIN_REVIEW { get; set; }
public virtual DbSet<TB_PLAN_CUSTOM> TB_PLAN_CUSTOM { get; set; }
public virtual DbSet<TB_PO_PLAN> TB_PO_PLAN { get; set; }
public virtual DbSet<V_TB_PO_PLAN> V_TB_PO_PLAN { get; set; }
public virtual DbSet<V_TB_PO_PLAN_DETAIL> V_TB_PO_PLAN_DETAIL { get; set; }
public virtual DbSet<TB_PO_PLAN_EXTEND> TB_PO_PLAN_EXTEND { get; set; }
public virtual DbSet<V_TB_PO_PLAN_EXTEND> V_TB_PO_PLAN_EXTEND { get; set; }
public virtual DbSet<V_TB_ASK_RECEIVE> V_TB_ASK_RECEIVE { get; set; }
public virtual DbSet<TB_ASK_RECEIVE> TB_ASK_RECEIVE { get; set; }
public virtual DbSet<TB_UNCOMPLETE_TEMPASK> TB_UNCOMPLETE_TEMPASK { get; set; }
// public virtual DbSet<V_TB_PO_INCOMPLETE> V_TB_PO_INCOMPLETE { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<TA_REVICE_PORT>()
.Property(e => e.PORT_NO)
.IsUnicode(false);
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, 2);
modelBuilder.Entity<TB_PRICE>()
.Property(e => e.Amt)
.HasPrecision(18, 5);
modelBuilder.Entity<TA_VENDER>()
.Property(e => e.VendAbbCode)
.IsUnicode(false);
modelBuilder.Entity<V_TB_PO_DETAIL>()
.Property(e => e.PackQty)
.HasPrecision(19, 2);
modelBuilder.Entity<V_TB_PO_DETAIL>()
.Property(e => e.ReceivedQty)
.HasPrecision(19, 2);
modelBuilder.Entity<V_TB_ASK_DETAIL>()
.Property(e => e.PackQty)
.HasPrecision(19, 2);
modelBuilder.Entity<V_TB_INVOICE_DETAIL>()
.Property(e => e.Price)
.HasPrecision(18, 5);
modelBuilder.Entity<TB_INVOICE_DETAIL>()
.Property(e => e.Price)
.HasPrecision(18, 5);
modelBuilder.Entity<V_TB_ASK_DETAIL>()
.Property(e => e.AskQty)
.HasPrecision(19, 2);
modelBuilder.Entity<V_TB_ASN_DETAIL>()
.Property(e => e.PackQty)
.HasPrecision(19, 2);
modelBuilder.Entity<V_TB_ASN_DETAIL>()
.Property(e => e.Qty)
.HasPrecision(19, 2);
modelBuilder.Entity<TB_RECEIVE_DETAIL_QAD>()
.Property(e => e.StdCost)
.HasPrecision(18, 5);
modelBuilder.Entity<TB_RECEIVE_DETAIL_QAD>()
.Property(e => e.PurCost)
.HasPrecision(18, 5);
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, 2);
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, 2);
modelBuilder.Entity<TS_STOCK>()
.Property(e => e.Qty)
.HasPrecision(19, 2);
modelBuilder.Entity<TS_UNI_API>()
.Property(e => e.Qty)
.HasPrecision(18, 2);
modelBuilder.Entity<TS_UNI_API>()
.Property(e => e.Qty)
.HasPrecision(18,5);
modelBuilder.Entity<TS_UNI_API_HIS>()
.Property(e => e.Qty)
.HasPrecision(18, 2);
modelBuilder.Entity<TS_UNI_API>()
.Property(e => e.Price)
.HasPrecision(18, 5);
modelBuilder.Entity<TS_UNI_API>()
.Property(e => e.TaxAmt)
.HasPrecision(18, 5);
modelBuilder.Entity<TS_UNI_API>()
.Property(e => e.Tax)
.HasPrecision(18, 2);
modelBuilder.Entity<TS_UNI_API>()
.Property(e => e.PackQty)
.HasPrecision(18, 5);
modelBuilder.Entity<TB_RECEIVE_DETAIL_QAD>()
.Property(e => e.Rate)
.HasPrecision(18, 5);
modelBuilder.Entity<TB_RECEIVE_DETAIL_QAD>()
.Property(e => e.CurAmt)
.HasPrecision(18, 5);
}
}
}