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

1941 lines
115 KiB
C#

using System;
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Data;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.SoftMng.DBUtility;
using DSWeb.SoftMng.Model;
using DSWeb.DataAccess;
using DSWeb.EntityDA;
using Microsoft.Practices.EnterpriseLibrary.Data;
using DSWeb.Areas.MvcShipping.DB;
// ReSharper disable once CheckNamespace
namespace DSWeb.SoftMng.DAL
{
//DecHead
public partial class DecHeadDAL
{
public bool Exists(string GID)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select count(1) from DecHead");
strSql.Append(" where ");
strSql.Append(" GID = @GID ");
SqlParameter[] parameters = {
new SqlParameter("@GID", SqlDbType.VarChar,50) };
parameters[0].Value = GID;
return DbHelperSQL.Exists(strSql.ToString(),parameters);
}
/// <summary>
/// 增加一条数据
/// </summary>
public int Add(DSWeb.SoftMng.Model.DecHead model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into DecHead(");
strSql.Append("GID,BSNO,IEFlag,Type,EdiId,Risk,CopCode,CopName,PDate,TypistNo,InputerName,PartenerID,TgdNo,DataSource,DeclTrnRel,ChkSurety,CopCodeScc,CheckFlow,TaxAaminMark,EntyPortCode,BLNo,BillType,ApprNo,CustomMaster,CustomMaster_Text,AgentStatus,SeqNo,PreEntryId,EntryId,IEPort,IEPort_Text,ManualNo,ContrNo,IEDate,DDate,TradeCoScc,TradeCode,TradeCiqCode,TradeName,OverseasConsignorCode,OverseasConsignorCname,OverseasConsignorEname,OverseasConsignorAddr,OverseasConsigneeCode,OverseasConsigneeEname,DomesticConsigneeEname,EdiRemark2,EdiRemark,OwnerCodeScc,OwnerCode,OwnerCiqCode,OwnerName,AgentCodeScc,AgentCode,DeclCiqCode,AgentName,TrafMode,TrafMode_Text,TrafName,NativeVoyageNo,BillNo,TradeMode,TradeMode_Text,CutMode,CutMode_Text,LicenseNo,TradeCountry,TradeCountry_Text,DistinatePort,DistinatePort_Text,TransMode,TransMode_Text,FeeMark,FeeRate,FeeCurr,FeeCurr_Text,InsurMark,InsurRate,InsurCurr,InsurCurr_Text,OtherMark,OtherRate,OtherCurr,OtherCurr_Text,PackNo,WrapType,WrapType_Text,GrossWet,NetWt,TradeAreaCode,TradeAreaCode_Text,ContaCount,AttaDocuCdstr,GoodsPlace,DespPortCode,DespPortCode_Text,EntryType,EntryType_Text,NoteS,MarkNo,OrgCode,OrgCode_Text,VsaOrgCode,VsaOrgCode_Text,InspOrgCode,InspOrgCode_Text,PurpOrgCode,PurpOrgCode_Text,CorrelationNo,CorrelationReasonFlag,CorrelationReasonFlag_Text,DespDate,CmplDschrgDt,OrigBoxFlag,SpecDeclFlag,SpecDeclFlag_Text,PromiseItmes,DeclareName,NoOtherPack,Insp_cert,BillState,ClientSeqNo,ApplyType");
strSql.Append(") values (");
strSql.Append("@GID,@BSNO,@IEFlag,@Type,@EdiId,@Risk,@CopCode,@CopName,@PDate,@TypistNo,@InputerName,@PartenerID,@TgdNo,@DataSource,@DeclTrnRel,@ChkSurety,@CopCodeScc,@CheckFlow,@TaxAaminMark,@EntyPortCode,@BLNo,@BillType,@ApprNo,@CustomMaster,@CustomMaster_Text,@AgentStatus,@SeqNo,@PreEntryId,@EntryId,@IEPort,@IEPort_Text,@ManualNo,@ContrNo,@IEDate,@DDate,@TradeCoScc,@TradeCode,@TradeCiqCode,@TradeName,@OverseasConsignorCode,@OverseasConsignorCname,@OverseasConsignorEname,@OverseasConsignorAddr,@OverseasConsigneeCode,@OverseasConsigneeEname,@DomesticConsigneeEname,@EdiRemark2,@EdiRemark,@OwnerCodeScc,@OwnerCode,@OwnerCiqCode,@OwnerName,@AgentCodeScc,@AgentCode,@DeclCiqCode,@AgentName,@TrafMode,@TrafMode_Text,@TrafName,@NativeVoyageNo,@BillNo,@TradeMode,@TradeMode_Text,@CutMode,@CutMode_Text,@LicenseNo,@TradeCountry,@TradeCountry_Text,@DistinatePort,@DistinatePort_Text,@TransMode,@TransMode_Text,@FeeMark,@FeeRate,@FeeCurr,@FeeCurr_Text,@InsurMark,@InsurRate,@InsurCurr,@InsurCurr_Text,@OtherMark,@OtherRate,@OtherCurr,@OtherCurr_Text,@PackNo,@WrapType,@WrapType_Text,@GrossWet,@NetWt,@TradeAreaCode,@TradeAreaCode_Text,@ContaCount,@AttaDocuCdstr,@GoodsPlace,@DespPortCode,@DespPortCode_Text,@EntryType,@EntryType_Text,@NoteS,@MarkNo,@OrgCode,@OrgCode_Text,@VsaOrgCode,@VsaOrgCode_Text,@InspOrgCode,@InspOrgCode_Text,@PurpOrgCode,@PurpOrgCode_Text,@CorrelationNo,@CorrelationReasonFlag,@CorrelationReasonFlag_Text,@DespDate,@CmplDschrgDt,@OrigBoxFlag,@SpecDeclFlag,@SpecDeclFlag_Text,@PromiseItmes,@DeclareName,@NoOtherPack,@Insp_cert,@BillState,@ClientSeqNo,@ApplyType");
strSql.Append(") ");
SqlParameter[] parameters = {
new SqlParameter("@GID", SqlDbType.VarChar,50) ,
new SqlParameter("@BSNO", SqlDbType.VarChar,50) ,
new SqlParameter("@IEFlag", SqlDbType.Char,1) ,
new SqlParameter("@Type", SqlDbType.VarChar,2) ,
new SqlParameter("@EdiId", SqlDbType.VarChar,50) ,
new SqlParameter("@Risk", SqlDbType.VarChar,50) ,
new SqlParameter("@CopCode", SqlDbType.VarChar,50) ,
new SqlParameter("@CopName", SqlDbType.NVarChar,50) ,
new SqlParameter("@PDate", SqlDbType.DateTime) ,
new SqlParameter("@TypistNo", SqlDbType.VarChar,50) ,
new SqlParameter("@InputerName", SqlDbType.NVarChar,50) ,
new SqlParameter("@PartenerID", SqlDbType.VarChar,50) ,
new SqlParameter("@TgdNo", SqlDbType.VarChar,50) ,
new SqlParameter("@DataSource", SqlDbType.VarChar,50) ,
new SqlParameter("@DeclTrnRel", SqlDbType.Char,1) ,
new SqlParameter("@ChkSurety", SqlDbType.VarChar,50) ,
new SqlParameter("@CopCodeScc", SqlDbType.VarChar,50) ,
new SqlParameter("@CheckFlow", SqlDbType.Char,1) ,
new SqlParameter("@TaxAaminMark", SqlDbType.VarChar,50) ,
new SqlParameter("@EntyPortCode", SqlDbType.VarChar,50) ,
new SqlParameter("@BLNo", SqlDbType.VarChar,50) ,
new SqlParameter("@BillType", SqlDbType.VarChar,50) ,
new SqlParameter("@ApprNo", SqlDbType.VarChar,50) ,
new SqlParameter("@CustomMaster", SqlDbType.VarChar,50) ,
new SqlParameter("@CustomMaster_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@AgentStatus", SqlDbType.NVarChar,50) ,
new SqlParameter("@SeqNo", SqlDbType.VarChar,50) ,
new SqlParameter("@PreEntryId", SqlDbType.VarChar,50) ,
new SqlParameter("@EntryId", SqlDbType.VarChar,50) ,
new SqlParameter("@IEPort", SqlDbType.VarChar,50) ,
new SqlParameter("@IEPort_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@ManualNo", SqlDbType.VarChar,50) ,
new SqlParameter("@ContrNo", SqlDbType.VarChar,50) ,
new SqlParameter("@IEDate", SqlDbType.DateTime) ,
new SqlParameter("@DDate", SqlDbType.DateTime) ,
new SqlParameter("@TradeCoScc", SqlDbType.VarChar,18) ,
new SqlParameter("@TradeCode", SqlDbType.VarChar,10) ,
new SqlParameter("@TradeCiqCode", SqlDbType.VarChar,10) ,
new SqlParameter("@TradeName", SqlDbType.NVarChar,50) ,
new SqlParameter("@OverseasConsignorCode", SqlDbType.VarChar,50) ,
new SqlParameter("@OverseasConsignorCname", SqlDbType.NVarChar,150) ,
new SqlParameter("@OverseasConsignorEname", SqlDbType.VarChar,150) ,
new SqlParameter("@OverseasConsignorAddr", SqlDbType.VarChar,500) ,
new SqlParameter("@OverseasConsigneeCode", SqlDbType.VarChar,50) ,
new SqlParameter("@OverseasConsigneeEname", SqlDbType.VarChar,150) ,
new SqlParameter("@DomesticConsigneeEname", SqlDbType.VarChar,150) ,
new SqlParameter("@EdiRemark2", SqlDbType.NVarChar,500) ,
new SqlParameter("@EdiRemark", SqlDbType.NVarChar,500) ,
new SqlParameter("@OwnerCodeScc", SqlDbType.VarChar,18) ,
new SqlParameter("@OwnerCode", SqlDbType.VarChar,10) ,
new SqlParameter("@OwnerCiqCode", SqlDbType.VarChar,10) ,
new SqlParameter("@OwnerName", SqlDbType.NVarChar,50) ,
new SqlParameter("@AgentCodeScc", SqlDbType.VarChar,18) ,
new SqlParameter("@AgentCode", SqlDbType.VarChar,10) ,
new SqlParameter("@DeclCiqCode", SqlDbType.VarChar,10) ,
new SqlParameter("@AgentName", SqlDbType.NVarChar,50) ,
new SqlParameter("@TrafMode", SqlDbType.VarChar,10) ,
new SqlParameter("@TrafMode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@TrafName", SqlDbType.NVarChar,50) ,
new SqlParameter("@NativeVoyageNo", SqlDbType.VarChar,50) ,
new SqlParameter("@BillNo", SqlDbType.VarChar,50) ,
new SqlParameter("@TradeMode", SqlDbType.VarChar,50) ,
new SqlParameter("@TradeMode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@CutMode", SqlDbType.VarChar,50) ,
new SqlParameter("@CutMode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@LicenseNo", SqlDbType.VarChar,50) ,
new SqlParameter("@TradeCountry", SqlDbType.VarChar,50) ,
new SqlParameter("@TradeCountry_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@DistinatePort", SqlDbType.VarChar,50) ,
new SqlParameter("@DistinatePort_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@TransMode", SqlDbType.VarChar,50) ,
new SqlParameter("@TransMode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@FeeMark", SqlDbType.Char,1) ,
new SqlParameter("@FeeRate", SqlDbType.Decimal,9) ,
new SqlParameter("@FeeCurr", SqlDbType.NVarChar,50) ,
new SqlParameter("@FeeCurr_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@InsurMark", SqlDbType.NVarChar,50) ,
new SqlParameter("@InsurRate", SqlDbType.Decimal,9) ,
new SqlParameter("@InsurCurr", SqlDbType.NVarChar,50) ,
new SqlParameter("@InsurCurr_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@OtherMark", SqlDbType.NVarChar,50) ,
new SqlParameter("@OtherRate", SqlDbType.Decimal,9) ,
new SqlParameter("@OtherCurr", SqlDbType.NVarChar,50) ,
new SqlParameter("@OtherCurr_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@PackNo", SqlDbType.Int,4) ,
new SqlParameter("@WrapType", SqlDbType.VarChar,50) ,
new SqlParameter("@WrapType_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@GrossWet", SqlDbType.Decimal,9) ,
new SqlParameter("@NetWt", SqlDbType.Decimal,9) ,
new SqlParameter("@TradeAreaCode", SqlDbType.VarChar,50) ,
new SqlParameter("@TradeAreaCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@ContaCount", SqlDbType.Int,4) ,
new SqlParameter("@AttaDocuCdstr", SqlDbType.VarChar,50) ,
new SqlParameter("@GoodsPlace", SqlDbType.NVarChar,50) ,
new SqlParameter("@DespPortCode", SqlDbType.VarChar,50) ,
new SqlParameter("@DespPortCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@EntryType", SqlDbType.VarChar,50) ,
new SqlParameter("@EntryType_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@NoteS", SqlDbType.NVarChar,150) ,
new SqlParameter("@MarkNo", SqlDbType.VarChar,400) ,
new SqlParameter("@OrgCode", SqlDbType.VarChar,50) ,
new SqlParameter("@OrgCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@VsaOrgCode", SqlDbType.VarChar,50) ,
new SqlParameter("@VsaOrgCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@InspOrgCode", SqlDbType.VarChar,50) ,
new SqlParameter("@InspOrgCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@PurpOrgCode", SqlDbType.VarChar,50) ,
new SqlParameter("@PurpOrgCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@CorrelationNo", SqlDbType.VarChar,500) ,
new SqlParameter("@CorrelationReasonFlag", SqlDbType.VarChar,50) ,
new SqlParameter("@CorrelationReasonFlag_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@DespDate", SqlDbType.DateTime) ,
new SqlParameter("@CmplDschrgDt", SqlDbType.DateTime) ,
new SqlParameter("@OrigBoxFlag", SqlDbType.VarChar,50) ,
new SqlParameter("@SpecDeclFlag", SqlDbType.VarChar,500) ,
new SqlParameter("@SpecDeclFlag_Text", SqlDbType.NVarChar,500) ,
new SqlParameter("@PromiseItmes", SqlDbType.VarChar,50) ,
new SqlParameter("@DeclareName", SqlDbType.NVarChar,50) ,
new SqlParameter("@NoOtherPack", SqlDbType.Char,1) ,
new SqlParameter("@Insp_cert", SqlDbType.NVarChar,500),
new SqlParameter("@BillState", SqlDbType.Char,1),
new SqlParameter("@ClientSeqNo", SqlDbType.NVarChar,18),
new SqlParameter("@ApplyType", SqlDbType.TinyInt,4)
};
parameters[0].Value = model.GID??(Object)DBNull.Value;
parameters[1].Value = model.BSNO??(Object)DBNull.Value;
parameters[2].Value = model.IEFlag??(Object)DBNull.Value;
parameters[3].Value = model.Type??(Object)DBNull.Value;
parameters[4].Value = model.EdiId??(Object)DBNull.Value;
parameters[5].Value = model.Risk??(Object)DBNull.Value;
parameters[6].Value = model.CopCode??(Object)DBNull.Value;
parameters[7].Value = model.CopName??(Object)DBNull.Value;
parameters[8].Value = model.PDate??(Object)DBNull.Value;
parameters[9].Value = model.TypistNo??(Object)DBNull.Value;
parameters[10].Value = model.InputerName??(Object)DBNull.Value;
parameters[11].Value = model.PartenerID??(Object)DBNull.Value;
parameters[12].Value = model.TgdNo??(Object)DBNull.Value;
parameters[13].Value = model.DataSource??(Object)DBNull.Value;
parameters[14].Value = model.DeclTrnRel??(Object)DBNull.Value;
parameters[15].Value = model.ChkSurety??(Object)DBNull.Value;
parameters[16].Value = model.CopCodeScc??(Object)DBNull.Value;
parameters[17].Value = model.CheckFlow??(Object)DBNull.Value;
parameters[18].Value = model.TaxAaminMark??(Object)DBNull.Value;
parameters[19].Value = model.EntyPortCode??(Object)DBNull.Value;
parameters[20].Value = model.BLNo??(Object)DBNull.Value;
parameters[21].Value = model.BillType??(Object)DBNull.Value;
parameters[22].Value = model.ApprNo??(Object)DBNull.Value;
parameters[23].Value = model.CustomMaster??(Object)DBNull.Value;
parameters[24].Value = model.CustomMaster_Text??(Object)DBNull.Value;
parameters[25].Value = model.AgentStatus??(Object)DBNull.Value;
parameters[26].Value = model.SeqNo??(Object)DBNull.Value;
parameters[27].Value = model.PreEntryId??(Object)DBNull.Value;
parameters[28].Value = model.EntryId??(Object)DBNull.Value;
parameters[29].Value = model.IEPort??(Object)DBNull.Value;
parameters[30].Value = model.IEPort_Text??(Object)DBNull.Value;
parameters[31].Value = model.ManualNo??(Object)DBNull.Value;
parameters[32].Value = model.ContrNo??(Object)DBNull.Value;
parameters[33].Value = model.IEDate??(Object)DBNull.Value;
parameters[34].Value = model.DDate??(Object)DBNull.Value;
parameters[35].Value = model.TradeCoScc??(Object)DBNull.Value;
parameters[36].Value = model.TradeCode??(Object)DBNull.Value;
parameters[37].Value = model.TradeCiqCode??(Object)DBNull.Value;
parameters[38].Value = model.TradeName??(Object)DBNull.Value;
parameters[39].Value = model.OverseasConsignorCode??(Object)DBNull.Value;
parameters[40].Value = model.OverseasConsignorCname??(Object)DBNull.Value;
parameters[41].Value = model.OverseasConsignorEname??(Object)DBNull.Value;
parameters[42].Value = model.OverseasConsignorAddr??(Object)DBNull.Value;
parameters[43].Value = model.OverseasConsigneeCode??(Object)DBNull.Value;
parameters[44].Value = model.OverseasConsigneeEname??(Object)DBNull.Value;
parameters[45].Value = model.DomesticConsigneeEname??(Object)DBNull.Value;
parameters[46].Value = model.EdiRemark2??(Object)DBNull.Value;
parameters[47].Value = model.EdiRemark??(Object)DBNull.Value;
parameters[48].Value = model.OwnerCodeScc??(Object)DBNull.Value;
parameters[49].Value = model.OwnerCode??(Object)DBNull.Value;
parameters[50].Value = model.OwnerCiqCode??(Object)DBNull.Value;
parameters[51].Value = model.OwnerName??(Object)DBNull.Value;
parameters[52].Value = model.AgentCodeScc??(Object)DBNull.Value;
parameters[53].Value = model.AgentCode??(Object)DBNull.Value;
parameters[54].Value = model.DeclCiqCode??(Object)DBNull.Value;
parameters[55].Value = model.AgentName??(Object)DBNull.Value;
parameters[56].Value = model.TrafMode??(Object)DBNull.Value;
parameters[57].Value = model.TrafMode_Text??(Object)DBNull.Value;
parameters[58].Value = model.TrafName??(Object)DBNull.Value;
parameters[59].Value = model.NativeVoyageNo??(Object)DBNull.Value;
parameters[60].Value = model.BillNo??(Object)DBNull.Value;
parameters[61].Value = model.TradeMode??(Object)DBNull.Value;
parameters[62].Value = model.TradeMode_Text??(Object)DBNull.Value;
parameters[63].Value = model.CutMode??(Object)DBNull.Value;
parameters[64].Value = model.CutMode_Text??(Object)DBNull.Value;
parameters[65].Value = model.LicenseNo??(Object)DBNull.Value;
parameters[66].Value = model.TradeCountry??(Object)DBNull.Value;
parameters[67].Value = model.TradeCountry_Text??(Object)DBNull.Value;
parameters[68].Value = model.DistinatePort??(Object)DBNull.Value;
parameters[69].Value = model.DistinatePort_Text??(Object)DBNull.Value;
parameters[70].Value = model.TransMode??(Object)DBNull.Value;
parameters[71].Value = model.TransMode_Text??(Object)DBNull.Value;
parameters[72].Value = model.FeeMark??(Object)DBNull.Value;
parameters[73].Value = model.FeeRate??(Object)DBNull.Value;
parameters[74].Value = model.FeeCurr??(Object)DBNull.Value;
parameters[75].Value = model.FeeCurr_Text??(Object)DBNull.Value;
parameters[76].Value = model.InsurMark??(Object)DBNull.Value;
parameters[77].Value = model.InsurRate??(Object)DBNull.Value;
parameters[78].Value = model.InsurCurr??(Object)DBNull.Value;
parameters[79].Value = model.InsurCurr_Text??(Object)DBNull.Value;
parameters[80].Value = model.OtherMark??(Object)DBNull.Value;
parameters[81].Value = model.OtherRate??(Object)DBNull.Value;
parameters[82].Value = model.OtherCurr??(Object)DBNull.Value;
parameters[83].Value = model.OtherCurr_Text??(Object)DBNull.Value;
parameters[84].Value = model.PackNo??(Object)DBNull.Value;
parameters[85].Value = model.WrapType??(Object)DBNull.Value;
parameters[86].Value = model.WrapType_Text??(Object)DBNull.Value;
parameters[87].Value = model.GrossWet??(Object)DBNull.Value;
parameters[88].Value = model.NetWt??(Object)DBNull.Value;
parameters[89].Value = model.TradeAreaCode??(Object)DBNull.Value;
parameters[90].Value = model.TradeAreaCode_Text??(Object)DBNull.Value;
parameters[91].Value = model.ContaCount??(Object)DBNull.Value;
parameters[92].Value = model.AttaDocuCdstr??(Object)DBNull.Value;
parameters[93].Value = model.GoodsPlace??(Object)DBNull.Value;
parameters[94].Value = model.DespPortCode??(Object)DBNull.Value;
parameters[95].Value = model.DespPortCode_Text??(Object)DBNull.Value;
parameters[96].Value = model.EntryType??(Object)DBNull.Value;
parameters[97].Value = model.EntryType_Text??(Object)DBNull.Value;
parameters[98].Value = model.NoteS??(Object)DBNull.Value;
parameters[99].Value = model.MarkNo??(Object)DBNull.Value;
parameters[100].Value = model.OrgCode??(Object)DBNull.Value;
parameters[101].Value = model.OrgCode_Text??(Object)DBNull.Value;
parameters[102].Value = model.VsaOrgCode??(Object)DBNull.Value;
parameters[103].Value = model.VsaOrgCode_Text??(Object)DBNull.Value;
parameters[104].Value = model.InspOrgCode??(Object)DBNull.Value;
parameters[105].Value = model.InspOrgCode_Text??(Object)DBNull.Value;
parameters[106].Value = model.PurpOrgCode??(Object)DBNull.Value;
parameters[107].Value = model.PurpOrgCode_Text??(Object)DBNull.Value;
parameters[108].Value = model.CorrelationNo??(Object)DBNull.Value;
parameters[109].Value = model.CorrelationReasonFlag??(Object)DBNull.Value;
parameters[110].Value = model.CorrelationReasonFlag_Text??(Object)DBNull.Value;
parameters[111].Value = model.DespDate??(Object)DBNull.Value;
parameters[112].Value = model.CmplDschrgDt??(Object)DBNull.Value;
parameters[113].Value = model.OrigBoxFlag??(Object)DBNull.Value;
parameters[114].Value = model.SpecDeclFlag??(Object)DBNull.Value;
parameters[115].Value = model.SpecDeclFlag_Text??(Object)DBNull.Value;
parameters[116].Value = model.PromiseItmes??(Object)DBNull.Value;
parameters[117].Value = model.DeclareName??(Object)DBNull.Value;
parameters[118].Value = model.NoOtherPack??(Object)DBNull.Value;
parameters[119].Value = model.Insp_cert??(Object)DBNull.Value;
parameters[120].Value = model.BillState ?? (Object)DBNull.Value;
parameters[121].Value = model.ClientSeqNo ?? (Object)DBNull.Value;
parameters[122].Value = model.ApplyType ?? (Object)DBNull.Value;
//parameters[123].Value = model.ApplyType_Text ?? (Object)DBNull.Value;
return DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
/// <summary>
/// 更新报关单状态
/// </summary>
public int UpdateBillState(string gid,string state,string reason)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update DecHead set ");
strSql.Append(" BillState = '" + state + "'");
if (state=="R")
strSql.Append(",RejectReason='" + reason + "'");
strSql.Append(" where GID = '"+gid+"' ");
return DbHelperSQL.ExecuteSql(strSql.ToString());
}
/// <summary>
/// 更新一条数据
/// </summary>
public int Update(DSWeb.SoftMng.Model.DecHead model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("update DecHead set ");
strSql.Append(" GID = @GID,");
strSql.Append(" BSNO = @BSNO,");
strSql.Append(" IEFlag = @IEFlag,");
strSql.Append(" Type = @Type,");
strSql.Append(" EdiId = @EdiId,");
strSql.Append(" Risk = @Risk,");
strSql.Append(" CopCode = @CopCode,");
strSql.Append(" CopName = @CopName,");
strSql.Append(" PDate = @PDate,");
strSql.Append(" TypistNo = @TypistNo,");
strSql.Append(" InputerName = @InputerName,");
strSql.Append(" PartenerID = @PartenerID,");
strSql.Append(" TgdNo = @TgdNo,");
strSql.Append(" DataSource = @DataSource,");
strSql.Append(" DeclTrnRel = @DeclTrnRel,");
strSql.Append(" ChkSurety = @ChkSurety,");
strSql.Append(" CopCodeScc = @CopCodeScc,");
strSql.Append(" CheckFlow = @CheckFlow,");
strSql.Append(" TaxAaminMark = @TaxAaminMark,");
strSql.Append(" EntyPortCode = @EntyPortCode,");
strSql.Append(" BLNo = @BLNo,");
strSql.Append(" BillType = @BillType,");
strSql.Append(" ApprNo = @ApprNo,");
strSql.Append(" CustomMaster = @CustomMaster,");
strSql.Append(" CustomMaster_Text = @CustomMaster_Text,");
strSql.Append(" AgentStatus = @AgentStatus,");
strSql.Append(" SeqNo = @SeqNo,");
strSql.Append(" PreEntryId = @PreEntryId,");
strSql.Append(" EntryId = @EntryId,");
strSql.Append(" IEPort = @IEPort,");
strSql.Append(" IEPort_Text = @IEPort_Text,");
strSql.Append(" ManualNo = @ManualNo,");
strSql.Append(" ContrNo = @ContrNo,");
strSql.Append(" IEDate = @IEDate,");
strSql.Append(" DDate = @DDate,");
strSql.Append(" TradeCoScc = @TradeCoScc,");
strSql.Append(" TradeCode = @TradeCode,");
strSql.Append(" TradeCiqCode = @TradeCiqCode,");
strSql.Append(" TradeName = @TradeName,");
strSql.Append(" OverseasConsignorCode = @OverseasConsignorCode,");
strSql.Append(" OverseasConsignorCname = @OverseasConsignorCname,");
strSql.Append(" OverseasConsignorEname = @OverseasConsignorEname,");
strSql.Append(" OverseasConsignorAddr = @OverseasConsignorAddr,");
strSql.Append(" OverseasConsigneeCode = @OverseasConsigneeCode,");
strSql.Append(" OverseasConsigneeEname = @OverseasConsigneeEname,");
strSql.Append(" DomesticConsigneeEname = @DomesticConsigneeEname,");
strSql.Append(" EdiRemark2 = @EdiRemark2,");
strSql.Append(" EdiRemark = @EdiRemark,");
strSql.Append(" OwnerCodeScc = @OwnerCodeScc,");
strSql.Append(" OwnerCode = @OwnerCode,");
strSql.Append(" OwnerCiqCode = @OwnerCiqCode,");
strSql.Append(" OwnerName = @OwnerName,");
strSql.Append(" AgentCodeScc = @AgentCodeScc,");
strSql.Append(" AgentCode = @AgentCode,");
strSql.Append(" DeclCiqCode = @DeclCiqCode,");
strSql.Append(" AgentName = @AgentName,");
strSql.Append(" TrafMode = @TrafMode,");
strSql.Append(" TrafMode_Text = @TrafMode_Text,");
strSql.Append(" TrafName = @TrafName,");
strSql.Append(" NativeVoyageNo = @NativeVoyageNo,");
strSql.Append(" BillNo = @BillNo,");
strSql.Append(" TradeMode = @TradeMode,");
strSql.Append(" TradeMode_Text = @TradeMode_Text,");
strSql.Append(" CutMode = @CutMode,");
strSql.Append(" CutMode_Text = @CutMode_Text,");
strSql.Append(" LicenseNo = @LicenseNo,");
strSql.Append(" TradeCountry = @TradeCountry,");
strSql.Append(" TradeCountry_Text = @TradeCountry_Text,");
strSql.Append(" DistinatePort = @DistinatePort,");
strSql.Append(" DistinatePort_Text = @DistinatePort_Text,");
strSql.Append(" TransMode = @TransMode,");
strSql.Append(" TransMode_Text = @TransMode_Text,");
strSql.Append(" FeeMark = @FeeMark,");
strSql.Append(" FeeRate = @FeeRate,");
strSql.Append(" FeeCurr = @FeeCurr,");
strSql.Append(" FeeCurr_Text = @FeeCurr_Text,");
strSql.Append(" InsurMark = @InsurMark,");
strSql.Append(" InsurRate = @InsurRate,");
strSql.Append(" InsurCurr = @InsurCurr,");
strSql.Append(" InsurCurr_Text = @InsurCurr_Text,");
strSql.Append(" OtherMark = @OtherMark,");
strSql.Append(" OtherRate = @OtherRate,");
strSql.Append(" OtherCurr = @OtherCurr,");
strSql.Append(" OtherCurr_Text = @OtherCurr_Text,");
strSql.Append(" PackNo = @PackNo,");
strSql.Append(" WrapType = @WrapType,");
strSql.Append(" WrapType_Text = @WrapType_Text,");
strSql.Append(" GrossWet = @GrossWet,");
strSql.Append(" NetWt = @NetWt,");
strSql.Append(" TradeAreaCode = @TradeAreaCode,");
strSql.Append(" TradeAreaCode_Text = @TradeAreaCode_Text,");
strSql.Append(" ContaCount = @ContaCount,");
strSql.Append(" AttaDocuCdstr = @AttaDocuCdstr,");
strSql.Append(" GoodsPlace = @GoodsPlace,");
strSql.Append(" DespPortCode = @DespPortCode,");
strSql.Append(" DespPortCode_Text = @DespPortCode_Text,");
strSql.Append(" EntryType = @EntryType,");
strSql.Append(" EntryType_Text = @EntryType_Text,");
strSql.Append(" NoteS = @NoteS,");
strSql.Append(" MarkNo = @MarkNo,");
strSql.Append(" OrgCode = @OrgCode,");
strSql.Append(" OrgCode_Text = @OrgCode_Text,");
strSql.Append(" VsaOrgCode = @VsaOrgCode,");
strSql.Append(" VsaOrgCode_Text = @VsaOrgCode_Text,");
strSql.Append(" InspOrgCode = @InspOrgCode,");
strSql.Append(" InspOrgCode_Text = @InspOrgCode_Text,");
strSql.Append(" PurpOrgCode = @PurpOrgCode,");
strSql.Append(" PurpOrgCode_Text = @PurpOrgCode_Text,");
strSql.Append(" CorrelationNo = @CorrelationNo,");
strSql.Append(" CorrelationReasonFlag = @CorrelationReasonFlag,");
strSql.Append(" CorrelationReasonFlag_Text = @CorrelationReasonFlag_Text,");
strSql.Append(" DespDate = @DespDate,");
strSql.Append(" CmplDschrgDt = @CmplDschrgDt,");
strSql.Append(" OrigBoxFlag = @OrigBoxFlag,");
strSql.Append(" SpecDeclFlag = @SpecDeclFlag,");
strSql.Append(" SpecDeclFlag_Text = @SpecDeclFlag_Text,");
strSql.Append(" PromiseItmes = @PromiseItmes,");
strSql.Append(" DeclareName = @DeclareName,");
strSql.Append(" NoOtherPack = @NoOtherPack,");
strSql.Append(" Insp_cert = @Insp_cert,");
strSql.Append(" BillState = @BillState");
strSql.Append(" ,ApplyType = @ApplyType");
//strSql.Append(" ApplyType_Text = @ApplyType_Text");
strSql.Append(" where GID=@GID ");
SqlParameter[] parameters = {
new SqlParameter("@GID", SqlDbType.VarChar,50) ,
new SqlParameter("@BSNO", SqlDbType.VarChar,50) ,
new SqlParameter("@IEFlag", SqlDbType.Char,1) ,
new SqlParameter("@Type", SqlDbType.VarChar,2) ,
new SqlParameter("@EdiId", SqlDbType.VarChar,50) ,
new SqlParameter("@Risk", SqlDbType.VarChar,50) ,
new SqlParameter("@CopCode", SqlDbType.VarChar,50) ,
new SqlParameter("@CopName", SqlDbType.NVarChar,50) ,
new SqlParameter("@PDate", SqlDbType.DateTime) ,
new SqlParameter("@TypistNo", SqlDbType.VarChar,50) ,
new SqlParameter("@InputerName", SqlDbType.NVarChar,50) ,
new SqlParameter("@PartenerID", SqlDbType.VarChar,50) ,
new SqlParameter("@TgdNo", SqlDbType.VarChar,50) ,
new SqlParameter("@DataSource", SqlDbType.VarChar,50) ,
new SqlParameter("@DeclTrnRel", SqlDbType.Char,1) ,
new SqlParameter("@ChkSurety", SqlDbType.VarChar,50) ,
new SqlParameter("@CopCodeScc", SqlDbType.VarChar,50) ,
new SqlParameter("@CheckFlow", SqlDbType.Char,1) ,
new SqlParameter("@TaxAaminMark", SqlDbType.VarChar,50) ,
new SqlParameter("@EntyPortCode", SqlDbType.VarChar,50) ,
new SqlParameter("@BLNo", SqlDbType.VarChar,50) ,
new SqlParameter("@BillType", SqlDbType.VarChar,50) ,
new SqlParameter("@ApprNo", SqlDbType.VarChar,50) ,
new SqlParameter("@CustomMaster", SqlDbType.VarChar,50) ,
new SqlParameter("@CustomMaster_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@AgentStatus", SqlDbType.NVarChar,50) ,
new SqlParameter("@SeqNo", SqlDbType.VarChar,50) ,
new SqlParameter("@PreEntryId", SqlDbType.VarChar,50) ,
new SqlParameter("@EntryId", SqlDbType.VarChar,50) ,
new SqlParameter("@IEPort", SqlDbType.VarChar,50) ,
new SqlParameter("@IEPort_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@ManualNo", SqlDbType.VarChar,50) ,
new SqlParameter("@ContrNo", SqlDbType.VarChar,50) ,
new SqlParameter("@IEDate", SqlDbType.DateTime) ,
new SqlParameter("@DDate", SqlDbType.DateTime) ,
new SqlParameter("@TradeCoScc", SqlDbType.VarChar,18) ,
new SqlParameter("@TradeCode", SqlDbType.VarChar,10) ,
new SqlParameter("@TradeCiqCode", SqlDbType.VarChar,10) ,
new SqlParameter("@TradeName", SqlDbType.NVarChar,50) ,
new SqlParameter("@OverseasConsignorCode", SqlDbType.VarChar,50) ,
new SqlParameter("@OverseasConsignorCname", SqlDbType.NVarChar,150) ,
new SqlParameter("@OverseasConsignorEname", SqlDbType.VarChar,150) ,
new SqlParameter("@OverseasConsignorAddr", SqlDbType.VarChar,500) ,
new SqlParameter("@OverseasConsigneeCode", SqlDbType.VarChar,50) ,
new SqlParameter("@OverseasConsigneeEname", SqlDbType.VarChar,150) ,
new SqlParameter("@DomesticConsigneeEname", SqlDbType.VarChar,150) ,
new SqlParameter("@EdiRemark2", SqlDbType.NVarChar,500) ,
new SqlParameter("@EdiRemark", SqlDbType.NVarChar,500) ,
new SqlParameter("@OwnerCodeScc", SqlDbType.VarChar,18) ,
new SqlParameter("@OwnerCode", SqlDbType.VarChar,10) ,
new SqlParameter("@OwnerCiqCode", SqlDbType.VarChar,10) ,
new SqlParameter("@OwnerName", SqlDbType.NVarChar,50) ,
new SqlParameter("@AgentCodeScc", SqlDbType.VarChar,18) ,
new SqlParameter("@AgentCode", SqlDbType.VarChar,10) ,
new SqlParameter("@DeclCiqCode", SqlDbType.VarChar,10) ,
new SqlParameter("@AgentName", SqlDbType.NVarChar,50) ,
new SqlParameter("@TrafMode", SqlDbType.VarChar,10) ,
new SqlParameter("@TrafMode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@TrafName", SqlDbType.NVarChar,50) ,
new SqlParameter("@NativeVoyageNo", SqlDbType.VarChar,50) ,
new SqlParameter("@BillNo", SqlDbType.VarChar,50) ,
new SqlParameter("@TradeMode", SqlDbType.VarChar,50) ,
new SqlParameter("@TradeMode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@CutMode", SqlDbType.VarChar,50) ,
new SqlParameter("@CutMode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@LicenseNo", SqlDbType.VarChar,50) ,
new SqlParameter("@TradeCountry", SqlDbType.VarChar,50) ,
new SqlParameter("@TradeCountry_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@DistinatePort", SqlDbType.VarChar,50) ,
new SqlParameter("@DistinatePort_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@TransMode", SqlDbType.VarChar,50) ,
new SqlParameter("@TransMode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@FeeMark", SqlDbType.Char,1) ,
new SqlParameter("@FeeRate", SqlDbType.Decimal,9) ,
new SqlParameter("@FeeCurr", SqlDbType.NVarChar,50) ,
new SqlParameter("@FeeCurr_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@InsurMark", SqlDbType.NVarChar,50) ,
new SqlParameter("@InsurRate", SqlDbType.Decimal,9) ,
new SqlParameter("@InsurCurr", SqlDbType.NVarChar,50) ,
new SqlParameter("@InsurCurr_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@OtherMark", SqlDbType.NVarChar,50) ,
new SqlParameter("@OtherRate", SqlDbType.Decimal,9) ,
new SqlParameter("@OtherCurr", SqlDbType.NVarChar,50) ,
new SqlParameter("@OtherCurr_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@PackNo", SqlDbType.Int,4) ,
new SqlParameter("@WrapType", SqlDbType.VarChar,50) ,
new SqlParameter("@WrapType_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@GrossWet", SqlDbType.Decimal,9) ,
new SqlParameter("@NetWt", SqlDbType.Decimal,9) ,
new SqlParameter("@TradeAreaCode", SqlDbType.VarChar,50) ,
new SqlParameter("@TradeAreaCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@ContaCount", SqlDbType.Int,4) ,
new SqlParameter("@AttaDocuCdstr", SqlDbType.VarChar,50) ,
new SqlParameter("@GoodsPlace", SqlDbType.NVarChar,50) ,
new SqlParameter("@DespPortCode", SqlDbType.VarChar,50) ,
new SqlParameter("@DespPortCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@EntryType", SqlDbType.VarChar,50) ,
new SqlParameter("@EntryType_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@NoteS", SqlDbType.NVarChar,150) ,
new SqlParameter("@MarkNo", SqlDbType.VarChar,400) ,
new SqlParameter("@OrgCode", SqlDbType.VarChar,50) ,
new SqlParameter("@OrgCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@VsaOrgCode", SqlDbType.VarChar,50) ,
new SqlParameter("@VsaOrgCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@InspOrgCode", SqlDbType.VarChar,50) ,
new SqlParameter("@InspOrgCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@PurpOrgCode", SqlDbType.VarChar,50) ,
new SqlParameter("@PurpOrgCode_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@CorrelationNo", SqlDbType.VarChar,500) ,
new SqlParameter("@CorrelationReasonFlag", SqlDbType.VarChar,50) ,
new SqlParameter("@CorrelationReasonFlag_Text", SqlDbType.NVarChar,50) ,
new SqlParameter("@DespDate", SqlDbType.DateTime) ,
new SqlParameter("@CmplDschrgDt", SqlDbType.DateTime) ,
new SqlParameter("@OrigBoxFlag", SqlDbType.VarChar,50) ,
new SqlParameter("@SpecDeclFlag", SqlDbType.VarChar,500) ,
new SqlParameter("@SpecDeclFlag_Text", SqlDbType.NVarChar,500) ,
new SqlParameter("@PromiseItmes", SqlDbType.VarChar,50) ,
new SqlParameter("@DeclareName", SqlDbType.NVarChar,50) ,
new SqlParameter("@NoOtherPack", SqlDbType.Char,1) ,
new SqlParameter("@Insp_cert", SqlDbType.NVarChar,500),
new SqlParameter("@BillState", SqlDbType.Char,1),
new SqlParameter("@ApplyType", SqlDbType.TinyInt,4)
};
parameters[0].Value = model.GID??(Object)DBNull.Value;
parameters[1].Value = model.BSNO??(Object)DBNull.Value;
parameters[2].Value = model.IEFlag??(Object)DBNull.Value;
parameters[3].Value = model.Type??(Object)DBNull.Value;
parameters[4].Value = model.EdiId??(Object)DBNull.Value;
parameters[5].Value = model.Risk??(Object)DBNull.Value;
parameters[6].Value = model.CopCode??(Object)DBNull.Value;
parameters[7].Value = model.CopName??(Object)DBNull.Value;
parameters[8].Value = model.PDate??(Object)DBNull.Value;
parameters[9].Value = model.TypistNo??(Object)DBNull.Value;
parameters[10].Value = model.InputerName??(Object)DBNull.Value;
parameters[11].Value = model.PartenerID??(Object)DBNull.Value;
parameters[12].Value = model.TgdNo??(Object)DBNull.Value;
parameters[13].Value = model.DataSource??(Object)DBNull.Value;
parameters[14].Value = model.DeclTrnRel??(Object)DBNull.Value;
parameters[15].Value = model.ChkSurety??(Object)DBNull.Value;
parameters[16].Value = model.CopCodeScc??(Object)DBNull.Value;
parameters[17].Value = model.CheckFlow??(Object)DBNull.Value;
parameters[18].Value = model.TaxAaminMark??(Object)DBNull.Value;
parameters[19].Value = model.EntyPortCode??(Object)DBNull.Value;
parameters[20].Value = model.BLNo??(Object)DBNull.Value;
parameters[21].Value = model.BillType??(Object)DBNull.Value;
parameters[22].Value = model.ApprNo??(Object)DBNull.Value;
parameters[23].Value = model.CustomMaster??(Object)DBNull.Value;
parameters[24].Value = model.CustomMaster_Text??(Object)DBNull.Value;
parameters[25].Value = model.AgentStatus??(Object)DBNull.Value;
parameters[26].Value = model.SeqNo??(Object)DBNull.Value;
parameters[27].Value = model.PreEntryId??(Object)DBNull.Value;
parameters[28].Value = model.EntryId??(Object)DBNull.Value;
parameters[29].Value = model.IEPort??(Object)DBNull.Value;
parameters[30].Value = model.IEPort_Text??(Object)DBNull.Value;
parameters[31].Value = model.ManualNo??(Object)DBNull.Value;
parameters[32].Value = model.ContrNo??(Object)DBNull.Value;
parameters[33].Value = model.IEDate??(Object)DBNull.Value;
parameters[34].Value = model.DDate??(Object)DBNull.Value;
parameters[35].Value = model.TradeCoScc??(Object)DBNull.Value;
parameters[36].Value = model.TradeCode??(Object)DBNull.Value;
parameters[37].Value = model.TradeCiqCode??(Object)DBNull.Value;
parameters[38].Value = model.TradeName??(Object)DBNull.Value;
parameters[39].Value = model.OverseasConsignorCode??(Object)DBNull.Value;
parameters[40].Value = model.OverseasConsignorCname??(Object)DBNull.Value;
parameters[41].Value = model.OverseasConsignorEname??(Object)DBNull.Value;
parameters[42].Value = model.OverseasConsignorAddr??(Object)DBNull.Value;
parameters[43].Value = model.OverseasConsigneeCode??(Object)DBNull.Value;
parameters[44].Value = model.OverseasConsigneeEname??(Object)DBNull.Value;
parameters[45].Value = model.DomesticConsigneeEname??(Object)DBNull.Value;
parameters[46].Value = model.EdiRemark2??(Object)DBNull.Value;
parameters[47].Value = model.EdiRemark??(Object)DBNull.Value;
parameters[48].Value = model.OwnerCodeScc??(Object)DBNull.Value;
parameters[49].Value = model.OwnerCode??(Object)DBNull.Value;
parameters[50].Value = model.OwnerCiqCode??(Object)DBNull.Value;
parameters[51].Value = model.OwnerName??(Object)DBNull.Value;
parameters[52].Value = model.AgentCodeScc??(Object)DBNull.Value;
parameters[53].Value = model.AgentCode??(Object)DBNull.Value;
parameters[54].Value = model.DeclCiqCode??(Object)DBNull.Value;
parameters[55].Value = model.AgentName??(Object)DBNull.Value;
parameters[56].Value = model.TrafMode??(Object)DBNull.Value;
parameters[57].Value = model.TrafMode_Text??(Object)DBNull.Value;
parameters[58].Value = model.TrafName??(Object)DBNull.Value;
parameters[59].Value = model.NativeVoyageNo??(Object)DBNull.Value;
parameters[60].Value = model.BillNo??(Object)DBNull.Value;
parameters[61].Value = model.TradeMode??(Object)DBNull.Value;
parameters[62].Value = model.TradeMode_Text??(Object)DBNull.Value;
parameters[63].Value = model.CutMode??(Object)DBNull.Value;
parameters[64].Value = model.CutMode_Text??(Object)DBNull.Value;
parameters[65].Value = model.LicenseNo??(Object)DBNull.Value;
parameters[66].Value = model.TradeCountry??(Object)DBNull.Value;
parameters[67].Value = model.TradeCountry_Text??(Object)DBNull.Value;
parameters[68].Value = model.DistinatePort??(Object)DBNull.Value;
parameters[69].Value = model.DistinatePort_Text??(Object)DBNull.Value;
parameters[70].Value = model.TransMode??(Object)DBNull.Value;
parameters[71].Value = model.TransMode_Text??(Object)DBNull.Value;
parameters[72].Value = model.FeeMark??(Object)DBNull.Value;
parameters[73].Value = model.FeeRate??(Object)DBNull.Value;
parameters[74].Value = model.FeeCurr??(Object)DBNull.Value;
parameters[75].Value = model.FeeCurr_Text??(Object)DBNull.Value;
parameters[76].Value = model.InsurMark??(Object)DBNull.Value;
parameters[77].Value = model.InsurRate??(Object)DBNull.Value;
parameters[78].Value = model.InsurCurr??(Object)DBNull.Value;
parameters[79].Value = model.InsurCurr_Text??(Object)DBNull.Value;
parameters[80].Value = model.OtherMark??(Object)DBNull.Value;
parameters[81].Value = model.OtherRate??(Object)DBNull.Value;
parameters[82].Value = model.OtherCurr??(Object)DBNull.Value;
parameters[83].Value = model.OtherCurr_Text??(Object)DBNull.Value;
parameters[84].Value = model.PackNo??(Object)DBNull.Value;
parameters[85].Value = model.WrapType??(Object)DBNull.Value;
parameters[86].Value = model.WrapType_Text??(Object)DBNull.Value;
parameters[87].Value = model.GrossWet??(Object)DBNull.Value;
parameters[88].Value = model.NetWt??(Object)DBNull.Value;
parameters[89].Value = model.TradeAreaCode??(Object)DBNull.Value;
parameters[90].Value = model.TradeAreaCode_Text??(Object)DBNull.Value;
parameters[91].Value = model.ContaCount??(Object)DBNull.Value;
parameters[92].Value = model.AttaDocuCdstr??(Object)DBNull.Value;
parameters[93].Value = model.GoodsPlace??(Object)DBNull.Value;
parameters[94].Value = model.DespPortCode??(Object)DBNull.Value;
parameters[95].Value = model.DespPortCode_Text??(Object)DBNull.Value;
parameters[96].Value = model.EntryType??(Object)DBNull.Value;
parameters[97].Value = model.EntryType_Text??(Object)DBNull.Value;
parameters[98].Value = model.NoteS??(Object)DBNull.Value;
parameters[99].Value = model.MarkNo??(Object)DBNull.Value;
parameters[100].Value = model.OrgCode??(Object)DBNull.Value;
parameters[101].Value = model.OrgCode_Text??(Object)DBNull.Value;
parameters[102].Value = model.VsaOrgCode??(Object)DBNull.Value;
parameters[103].Value = model.VsaOrgCode_Text??(Object)DBNull.Value;
parameters[104].Value = model.InspOrgCode??(Object)DBNull.Value;
parameters[105].Value = model.InspOrgCode_Text??(Object)DBNull.Value;
parameters[106].Value = model.PurpOrgCode??(Object)DBNull.Value;
parameters[107].Value = model.PurpOrgCode_Text??(Object)DBNull.Value;
parameters[108].Value = model.CorrelationNo??(Object)DBNull.Value;
parameters[109].Value = model.CorrelationReasonFlag??(Object)DBNull.Value;
parameters[110].Value = model.CorrelationReasonFlag_Text??(Object)DBNull.Value;
parameters[111].Value = model.DespDate??(Object)DBNull.Value;
parameters[112].Value = model.CmplDschrgDt??(Object)DBNull.Value;
parameters[113].Value = model.OrigBoxFlag??(Object)DBNull.Value;
parameters[114].Value = model.SpecDeclFlag??(Object)DBNull.Value;
parameters[115].Value = model.SpecDeclFlag_Text??(Object)DBNull.Value;
parameters[116].Value = model.PromiseItmes??(Object)DBNull.Value;
parameters[117].Value = model.DeclareName??(Object)DBNull.Value;
parameters[118].Value = model.NoOtherPack??(Object)DBNull.Value;
parameters[119].Value = model.Insp_cert??(Object)DBNull.Value;
parameters[120].Value = model.BillState ?? (Object)DBNull.Value;
parameters[121].Value = model.ApplyType ?? (Object)DBNull.Value;
//parameters[122].Value = model.ApplyType_Text ?? (Object)DBNull.Value;
return DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
/// <summary>
/// 删除一条数据
/// </summary>
public int Delete(string GID)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("delete from DecHead ");
strSql.Append(" where GID=@GID ");
SqlParameter[] parameters = {
new SqlParameter("@GID", SqlDbType.VarChar,50) };
parameters[0].Value = GID;
return DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
/// <summary>
/// 按条件批量删除
/// </summary>
public int DeleteListWhere(string strWhere)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("delete from DecHead ");
if(strWhere.Trim()!="")
{
strSql.Append(" where "+strWhere);
}
return DbHelperSQL.ExecuteSql(strSql.ToString());
}
/// <summary>
/// 得到一个对象实体
/// </summary>
public DataSet GetModel(string GID)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select GID, BSNO, IEFlag, Type, EdiId, Risk, CopCode, CopName, PDate, TypistNo, InputerName, PartenerID, TgdNo, DataSource, DeclTrnRel, ChkSurety, CopCodeScc, CheckFlow, TaxAaminMark, EntyPortCode, BLNo, BillType, ApprNo, CustomMaster, CustomMaster_Text, AgentStatus, SeqNo, PreEntryId, EntryId, IEPort, IEPort_Text, ManualNo, ContrNo, IEDate, DDate, TradeCoScc, TradeCode, TradeCiqCode, TradeName, OverseasConsignorCode, OverseasConsignorCname, OverseasConsignorEname, OverseasConsignorAddr, OverseasConsigneeCode, OverseasConsigneeEname, DomesticConsigneeEname, EdiRemark2, EdiRemark, OwnerCodeScc, OwnerCode, OwnerCiqCode, OwnerName, AgentCodeScc, AgentCode, DeclCiqCode, AgentName, TrafMode, TrafMode_Text, TrafName, NativeVoyageNo, BillNo, TradeMode, TradeMode_Text, CutMode, CutMode_Text, LicenseNo, TradeCountry, TradeCountry_Text, DistinatePort, DistinatePort_Text, TransMode, TransMode_Text, FeeMark, FeeRate, FeeCurr, FeeCurr_Text, InsurMark, InsurRate, InsurCurr, InsurCurr_Text, OtherMark, OtherRate, OtherCurr, OtherCurr_Text, PackNo, WrapType, WrapType_Text, GrossWet, NetWt, TradeAreaCode, TradeAreaCode_Text, ContaCount, AttaDocuCdstr, GoodsPlace, DespPortCode, DespPortCode_Text, EntryType, EntryType_Text, NoteS, MarkNo, OrgCode, OrgCode_Text, VsaOrgCode, VsaOrgCode_Text, InspOrgCode, InspOrgCode_Text, PurpOrgCode, PurpOrgCode_Text, CorrelationNo, CorrelationReasonFlag, CorrelationReasonFlag_Text, DespDate, CmplDschrgDt, OrigBoxFlag, SpecDeclFlag, SpecDeclFlag_Text, PromiseItmes, DeclareName, NoOtherPack, Insp_cert,BillState,ClientSeqNo,ApplyType ");
strSql.Append(" from DecHead ");
strSql.Append(" where GID=@GID ");
SqlParameter[] parameters = {
new SqlParameter("@GID", SqlDbType.VarChar,50) };
parameters[0].Value = GID;
DSWeb.SoftMng.Model.DecHead model=new DSWeb.SoftMng.Model.DecHead();
return DbHelperSQL.Query(strSql.ToString(),parameters);
}
/// <summary>
/// 获得数据列表
/// </summary>
public DataSet GetList(string strWhere)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select * ");
strSql.Append(" FROM DecHead ");
if(strWhere.Trim()!="")
{
strSql.Append(" where "+strWhere);
}
return DbHelperSQL.Query(strSql.ToString());
}
/// <summary>
/// 获得前几行数据
/// </summary>
public DataSet GetList(int Top,string strWhere,string filedOrder)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select ");
if(Top>0)
{
strSql.Append(" top "+Top.ToString());
}
strSql.Append(" * ");
strSql.Append(" FROM DecHead ");
if(strWhere.Trim()!="")
{
strSql.Append(" where "+strWhere);
}
strSql.Append(" order by " + filedOrder);
return DbHelperSQL.Query(strSql.ToString());
}
/// <summary>
/// 分页获取数据列表
/// </summary>
public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
{
//动软代码
StringBuilder strSql = new StringBuilder();
strSql.Append("SELECT * FROM ( ");
strSql.Append(" SELECT ROW_NUMBER() OVER (");
if (!string.IsNullOrEmpty(orderby.Trim()))
strSql.Append("order by T." + orderby);
strSql.Append(")AS Row, T.* from DecHead T ");
if (!string.IsNullOrEmpty(strWhere.Trim()))
{
strSql.Append(" WHERE " + strWhere);
}
strSql.Append(" ) TT");
strSql.AppendFormat(" WHERE TT.Row > {0} and TT.Row <= {1}", startIndex, endIndex);
//公共代码
return DbHelperSQL.Query(strSql.ToString());
}
/// <summary>
/// 获取记录总数
/// </summary>
public int GetRecordCount(string strWhere)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select count(1) FROM DecHead ");
if(strWhere.Trim()!="")
{
strSql.Append(" where "+strWhere);
}
return DbHelperSQL.ExcuteScalarSQL(strSql.ToString());
}
static public List<AuditDecHead> GetDataList(string strCondition, int start, int limit, string userid, string username, string companyid, out int total, string sort = null)
{
/*
var rangstr = GetRangDAStr("index", userid, username, companyid);
if (!string.IsNullOrEmpty(rangstr))
{
if (!string.IsNullOrEmpty(strCondition))
{
strCondition = strCondition + " and " + rangstr;
}
else
{
strCondition = rangstr;
}
}
*/
var strSql = new StringBuilder();
strSql.Append("select d.GID, d.BSNO,d.IEFlag,d.Type,d.EdiId,d.Risk,d.CopCode,d.CopName,d.PDate,d.TypistNo,d.InputerName,d.PartenerID,d.TgdNo, d.DataSource,d.DeclTrnRel,d.ChkSurety,d.CopCodeScc,d.CheckFlow,d.TaxAaminMark,d.EntyPortCode,d.BLNo,d.BillType,d.ApprNo,d.CustomMaster, d.CustomMaster_Text,d.AgentStatus,d.SeqNo,d.PreEntryId,d.EntryId,d.IEPort,d.IEPort_Text,d.ManualNo,d.ContrNo,d.IEDate,d.DDate,d.TradeCoScc, d.TradeCode,d.TradeCiqCode,d.TradeName,d.OverseasConsignorCode,d.OverseasConsignorCname,d.OverseasConsignorEname,d.OverseasConsignorAddr, d.OverseasConsigneeCode,d.OverseasConsigneeEname,d.DomesticConsigneeEname,d.EdiRemark2,d.EdiRemark,d.OwnerCodeScc,d.OwnerCode,d. OwnerCiqCode,d.OwnerName,d.AgentCodeScc,d.AgentCode,d.DeclCiqCode,d.AgentName,d.TrafMode,d.TrafMode_Text,d.TrafName,d.NativeVoyageNo, d.BillNo,d.TradeMode,d.TradeMode_Text,d.CutMode,d.CutMode_Text,d.LicenseNo,d.TradeCountry,d.TradeCountry_Text,d.DistinatePort, d.DistinatePort_Text,d.TransMode,d.TransMode_Text,d.FeeMark,d.FeeRate,d.FeeCurr,d.FeeCurr_Text,d.InsurMark,d.InsurRate,d.InsurCurr, d.InsurCurr_Text,d.OtherMark,d.OtherRate,d.OtherCurr,d.OtherCurr_Text,d.PackNo,d.WrapType,d.WrapType_Text,d.GrossWet,d.NetWt,d.TradeAreaCode,d.TradeAreaCode_Text,d.ContaCount,d.AttaDocuCdstr,d.GoodsPlace,d.DespPortCode,d.DespPortCode_Text,d.EntryType,d.EntryType_Text,d.NoteS, d.MarkNo,d.OrgCode,d.OrgCode_Text,d.VsaOrgCode,d.VsaOrgCode_Text,d.InspOrgCode,d.InspOrgCode_Text,d.PurpOrgCode,d.PurpOrgCode_Text, d.CorrelationNo,d.CorrelationReasonFlag,d.CorrelationReasonFlag_Text,d.DespDate,d.CmplDschrgDt,d.OrigBoxFlag,d.SpecDeclFlag, d.SpecDeclFlag_Text,d.PromiseItmes,d.DeclareName,d.NoOtherPack,d.Insp_cert,d.BillState,o.CUSTNO,o.CUSTOMNO,o.MBLNO,o.CUSTOMERNAME,o.VESSEL,o.VOYNO,o.ETD,o.ETA ,d.ClientSeqNo ,d.ApplyType ");
strSql.Append(",s.COMPOP,s.COMPTIME from DecHead d inner join op_apply o on o.bsno = d.BSNO ");
strSql.Append(" left join (SELECT [ST_ID],[BSNO],[STATUS],[ISCOMP],[COMPTIME],[COMPOP],[REMARK],[INPUTBY],[INPUTTIME],[ORDNO],[STATUS_OPSEAE],[STTYPE],[ISOPEN] from (");
strSql.Append("SELECT [ST_ID],[BSNO],[STATUS],[ISCOMP],[COMPTIME],[COMPOP],[REMARK],[INPUTBY],[INPUTTIME],[ORDNO],[STATUS_OPSEAE],[STTYPE],[ISOPEN], row_number() over(partition by BSNO ORDER BY INPUTTIME desc) as rowno");
strSql.Append(" from op_status WHERE [STATUS] = '报关单待复核'");
strSql.Append(") x WHERE x.rowno = 1) s on (s.BSNO=d.BSNO) ");
strSql.Append(" where d.BillState <> 'N' ");
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" and "+strCondition);
}
strSql.Append(" order by d.PDate DESC ");
int totalCount = 0;
StringBuilder sb = PagerHelper.PageSQL(strSql.ToString(), start, limit, out totalCount);
total = totalCount;
return SetSingleAuditListData(sb);
}
/// <summary>
/// 执行sql
/// </summary>
/// <param name="strSql"></param>
/// <returns></returns>
private static List<DecHead> SetSingleListData(StringBuilder strSql)
{
#region 公共代码
var headList = new List<DecHead>();
Database db = DatabaseFactory.CreateDatabase();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = strSql.ToString();
cmd.CommandTimeout = 120000; //要加这一句
using (IDataReader row = db.ExecuteReader(cmd))
{
while (row.Read())
{
DecHead model = new DecHead();
if (row != null)
{
if (row["GID"] != null)
{
model.GID = row["GID"].ToString();
}
if (row["BSNO"] != null)
{
model.BSNO = row["BSNO"].ToString();
}
if (row["IEFlag"] != null)
{
model.IEFlag = row["IEFlag"].ToString();
}
if (row["Type"] != null)
{
model.Type = row["Type"].ToString();
}
if (row["EdiId"] != null)
{
model.EdiId = row["EdiId"].ToString();
}
if (row["Risk"] != null)
{
model.Risk = row["Risk"].ToString();
}
if (row["CopCode"] != null)
{
model.CopCode = row["CopCode"].ToString();
}
if (row["CopName"] != null)
{
model.CopName = row["CopName"].ToString();
}
if (row["PDate"] != null && row["PDate"].ToString() != "")
{
model.PDate = DateTime.Parse(row["PDate"].ToString());
}
if (row["TypistNo"] != null)
{
model.TypistNo = row["TypistNo"].ToString();
}
if (row["InputerName"] != null)
{
model.InputerName = row["InputerName"].ToString();
}
if (row["PartenerID"] != null)
{
model.PartenerID = row["PartenerID"].ToString();
}
if (row["TgdNo"] != null)
{
model.TgdNo = row["TgdNo"].ToString();
}
if (row["DataSource"] != null)
{
model.DataSource = row["DataSource"].ToString();
}
if (row["DeclTrnRel"] != null)
{
model.DeclTrnRel = row["DeclTrnRel"].ToString();
}
if (row["ChkSurety"] != null)
{
model.ChkSurety = row["ChkSurety"].ToString();
}
if (row["CopCodeScc"] != null)
{
model.CopCodeScc = row["CopCodeScc"].ToString();
}
if (row["CheckFlow"] != null)
{
model.CheckFlow = row["CheckFlow"].ToString();
}
if (row["TaxAaminMark"] != null)
{
model.TaxAaminMark = row["TaxAaminMark"].ToString();
}
if (row["EntyPortCode"] != null)
{
model.EntyPortCode = row["EntyPortCode"].ToString();
}
if (row["BLNo"] != null)
{
model.BLNo = row["BLNo"].ToString();
}
if (row["BillType"] != null)
{
model.BillType = row["BillType"].ToString();
}
if (row["ApprNo"] != null)
{
model.ApprNo = row["ApprNo"].ToString();
}
if (row["CustomMaster"] != null)
{
model.CustomMaster = row["CustomMaster"].ToString();
}
if (row["CustomMaster_Text"] != null)
{
model.CustomMaster_Text = row["CustomMaster_Text"].ToString();
}
if (row["AgentStatus"] != null)
{
model.AgentStatus = row["AgentStatus"].ToString();
}
if (row["SeqNo"] != null)
{
model.SeqNo = row["SeqNo"].ToString();
}
if (row["PreEntryId"] != null)
{
model.PreEntryId = row["PreEntryId"].ToString();
}
if (row["EntryId"] != null)
{
model.EntryId = row["EntryId"].ToString();
}
if (row["IEPort"] != null)
{
model.IEPort = row["IEPort"].ToString();
}
if (row["IEPort_Text"] != null)
{
model.IEPort_Text = row["IEPort_Text"].ToString();
}
if (row["ManualNo"] != null)
{
model.ManualNo = row["ManualNo"].ToString();
}
if (row["ContrNo"] != null)
{
model.ContrNo = row["ContrNo"].ToString();
}
if (row["IEDate"] != null && row["IEDate"].ToString() != "")
{
model.IEDate = DateTime.Parse(row["IEDate"].ToString());
}
if (row["DDate"] != null && row["DDate"].ToString() != "")
{
model.DDate = DateTime.Parse(row["DDate"].ToString());
}
if (row["TradeCoScc"] != null)
{
model.TradeCoScc = row["TradeCoScc"].ToString();
}
if (row["TradeCode"] != null)
{
model.TradeCode = row["TradeCode"].ToString();
}
if (row["TradeCiqCode"] != null)
{
model.TradeCiqCode = row["TradeCiqCode"].ToString();
}
if (row["TradeName"] != null)
{
model.TradeName = row["TradeName"].ToString();
}
if (row["OverseasConsignorCode"] != null)
{
model.OverseasConsignorCode = row["OverseasConsignorCode"].ToString();
}
if (row["OverseasConsignorCname"] != null)
{
model.OverseasConsignorCname = row["OverseasConsignorCname"].ToString();
}
if (row["OverseasConsignorEname"] != null)
{
model.OverseasConsignorEname = row["OverseasConsignorEname"].ToString();
}
if (row["OverseasConsignorAddr"] != null)
{
model.OverseasConsignorAddr = row["OverseasConsignorAddr"].ToString();
}
if (row["OverseasConsigneeCode"] != null)
{
model.OverseasConsigneeCode = row["OverseasConsigneeCode"].ToString();
}
if (row["OverseasConsigneeEname"] != null)
{
model.OverseasConsigneeEname = row["OverseasConsigneeEname"].ToString();
}
if (row["DomesticConsigneeEname"] != null)
{
model.DomesticConsigneeEname = row["DomesticConsigneeEname"].ToString();
}
if (row["EdiRemark2"] != null)
{
model.EdiRemark2 = row["EdiRemark2"].ToString();
}
if (row["EdiRemark"] != null)
{
model.EdiRemark = row["EdiRemark"].ToString();
}
if (row["OwnerCodeScc"] != null)
{
model.OwnerCodeScc = row["OwnerCodeScc"].ToString();
}
if (row["OwnerCode"] != null)
{
model.OwnerCode = row["OwnerCode"].ToString();
}
if (row["OwnerCiqCode"] != null)
{
model.OwnerCiqCode = row["OwnerCiqCode"].ToString();
}
if (row["OwnerName"] != null)
{
model.OwnerName = row["OwnerName"].ToString();
}
if (row["AgentCodeScc"] != null)
{
model.AgentCodeScc = row["AgentCodeScc"].ToString();
}
if (row["AgentCode"] != null)
{
model.AgentCode = row["AgentCode"].ToString();
}
if (row["DeclCiqCode"] != null)
{
model.DeclCiqCode = row["DeclCiqCode"].ToString();
}
if (row["AgentName"] != null)
{
model.AgentName = row["AgentName"].ToString();
}
if (row["TrafMode"] != null)
{
model.TrafMode = row["TrafMode"].ToString();
}
if (row["TrafMode_Text"] != null)
{
model.TrafMode_Text = row["TrafMode_Text"].ToString();
}
if (row["TrafName"] != null)
{
model.TrafName = row["TrafName"].ToString();
}
if (row["NativeVoyageNo"] != null)
{
model.NativeVoyageNo = row["NativeVoyageNo"].ToString();
}
if (row["BillNo"] != null)
{
model.BillNo = row["BillNo"].ToString();
}
if (row["TradeMode"] != null)
{
model.TradeMode = row["TradeMode"].ToString();
}
if (row["TradeMode_Text"] != null)
{
model.TradeMode_Text = row["TradeMode_Text"].ToString();
}
if (row["CutMode"] != null)
{
model.CutMode = row["CutMode"].ToString();
}
if (row["CutMode_Text"] != null)
{
model.CutMode_Text = row["CutMode_Text"].ToString();
}
if (row["LicenseNo"] != null)
{
model.LicenseNo = row["LicenseNo"].ToString();
}
if (row["TradeCountry"] != null)
{
model.TradeCountry = row["TradeCountry"].ToString();
}
if (row["TradeCountry_Text"] != null)
{
model.TradeCountry_Text = row["TradeCountry_Text"].ToString();
}
if (row["DistinatePort"] != null)
{
model.DistinatePort = row["DistinatePort"].ToString();
}
if (row["DistinatePort_Text"] != null)
{
model.DistinatePort_Text = row["DistinatePort_Text"].ToString();
}
if (row["TransMode"] != null)
{
model.TransMode = row["TransMode"].ToString();
}
if (row["TransMode_Text"] != null)
{
model.TransMode_Text = row["TransMode_Text"].ToString();
}
if (row["FeeMark"] != null)
{
model.FeeMark = row["FeeMark"].ToString();
}
if (row["FeeRate"] != null && row["FeeRate"].ToString() != "")
{
model.FeeRate = decimal.Parse(row["FeeRate"].ToString());
}
if (row["FeeCurr"] != null)
{
model.FeeCurr = row["FeeCurr"].ToString();
}
if (row["FeeCurr_Text"] != null)
{
model.FeeCurr_Text = row["FeeCurr_Text"].ToString();
}
if (row["InsurMark"] != null)
{
model.InsurMark = row["InsurMark"].ToString();
}
if (row["InsurRate"] != null && row["InsurRate"].ToString() != "")
{
model.InsurRate = decimal.Parse(row["InsurRate"].ToString());
}
if (row["InsurCurr"] != null)
{
model.InsurCurr = row["InsurCurr"].ToString();
}
if (row["InsurCurr_Text"] != null)
{
model.InsurCurr_Text = row["InsurCurr_Text"].ToString();
}
if (row["OtherMark"] != null)
{
model.OtherMark = row["OtherMark"].ToString();
}
if (row["OtherRate"] != null && row["OtherRate"].ToString() != "")
{
model.OtherRate = decimal.Parse(row["OtherRate"].ToString());
}
if (row["OtherCurr"] != null)
{
model.OtherCurr = row["OtherCurr"].ToString();
}
if (row["OtherCurr_Text"] != null)
{
model.OtherCurr_Text = row["OtherCurr_Text"].ToString();
}
if (row["PackNo"] != null && row["PackNo"].ToString() != "")
{
model.PackNo = int.Parse(row["PackNo"].ToString());
}
if (row["WrapType"] != null)
{
model.WrapType = row["WrapType"].ToString();
}
if (row["WrapType_Text"] != null)
{
model.WrapType_Text = row["WrapType_Text"].ToString();
}
if (row["GrossWet"] != null && row["GrossWet"].ToString() != "")
{
model.GrossWet = decimal.Parse(row["GrossWet"].ToString());
}
if (row["NetWt"] != null && row["NetWt"].ToString() != "")
{
model.NetWt = decimal.Parse(row["NetWt"].ToString());
}
if (row["TradeAreaCode"] != null)
{
model.TradeAreaCode = row["TradeAreaCode"].ToString();
}
if (row["TradeAreaCode_Text"] != null)
{
model.TradeAreaCode_Text = row["TradeAreaCode_Text"].ToString();
}
if (row["ContaCount"] != null && row["ContaCount"].ToString() != "")
{
model.ContaCount = int.Parse(row["ContaCount"].ToString());
}
if (row["AttaDocuCdstr"] != null)
{
model.AttaDocuCdstr = row["AttaDocuCdstr"].ToString();
}
if (row["GoodsPlace"] != null)
{
model.GoodsPlace = row["GoodsPlace"].ToString();
}
if (row["DespPortCode"] != null)
{
model.DespPortCode = row["DespPortCode"].ToString();
}
if (row["DespPortCode_Text"] != null)
{
model.DespPortCode_Text = row["DespPortCode_Text"].ToString();
}
if (row["EntryType"] != null)
{
model.EntryType = row["EntryType"].ToString();
}
if (row["EntryType_Text"] != null)
{
model.EntryType_Text = row["EntryType_Text"].ToString();
}
if (row["NoteS"] != null)
{
model.NoteS = row["NoteS"].ToString();
}
if (row["MarkNo"] != null)
{
model.MarkNo = row["MarkNo"].ToString();
}
if (row["OrgCode"] != null)
{
model.OrgCode = row["OrgCode"].ToString();
}
if (row["OrgCode_Text"] != null)
{
model.OrgCode_Text = row["OrgCode_Text"].ToString();
}
if (row["VsaOrgCode"] != null)
{
model.VsaOrgCode = row["VsaOrgCode"].ToString();
}
if (row["VsaOrgCode_Text"] != null)
{
model.VsaOrgCode_Text = row["VsaOrgCode_Text"].ToString();
}
if (row["InspOrgCode"] != null)
{
model.InspOrgCode = row["InspOrgCode"].ToString();
}
if (row["InspOrgCode_Text"] != null)
{
model.InspOrgCode_Text = row["InspOrgCode_Text"].ToString();
}
if (row["PurpOrgCode"] != null)
{
model.PurpOrgCode = row["PurpOrgCode"].ToString();
}
if (row["PurpOrgCode_Text"] != null)
{
model.PurpOrgCode_Text = row["PurpOrgCode_Text"].ToString();
}
if (row["CorrelationNo"] != null)
{
model.CorrelationNo = row["CorrelationNo"].ToString();
}
if (row["CorrelationReasonFlag"] != null)
{
model.CorrelationReasonFlag = row["CorrelationReasonFlag"].ToString();
}
if (row["CorrelationReasonFlag_Text"] != null)
{
model.CorrelationReasonFlag_Text = row["CorrelationReasonFlag_Text"].ToString();
}
if (row["DespDate"] != null && row["DespDate"].ToString() != "")
{
model.DespDate = DateTime.Parse(row["DespDate"].ToString());
}
if (row["CmplDschrgDt"] != null && row["CmplDschrgDt"].ToString() != "")
{
model.CmplDschrgDt = DateTime.Parse(row["CmplDschrgDt"].ToString());
}
if (row["OrigBoxFlag"] != null)
{
model.OrigBoxFlag = row["OrigBoxFlag"].ToString();
}
if (row["SpecDeclFlag"] != null)
{
model.SpecDeclFlag = row["SpecDeclFlag"].ToString();
}
if (row["SpecDeclFlag_Text"] != null)
{
model.SpecDeclFlag_Text = row["SpecDeclFlag_Text"].ToString();
}
if (row["PromiseItmes"] != null)
{
model.PromiseItmes = row["PromiseItmes"].ToString();
}
if (row["DeclareName"] != null)
{
model.DeclareName = row["DeclareName"].ToString();
}
if (row["NoOtherPack"] != null)
{
model.NoOtherPack = row["NoOtherPack"].ToString();
}
if (row["Insp_cert"] != null)
{
model.Insp_cert = row["Insp_cert"].ToString();
}
if (row["BillState"] != null)
{
model.BillState = row["BillState"].ToString();
}
if (row["ApplyType"] != null && row["ApplyType"].ToString() != "")
{
model.ApplyType = int.Parse(row["ApplyType"].ToString());
}
//if (row["ApplyType_Text"] != null)
//{
// model.ApplyType_Text = row["ApplyType_Text"].ToString();
//}
}
headList.Add(model);
}
row.Close();
}
return headList;
#endregion
}
/// <summary>
/// 执行sql
/// </summary>
/// <param name="strSql"></param>
/// <returns></returns>
private static List<AuditDecHead> SetSingleAuditListData(StringBuilder strSql)
{
#region 公共代码
var headList = new List<AuditDecHead>();
Database db = DatabaseFactory.CreateDatabase();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = strSql.ToString();
cmd.CommandTimeout = 120000; //要加这一句
using (IDataReader row = db.ExecuteReader(cmd))
{
while (row.Read())
{
AuditDecHead model = new AuditDecHead();
if (row != null)
{
if (row["GID"] != null)
{
model.GID = row["GID"].ToString();
}
if (row["BSNO"] != null)
{
model.BSNO = row["BSNO"].ToString();
}
if (row["IEFlag"] != null)
{
model.IEFlag = row["IEFlag"].ToString();
}
if (row["Type"] != null)
{
model.Type = row["Type"].ToString();
}
if (row["EdiId"] != null)
{
model.EdiId = row["EdiId"].ToString();
}
if (row["Risk"] != null)
{
model.Risk = row["Risk"].ToString();
}
if (row["CopCode"] != null)
{
model.CopCode = row["CopCode"].ToString();
}
if (row["CopName"] != null)
{
model.CopName = row["CopName"].ToString();
}
if (row["PDate"] != null && row["PDate"].ToString() != "")
{
model.PDate = DateTime.Parse(row["PDate"].ToString());
}
if (row["TypistNo"] != null)
{
model.TypistNo = row["TypistNo"].ToString();
}
if (row["InputerName"] != null)
{
model.InputerName = row["InputerName"].ToString();
}
if (row["PartenerID"] != null)
{
model.PartenerID = row["PartenerID"].ToString();
}
if (row["TgdNo"] != null)
{
model.TgdNo = row["TgdNo"].ToString();
}
if (row["DataSource"] != null)
{
model.DataSource = row["DataSource"].ToString();
}
if (row["DeclTrnRel"] != null)
{
model.DeclTrnRel = row["DeclTrnRel"].ToString();
}
if (row["ChkSurety"] != null)
{
model.ChkSurety = row["ChkSurety"].ToString();
}
if (row["CopCodeScc"] != null)
{
model.CopCodeScc = row["CopCodeScc"].ToString();
}
if (row["CheckFlow"] != null)
{
model.CheckFlow = row["CheckFlow"].ToString();
}
if (row["TaxAaminMark"] != null)
{
model.TaxAaminMark = row["TaxAaminMark"].ToString();
}
if (row["EntyPortCode"] != null)
{
model.EntyPortCode = row["EntyPortCode"].ToString();
}
if (row["BLNo"] != null)
{
model.BLNo = row["BLNo"].ToString();
}
if (row["BillType"] != null)
{
model.BillType = row["BillType"].ToString();
}
if (row["ApprNo"] != null)
{
model.ApprNo = row["ApprNo"].ToString();
}
if (row["CustomMaster"] != null)
{
model.CustomMaster = row["CustomMaster"].ToString();
}
if (row["CustomMaster_Text"] != null)
{
model.CustomMaster_Text = row["CustomMaster_Text"].ToString();
}
if (row["AgentStatus"] != null)
{
model.AgentStatus = row["AgentStatus"].ToString();
}
if (row["SeqNo"] != null)
{
model.SeqNo = row["SeqNo"].ToString();
}
if (row["PreEntryId"] != null)
{
model.PreEntryId = row["PreEntryId"].ToString();
}
if (row["EntryId"] != null)
{
model.EntryId = row["EntryId"].ToString();
}
if (row["IEPort"] != null)
{
model.IEPort = row["IEPort"].ToString();
}
if (row["IEPort_Text"] != null)
{
model.IEPort_Text = row["IEPort_Text"].ToString();
}
if (row["ManualNo"] != null)
{
model.ManualNo = row["ManualNo"].ToString();
}
if (row["ContrNo"] != null)
{
model.ContrNo = row["ContrNo"].ToString();
}
if (row["IEDate"] != null && row["IEDate"].ToString() != "")
{
model.IEDate = DateTime.Parse(row["IEDate"].ToString());
}
if (row["DDate"] != null && row["DDate"].ToString() != "")
{
model.DDate = DateTime.Parse(row["DDate"].ToString());
}
if (row["TradeCoScc"] != null)
{
model.TradeCoScc = row["TradeCoScc"].ToString();
}
if (row["TradeCode"] != null)
{
model.TradeCode = row["TradeCode"].ToString();
}
if (row["TradeCiqCode"] != null)
{
model.TradeCiqCode = row["TradeCiqCode"].ToString();
}
if (row["TradeName"] != null)
{
model.TradeName = row["TradeName"].ToString();
}
if (row["OverseasConsignorCode"] != null)
{
model.OverseasConsignorCode = row["OverseasConsignorCode"].ToString();
}
if (row["OverseasConsignorCname"] != null)
{
model.OverseasConsignorCname = row["OverseasConsignorCname"].ToString();
}
if (row["OverseasConsignorEname"] != null)
{
model.OverseasConsignorEname = row["OverseasConsignorEname"].ToString();
}
if (row["OverseasConsignorAddr"] != null)
{
model.OverseasConsignorAddr = row["OverseasConsignorAddr"].ToString();
}
if (row["OverseasConsigneeCode"] != null)
{
model.OverseasConsigneeCode = row["OverseasConsigneeCode"].ToString();
}
if (row["OverseasConsigneeEname"] != null)
{
model.OverseasConsigneeEname = row["OverseasConsigneeEname"].ToString();
}
if (row["DomesticConsigneeEname"] != null)
{
model.DomesticConsigneeEname = row["DomesticConsigneeEname"].ToString();
}
if (row["EdiRemark2"] != null)
{
model.EdiRemark2 = row["EdiRemark2"].ToString();
}
if (row["EdiRemark"] != null)
{
model.EdiRemark = row["EdiRemark"].ToString();
}
if (row["OwnerCodeScc"] != null)
{
model.OwnerCodeScc = row["OwnerCodeScc"].ToString();
}
if (row["OwnerCode"] != null)
{
model.OwnerCode = row["OwnerCode"].ToString();
}
if (row["OwnerCiqCode"] != null)
{
model.OwnerCiqCode = row["OwnerCiqCode"].ToString();
}
if (row["OwnerName"] != null)
{
model.OwnerName = row["OwnerName"].ToString();
}
if (row["AgentCodeScc"] != null)
{
model.AgentCodeScc = row["AgentCodeScc"].ToString();
}
if (row["AgentCode"] != null)
{
model.AgentCode = row["AgentCode"].ToString();
}
if (row["DeclCiqCode"] != null)
{
model.DeclCiqCode = row["DeclCiqCode"].ToString();
}
if (row["AgentName"] != null)
{
model.AgentName = row["AgentName"].ToString();
}
if (row["TrafMode"] != null)
{
model.TrafMode = row["TrafMode"].ToString();
}
if (row["TrafMode_Text"] != null)
{
model.TrafMode_Text = row["TrafMode_Text"].ToString();
}
if (row["TrafName"] != null)
{
model.TrafName = row["TrafName"].ToString();
}
if (row["NativeVoyageNo"] != null)
{
model.NativeVoyageNo = row["NativeVoyageNo"].ToString();
}
if (row["BillNo"] != null)
{
model.BillNo = row["BillNo"].ToString();
}
if (row["TradeMode"] != null)
{
model.TradeMode = row["TradeMode"].ToString();
}
if (row["TradeMode_Text"] != null)
{
model.TradeMode_Text = row["TradeMode_Text"].ToString();
}
if (row["CutMode"] != null)
{
model.CutMode = row["CutMode"].ToString();
}
if (row["CutMode_Text"] != null)
{
model.CutMode_Text = row["CutMode_Text"].ToString();
}
if (row["LicenseNo"] != null)
{
model.LicenseNo = row["LicenseNo"].ToString();
}
if (row["TradeCountry"] != null)
{
model.TradeCountry = row["TradeCountry"].ToString();
}
if (row["TradeCountry_Text"] != null)
{
model.TradeCountry_Text = row["TradeCountry_Text"].ToString();
}
if (row["DistinatePort"] != null)
{
model.DistinatePort = row["DistinatePort"].ToString();
}
if (row["DistinatePort_Text"] != null)
{
model.DistinatePort_Text = row["DistinatePort_Text"].ToString();
}
if (row["TransMode"] != null)
{
model.TransMode = row["TransMode"].ToString();
}
if (row["TransMode_Text"] != null)
{
model.TransMode_Text = row["TransMode_Text"].ToString();
}
if (row["FeeMark"] != null)
{
model.FeeMark = row["FeeMark"].ToString();
}
if (row["FeeRate"] != null && row["FeeRate"].ToString() != "")
{
model.FeeRate = decimal.Parse(row["FeeRate"].ToString());
}
if (row["FeeCurr"] != null)
{
model.FeeCurr = row["FeeCurr"].ToString();
}
if (row["FeeCurr_Text"] != null)
{
model.FeeCurr_Text = row["FeeCurr_Text"].ToString();
}
if (row["InsurMark"] != null)
{
model.InsurMark = row["InsurMark"].ToString();
}
if (row["InsurRate"] != null && row["InsurRate"].ToString() != "")
{
model.InsurRate = decimal.Parse(row["InsurRate"].ToString());
}
if (row["InsurCurr"] != null)
{
model.InsurCurr = row["InsurCurr"].ToString();
}
if (row["InsurCurr_Text"] != null)
{
model.InsurCurr_Text = row["InsurCurr_Text"].ToString();
}
if (row["OtherMark"] != null)
{
model.OtherMark = row["OtherMark"].ToString();
}
if (row["OtherRate"] != null && row["OtherRate"].ToString() != "")
{
model.OtherRate = decimal.Parse(row["OtherRate"].ToString());
}
if (row["OtherCurr"] != null)
{
model.OtherCurr = row["OtherCurr"].ToString();
}
if (row["OtherCurr_Text"] != null)
{
model.OtherCurr_Text = row["OtherCurr_Text"].ToString();
}
if (row["PackNo"] != null && row["PackNo"].ToString() != "")
{
model.PackNo = int.Parse(row["PackNo"].ToString());
}
if (row["WrapType"] != null)
{
model.WrapType = row["WrapType"].ToString();
}
if (row["WrapType_Text"] != null)
{
model.WrapType_Text = row["WrapType_Text"].ToString();
}
if (row["GrossWet"] != null && row["GrossWet"].ToString() != "")
{
model.GrossWet = decimal.Parse(row["GrossWet"].ToString());
}
if (row["NetWt"] != null && row["NetWt"].ToString() != "")
{
model.NetWt = decimal.Parse(row["NetWt"].ToString());
}
if (row["TradeAreaCode"] != null)
{
model.TradeAreaCode = row["TradeAreaCode"].ToString();
}
if (row["TradeAreaCode_Text"] != null)
{
model.TradeAreaCode_Text = row["TradeAreaCode_Text"].ToString();
}
if (row["ContaCount"] != null && row["ContaCount"].ToString() != "")
{
model.ContaCount = int.Parse(row["ContaCount"].ToString());
}
if (row["AttaDocuCdstr"] != null)
{
model.AttaDocuCdstr = row["AttaDocuCdstr"].ToString();
}
if (row["GoodsPlace"] != null)
{
model.GoodsPlace = row["GoodsPlace"].ToString();
}
if (row["DespPortCode"] != null)
{
model.DespPortCode = row["DespPortCode"].ToString();
}
if (row["DespPortCode_Text"] != null)
{
model.DespPortCode_Text = row["DespPortCode_Text"].ToString();
}
if (row["EntryType"] != null)
{
model.EntryType = row["EntryType"].ToString();
}
if (row["EntryType_Text"] != null)
{
model.EntryType_Text = row["EntryType_Text"].ToString();
}
if (row["NoteS"] != null)
{
model.NoteS = row["NoteS"].ToString();
}
if (row["MarkNo"] != null)
{
model.MarkNo = row["MarkNo"].ToString();
}
if (row["OrgCode"] != null)
{
model.OrgCode = row["OrgCode"].ToString();
}
if (row["OrgCode_Text"] != null)
{
model.OrgCode_Text = row["OrgCode_Text"].ToString();
}
if (row["VsaOrgCode"] != null)
{
model.VsaOrgCode = row["VsaOrgCode"].ToString();
}
if (row["VsaOrgCode_Text"] != null)
{
model.VsaOrgCode_Text = row["VsaOrgCode_Text"].ToString();
}
if (row["InspOrgCode"] != null)
{
model.InspOrgCode = row["InspOrgCode"].ToString();
}
if (row["InspOrgCode_Text"] != null)
{
model.InspOrgCode_Text = row["InspOrgCode_Text"].ToString();
}
if (row["PurpOrgCode"] != null)
{
model.PurpOrgCode = row["PurpOrgCode"].ToString();
}
if (row["PurpOrgCode_Text"] != null)
{
model.PurpOrgCode_Text = row["PurpOrgCode_Text"].ToString();
}
if (row["CorrelationNo"] != null)
{
model.CorrelationNo = row["CorrelationNo"].ToString();
}
if (row["CorrelationReasonFlag"] != null)
{
model.CorrelationReasonFlag = row["CorrelationReasonFlag"].ToString();
}
if (row["CorrelationReasonFlag_Text"] != null)
{
model.CorrelationReasonFlag_Text = row["CorrelationReasonFlag_Text"].ToString();
}
if (row["DespDate"] != null && row["DespDate"].ToString() != "")
{
model.DespDate = DateTime.Parse(row["DespDate"].ToString());
}
if (row["CmplDschrgDt"] != null && row["CmplDschrgDt"].ToString() != "")
{
model.CmplDschrgDt = DateTime.Parse(row["CmplDschrgDt"].ToString());
}
if (row["OrigBoxFlag"] != null)
{
model.OrigBoxFlag = row["OrigBoxFlag"].ToString();
}
if (row["SpecDeclFlag"] != null)
{
model.SpecDeclFlag = row["SpecDeclFlag"].ToString();
}
if (row["SpecDeclFlag_Text"] != null)
{
model.SpecDeclFlag_Text = row["SpecDeclFlag_Text"].ToString();
}
if (row["PromiseItmes"] != null)
{
model.PromiseItmes = row["PromiseItmes"].ToString();
}
if (row["DeclareName"] != null)
{
model.DeclareName = row["DeclareName"].ToString();
}
if (row["NoOtherPack"] != null)
{
model.NoOtherPack = row["NoOtherPack"].ToString();
}
if (row["Insp_cert"] != null)
{
model.Insp_cert = row["Insp_cert"].ToString();
}
if (row["BillState"] != null)
{
model.BillState = row["BillState"].ToString();
}
if (row["CUSTNO"] != null)
{
model.CUSTNO = row["CUSTNO"].ToString();
}
if (row["CUSTOMNO"] != null)
{
model.CUSTOMNO = row["CUSTOMNO"].ToString();
}
if (row["MBLNO"] != null)
{
model.MBLNO = row["MBLNO"].ToString();
}
if (row["CUSTOMERNAME"] != null)
{
model.CUSTOMERNAME = row["CUSTOMERNAME"].ToString();
}
if (row["VESSEL"] != null)
{
model.VESSEL = row["VESSEL"].ToString();
}
if (row["VOYNO"] != null)
{
model.VOYNO = row["VOYNO"].ToString();
}
if (row["ETD"] != null)
{
model.ETD = row["ETD"].ToString();
}
if (row["ETA"] != null)
{
model.ETA = row["ETA"].ToString();
}
if (row["COMPOP"] != null)
{
model.COMPOP = row["COMPOP"].ToString();
}
if (row["COMPTIME"] != null)
{
model.COMPTIME = Convert.ToDateTime(row["COMPTIME"]).ToString("yyyy-MM-dd hh:mm:ss");
}
}
headList.Add(model);
}
row.Close();
}
return headList;
#endregion
}
}
}