//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace TMapi.Models
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Infrastructure;
    using System.Data.Entity.Core.Objects;
    using System.Linq;
    
    public partial class TMEntities : DbContext
    {
        public TMEntities()
            : base("name=TMEntities")
        {
            this.Configuration.LazyLoadingEnabled = false;
        }
    
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            throw new UnintentionalCodeFirstException();
        }
    
        public virtual DbSet<AUTOCHKIN> AUTOCHKINs { get; set; }
        public virtual DbSet<COPICKUPLG> COPICKUPLGs { get; set; }
        public virtual DbSet<CRPCSGN> CRPCSGNs { get; set; }
        public virtual DbSet<CRPCUST> CRPCUSTs { get; set; }
        public virtual DbSet<EQP2040> EQP2040 { get; set; }
        public virtual DbSet<EQPCHDR> EQPCHDRs { get; set; }
        public virtual DbSet<EQPCLA> EQPCLAS { get; set; }
        public virtual DbSet<EQPCUST> EQPCUSTs { get; set; }
        public virtual DbSet<EQPCUSTAG> EQPCUSTAGs { get; set; }
        public virtual DbSet<EQPDIVM> EQPDIVMs { get; set; }
        public virtual DbSet<EQPMAKE> EQPMAKEs { get; set; }
        public virtual DbSet<EQPSBTY> EQPSBTies { get; set; }
        public virtual DbSet<EQPSLM> EQPSLMS { get; set; }
        public virtual DbSet<EQPTRAN> EQPTRANs { get; set; }
        public virtual DbSet<EQPTRAN_STATUS> EQPTRAN_STATUS { get; set; }
        public virtual DbSet<EQPTTLG> EQPTTLGs { get; set; }
        public virtual DbSet<EQPTYPE> EQPTYPEs { get; set; }
        public virtual DbSet<EQUIPMENT_SPEC> EQUIPMENT_SPEC { get; set; }
        public virtual DbSet<EQUIPMENTFIELD> EQUIPMENTFIELDs { get; set; }
        public virtual DbSet<ESPECSCONFIG> ESPECSCONFIGs { get; set; }
        public virtual DbSet<FIELDGROUP> FIELDGROUPs { get; set; }
        public virtual DbSet<FIELDTYPE> FIELDTYPEs { get; set; }
        public virtual DbSet<PCPCMTB> PCPCMTBs { get; set; }
        public virtual DbSet<PCPCRDT> PCPCRDTs { get; set; }
        public virtual DbSet<PERMISSION> PERMISSIONs { get; set; }
        public virtual DbSet<PERMISSION_ROLE> PERMISSION_ROLE { get; set; }
        public virtual DbSet<QUEUE> QUEUEs { get; set; }
        public virtual DbSet<QUEUE_EQUIPMENTFIELD> QUEUE_EQUIPMENTFIELD { get; set; }
        public virtual DbSet<ROLE> ROLEs { get; set; }
        public virtual DbSet<ROLE_QUEUE> ROLE_QUEUE { get; set; }
        public virtual DbSet<SPEC> SPECs { get; set; }
        public virtual DbSet<SPECCHANGE> SPECCHANGEs { get; set; }
        public virtual DbSet<SPECTYPE> SPECTYPEs { get; set; }
        public virtual DbSet<STATUS> STATUS { get; set; }
        public virtual DbSet<UPLOAD> UPLOADs { get; set; }
        public virtual DbSet<USER> USERs { get; set; }
        public virtual DbSet<WBPTVGEQ> WBPTVGEQs { get; set; }
        public virtual DbSet<APP0030> APP0030 { get; set; }
        public virtual DbSet<APPAPIR> APPAPIRs { get; set; }
        public virtual DbSet<APPAPIRHST> APPAPIRHSTs { get; set; }
        public virtual DbSet<APPCSEX> APPCSEXes { get; set; }
        public virtual DbSet<APPCTRL> APPCTRLs { get; set; }
        public virtual DbSet<BYPPREM> BYPPREMs { get; set; }
        public virtual DbSet<CRPSLH> CRPSLHS { get; set; }
        public virtual DbSet<CRPSRLG> CRPSRLGs { get; set; }
        public virtual DbSet<CTPSELLR> CTPSELLRs { get; set; }
        public virtual DbSet<CUPEMAIL> CUPEMAILs { get; set; }
        public virtual DbSet<CUPEMFRI> CUPEMFRIs { get; set; }
        public virtual DbSet<CUPEMLOG> CUPEMLOGs { get; set; }
        public virtual DbSet<CUPEMTOI> CUPEMTOIs { get; set; }
        public virtual DbSet<CUPUNSUB> CUPUNSUBs { get; set; }
        public virtual DbSet<EQP0327> EQP0327 { get; set; }
        public virtual DbSet<EQP0440> EQP0440 { get; set; }
        public virtual DbSet<EQP1220> EQP1220 { get; set; }
        public virtual DbSet<EQP3001> EQP3001 { get; set; }
        public virtual DbSet<EQP3002> EQP3002 { get; set; }
        public virtual DbSet<EQPAINV> EQPAINVs { get; set; }
        public virtual DbSet<EQPAPRSN> EQPAPRSNs { get; set; }
        public virtual DbSet<EQPBSLG> EQPBSLGs { get; set; }
        public virtual DbSet<EQPCPAD> EQPCPADs { get; set; }
        public virtual DbSet<EQPCUSTTO> EQPCUSTTOes { get; set; }
        public virtual DbSet<EQPPHNN> EQPPHNNs { get; set; }
        public virtual DbSet<EQPPROM> EQPPROMs { get; set; }
        public virtual DbSet<EQPRGST> EQPRGSTs { get; set; }
        public virtual DbSet<EQPSALE> EQPSALEs { get; set; }
        public virtual DbSet<EQPSLRP> EQPSLRPs { get; set; }
        public virtual DbSet<EQPSPIB> EQPSPIBs { get; set; }
        public virtual DbSet<EQPTRANARC> EQPTRANARCs { get; set; }
        public virtual DbSet<EQPTRANJRN> EQPTRANJRNs { get; set; }
        public virtual DbSet<EQPTYD> EQPTYDS { get; set; }
        public virtual DbSet<GEOCODE> GEOCODEs { get; set; }
        public virtual DbSet<HDPCCLOD> HDPCCLODs { get; set; }
        public virtual DbSet<HRP0010> HRP0010 { get; set; }
        public virtual DbSet<JRN010PF> JRN010PF { get; set; }
        public virtual DbSet<JRN020PF> JRN020PF { get; set; }
        public virtual DbSet<NIMBLETAX> NIMBLETAXes { get; set; }
        public virtual DbSet<OEP0070> OEP0070 { get; set; }
        public virtual DbSet<PCPAPIR> PCPAPIRs { get; set; }
        public virtual DbSet<PCPAPPT> PCPAPPTs { get; set; }
        public virtual DbSet<PCPCRCM> PCPCRCMs { get; set; }
        public virtual DbSet<PCPCRTR> PCPCRTRs { get; set; }
        public virtual DbSet<PCPTRAN> PCPTRANs { get; set; }
        public virtual DbSet<REFRESHDB> REFRESHDBs { get; set; }
        public virtual DbSet<WBP0010EQ> WBP0010EQ { get; set; }
        public virtual DbSet<WBP0010SP> WBP0010SP { get; set; }
        public virtual DbSet<WBP0010TS> WBP0010TS { get; set; }
        public virtual DbSet<WBP0020> WBP0020 { get; set; }
        public virtual DbSet<WBP0030> WBP0030 { get; set; }
        public virtual DbSet<WBP0040> WBP0040 { get; set; }
        public virtual DbSet<WBP0050> WBP0050 { get; set; }
        public virtual DbSet<WEBSPECCHG> WEBSPECCHGs { get; set; }
        public virtual DbSet<BUYERHOLD> BUYERHOLDs { get; set; }
        public virtual DbSet<CHECKIN> CHECKINs { get; set; }
        public virtual DbSet<CHECKVIN> CHECKVINs { get; set; }
        public virtual DbSet<EQPSTATU> EQPSTATUS { get; set; }
        public virtual DbSet<EQUIPMENTINFO> EQUIPMENTINFOes { get; set; }
        public virtual DbSet<EQUIPMENTLIST> EQUIPMENTLISTs { get; set; }
        public virtual DbSet<EQUIPMENTQUEUE> EQUIPMENTQUEUEs { get; set; }
        public virtual DbSet<EQUIPMENTSEARCH> EQUIPMENTSEARCHes { get; set; }
        public virtual DbSet<EQUIPMENTSTATUSHISTORY> EQUIPMENTSTATUSHISTORies { get; set; }
        public virtual DbSet<EQUIPMENTVIEW> EQUIPMENTVIEWs { get; set; }
        public virtual DbSet<FIELDSPEC> FIELDSPECS { get; set; }
        public virtual DbSet<LASTCOMMISION> LASTCOMMISIONs { get; set; }
        public virtual DbSet<LASTSTATU> LASTSTATUS { get; set; }
        public virtual DbSet<QUEUELISTCOLUMN> QUEUELISTCOLUMNS { get; set; }
        public virtual DbSet<SPECFIELD> SPECFIELDs { get; set; }
        public virtual DbSet<SYSCHKCST> SYSCHKCSTs { get; set; }
        public virtual DbSet<SYSCOLUMN> SYSCOLUMNS { get; set; }
        public virtual DbSet<SYSCST> SYSCSTs { get; set; }
        public virtual DbSet<SYSCSTCOL> SYSCSTCOLs { get; set; }
        public virtual DbSet<SYSCSTDEP> SYSCSTDEPs { get; set; }
        public virtual DbSet<SYSINDEX> SYSINDEXES { get; set; }
        public virtual DbSet<SYSKEYCST> SYSKEYCSTs { get; set; }
        public virtual DbSet<SYSKEY> SYSKEYS { get; set; }
        public virtual DbSet<SYSPACKAGE> SYSPACKAGEs { get; set; }
        public virtual DbSet<SYSREFCST> SYSREFCSTs { get; set; }
        public virtual DbSet<SYSTABLEDEP> SYSTABLEDEPs { get; set; }
        public virtual DbSet<SYSTABLE> SYSTABLES { get; set; }
        public virtual DbSet<SYSTRIGCOL> SYSTRIGCOLs { get; set; }
        public virtual DbSet<SYSTRIGDEP> SYSTRIGDEPs { get; set; }
        public virtual DbSet<SYSTRIGGER> SYSTRIGGERS { get; set; }
        public virtual DbSet<SYSTRIGUPD> SYSTRIGUPDs { get; set; }
        public virtual DbSet<SYSVIEWDEP> SYSVIEWDEPs { get; set; }
        public virtual DbSet<SYSVIEW> SYSVIEWS { get; set; }
        public virtual DbSet<USERROLE> USERROLEs { get; set; }
        public virtual DbSet<VBIDINVTOT> VBIDINVTOTs { get; set; }
        public virtual DbSet<VBYRCSGN3Y> VBYRCSGN3Y { get; set; }
        public virtual DbSet<VBYREQUIP> VBYREQUIPs { get; set; }
        public virtual DbSet<VEQUIPSALE> VEQUIPSALEs { get; set; }
        public virtual DbSet<VGEOCODE> VGEOCODEs { get; set; }
        public virtual DbSet<VREPACTIVITY> VREPACTIVITies { get; set; }
        public virtual DbSet<VREPLOWQ> VREPLOWQs { get; set; }
        public virtual DbSet<VSPECCHG> VSPECCHGs { get; set; }
        public virtual DbSet<ARRIVAL> ARRIVALS { get; set; }
    
        public virtual int CHECKIN_EQUIPMENT(string dELEQUIPLIST, Nullable<int> uSERID, ObjectParameter rETURNRSLT)
        {
            var dELEQUIPLISTParameter = dELEQUIPLIST != null ?
                new ObjectParameter("DELEQUIPLIST", dELEQUIPLIST) :
                new ObjectParameter("DELEQUIPLIST", typeof(string));
    
            var uSERIDParameter = uSERID.HasValue ?
                new ObjectParameter("USERID", uSERID) :
                new ObjectParameter("USERID", typeof(int));
    
            return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("CHECKIN_EQUIPMENT", dELEQUIPLISTParameter, uSERIDParameter, rETURNRSLT);
        }
    
        public virtual int CRTUPDEQP(string eQPRECIN, string cSTRECIN, string cRDRECIN, ObjectParameter eQUIPID, ObjectParameter cUSTNBROUT, ObjectParameter cNTCNBROUT, ObjectParameter cRDTNBROUT, ObjectParameter cRDCNTNBROUT, ObjectParameter dUPEQIDSOUT, ObjectParameter rETURNRESULT)
        {
            var eQPRECINParameter = eQPRECIN != null ?
                new ObjectParameter("EQPRECIN", eQPRECIN) :
                new ObjectParameter("EQPRECIN", typeof(string));
    
            var cSTRECINParameter = cSTRECIN != null ?
                new ObjectParameter("CSTRECIN", cSTRECIN) :
                new ObjectParameter("CSTRECIN", typeof(string));
    
            var cRDRECINParameter = cRDRECIN != null ?
                new ObjectParameter("CRDRECIN", cRDRECIN) :
                new ObjectParameter("CRDRECIN", typeof(string));
    
            return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("CRTUPDEQP", eQPRECINParameter, cSTRECINParameter, cRDRECINParameter, eQUIPID, cUSTNBROUT, cNTCNBROUT, cRDTNBROUT, cRDCNTNBROUT, dUPEQIDSOUT, rETURNRESULT);
        }
    
        public virtual int UPDEQPDESCR(Nullable<int> eQPID, ObjectParameter eQDSC)
        {
            var eQPIDParameter = eQPID.HasValue ?
                new ObjectParameter("EQPID", eQPID) :
                new ObjectParameter("EQPID", typeof(int));
    
            return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("UPDEQPDESCR", eQPIDParameter, eQDSC);
        }
    
        public virtual ObjectResult<CUR0005_Result> CUR0005(string cLRFILE)
        {
            var cLRFILEParameter = cLRFILE != null ?
                new ObjectParameter("CLRFILE", cLRFILE) :
                new ObjectParameter("CLRFILE", typeof(string));
    
            return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<CUR0005_Result>("CUR0005", cLRFILEParameter);
        }
    
        public virtual int DELETEEQUIPMENT(string dELEQUIPLIST, string uSERID, ObjectParameter rETURNRSLT)
        {
            var dELEQUIPLISTParameter = dELEQUIPLIST != null ?
                new ObjectParameter("DELEQUIPLIST", dELEQUIPLIST) :
                new ObjectParameter("DELEQUIPLIST", typeof(string));
    
            var uSERIDParameter = uSERID != null ?
                new ObjectParameter("USERID", uSERID) :
                new ObjectParameter("USERID", typeof(string));
    
            return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("DELETEEQUIPMENT", dELEQUIPLISTParameter, uSERIDParameter, rETURNRSLT);
        }
    
        public virtual int EDITEQUIPMENT(string eQPRECIN, ObjectParameter rETURNRSLT)
        {
            var eQPRECINParameter = eQPRECIN != null ?
                new ObjectParameter("EQPRECIN", eQPRECIN) :
                new ObjectParameter("EQPRECIN", typeof(string));
    
            return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("EDITEQUIPMENT", eQPRECINParameter, rETURNRSLT);
        }
    
        public virtual int EQUIPMENT_ARRIVED(string eQUIPLIST, Nullable<int> uSERID, ObjectParameter rETURNRSLT)
        {
            var eQUIPLISTParameter = eQUIPLIST != null ?
                new ObjectParameter("EQUIPLIST", eQUIPLIST) :
                new ObjectParameter("EQUIPLIST", typeof(string));
    
            var uSERIDParameter = uSERID.HasValue ?
                new ObjectParameter("USERID", uSERID) :
                new ObjectParameter("USERID", typeof(int));
    
            return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("EQUIPMENT_ARRIVED", eQUIPLISTParameter, uSERIDParameter, rETURNRSLT);
        }
    }
}
