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.

2008 lines
130 KiB
C#

9 months ago
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DSWeb.DataAccess;
using DSWeb.Models;
using System.Data.SqlClient;
using System.Collections.Generic;
namespace DSWeb.EntityDA
{
public class SeaExportInfoDA
{
private const string PARM_MODULE_GID = "@BSNO";
private const string PARM_SEAE_BSNO = "@bsno";
private const string SQL_SELECT_INFO = "select BSNO,MASTERNO,BSSTATUS,FEESTATUS,BSDATE,ACCDATE,MBLNO,HBLNO,CUSTNO,TRANSNO,CUSTOMERNAME,BLTYPE,SHIPPERID,CONSIGNEEID,NOTIFYPARTYID,SHIPPER,CONSIGNEE,NOTIFYPARTY,AGENTID,AGENT,YARD,VESSEL,VOYNO,ETD,CLOSINGDATE,ETA,PlACERECEIPT,PORTLOADID,PORTLOAD,PORTDISCHARGEID,PORTDISCHARGE,PLACEDELIVERYID,PLACEDELIVERY,DESTINATIONID,DESTINATION,NOBILL,ISSUETYPE,ISSUEDATE,ISSUEPLACE,BLFRT,PREPARDAT,PAYABLEAT,SERVICE,MARKS,CNTRSEALNO,NOPKGS,DESCRIPTION,GOODSNAME,GROSSWEIGHT,MEASUREMENT,PKGS,KINDPKGS,KGS,CBM,TOTALNO,CNTRNO,CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INPUTBY,OP,CUSTSERVICE,LANE,SALE,CARRIER,FORWARDER,CUSTOMSER,TRUCKER,INVNO,CARGOID,DCLASS,DUNNO,REEFERF,TEMPID,TEMPSET,TEMPMAX,TEMPMIN,BSSOURCE,BSSOURCEDETAIL,CUSTOMSNUM,CONTRACTNO,ORDTYPE,ORDERNO,INSURANCEER,INSURANCENO,INAMOUT,ISVOU,VOUNO,REMARK,STATUS1,STATUS2,STATUS3,STATUS4,STATUS5,ISFUMIGATION,ISSTORAGE,ISLAND,ISCUSTOMS,ISINSPECTION,ISBOOKING,ISAGENT,ISHBLNO,SERVICE9,SERVICE10,DOC,PACKINGTYPE,WAREHOUSE,CLOSEDOCDATE,INTOPORTDATE,CORPID,SALEDEPT,MBLFRT,CREATETIME,STLNAME,STLDATE,ORDERTYPE,OPERATORCODE,OPERATOR,OPERATOREMAIL,OPERATORTEL,OPERATORFAX,FINANCIALSTAFFCODE,FINANCIALSTAFF,FINANCIALSTAFFEMAIL,FINANCIALSTAFFTEL,FINANCIALSTAFFFAX,PlACERECEIPTID,SOURCECODE,ISCONTAINERSOC,DPAGE,DLABEL,LINKMAN,VESSELID,ISSUEPLACEID from op_seae where BSNO=@BSNO";
private const string SQL_DELETE_INFO = "DELETE FROM op_seae WHERE BSNO = @bsno";
private string strSql = "insert into op_seae(BSNO,MASTERNO,BSSTATUS,FEESTATUS,BSDATE,ACCDATE,MBLNO,HBLNO,CUSTNO,TRANSNO,CUSTOMERNAME,BLTYPE,SHIPPERID,"
+ " CONSIGNEEID,NOTIFYPARTYID,SHIPPER,CONSIGNEE,NOTIFYPARTY,AGENTID,AGENT,YARD,VESSEL,VOYNO,{0}{10}{4}PlACERECEIPT,PORTLOADID,PORTLOAD,PORTDISCHARGEID,PORTDISCHARGE,"
+ " PLACEDELIVERYID,PLACEDELIVERY,DESTINATIONID,DESTINATION,NOBILL,ISSUETYPE,{6}ISSUEPLACE,BLFRT,PREPARDAT,PAYABLEAT,SERVICE,MARKS,CNTRSEALNO,NOPKGS,DESCRIPTION,GOODSNAME,"
+ " GROSSWEIGHT,MEASUREMENT,PKGS,KINDPKGS,KGS,CBM,TOTALNO,CNTRNO,CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INPUTBY,OP,CUSTSERVICE,LANE,SALE,"
+ " CARRIER,FORWARDER,CUSTOMSER,TRUCKER,INVNO,CARGOID,DCLASS,DUNNO,REEFERF,TEMPID,TEMPSET,TEMPMAX,TEMPMIN,BSSOURCE,BSSOURCEDETAIL,CUSTOMSNUM,CONTRACTNO,ORDTYPE,ORDERNO,INSURANCEER,"
+ " INSURANCENO,INAMOUT,ISVOU,VOUNO,REMARK,STATUS1,STATUS2,STATUS3,STATUS4,STATUS5,ISFUMIGATION,ISSTORAGE,ISLAND,"
+ " ISCUSTOMS,ISINSPECTION,ISBOOKING,ISAGENT,ISHBLNO,SERVICE9,SERVICE10,DOC,PACKINGTYPE,WAREHOUSE,{8}{2}CORPID,SALEDEPT,MBLFRT,{12}STLNAME,ORDERTYPE,CREATETIME,OPERATORCODE,OPERATOR,OPERATOREMAIL,OPERATORTEL,OPERATORFAX,FINANCIALSTAFFCODE,FINANCIALSTAFF,FINANCIALSTAFFEMAIL,FINANCIALSTAFFTEL,FINANCIALSTAFFFAX,PlACERECEIPTID,SOURCECODE,ISCONTAINERSOC,DPAGE,DLABEL,LINKMAN,VESSELID,ISSUEPLACEID) "
+ " values(@BSNO,@MASTERNO,@BSSTATUS,@FEESTATUS,GETDATE(),@ACCDATE,@MBLNO,@HBLNO,@CUSTNO,@TRANSNO,@CUSTOMERNAME,@BLTYPE,@SHIPPERID,@CONSIGNEEID,@NOTIFYPARTYID,@SHIPPER,@CONSIGNEE,"
+ " @NOTIFYPARTY,@AGENTID,@AGENT,@YARD,@VESSEL,@VOYNO,{1}{11}{5}@PlACERECEIPT,@PORTLOADID,@PORTLOAD,@PORTDISCHARGEID,@PORTDISCHARGE,@PLACEDELIVERYID,@PLACEDELIVERY,"
+ " @DESTINATIONID,@DESTINATION,@NOBILL,@ISSUETYPE,{7}@ISSUEPLACE,@BLFRT,@PREPARDAT,@PAYABLEAT,@SERVICE,@MARKS,@CNTRSEALNO,@NOPKGS,@DESCRIPTION,@GOODSNAME,@GROSSWEIGHT,"
+ " @MEASUREMENT,@PKGS,@KINDPKGS,@KGS,@CBM,@TOTALNO,@CNTRNO,@CNTR1,@CNTR2,@CNTR3,@CNTR4,@CNTR5,@CNTR6,@CNTR7,@CNTR8,@CNTR9,@CNTR10,@OTCNTR,@TEU,@CNTRTOTAL,@INPUTBY,@OP,@CUSTSERVICE,"
+ " @LANE,@SALE,@CARRIER,@FORWARDER,@CUSTOMSER,@TRUCKER,@INVNO,@CARGOID,@DCLASS,@DUNNO,@REEFERF,@TEMPID,@TEMPSET,@TEMPMAX,@TEMPMIN,@BSSOURCE,@BSSOURCEDETAIL,@CUSTOMSNUM,@CONTRACTNO,"
+ " @ORDTYPE,@ORDERNO,@INSURANCEER,@INSURANCENO,@INAMOUT,@ISVOU,@VOUNO,@REMARK,@STATUS1,@STATUS2,@STATUS3,@STATUS4,@STATUS5,@ISFUMIGATION,@ISSTORAGE,@ISLAND,@ISCUSTOMS,@ISINSPECTION,@ISBOOKING,@ISAGENT,@ISHBLNO,@SERVICE9,@SERVICE10,@DOC,"
+ " @PACKINGTYPE,@WAREHOUSE,{9}{3}@CORPID,@SALEDEPT,@MBLFRT,{13}@STLNAME,@ORDERTYPE,GETDATE(),@OPERATORCODE,@OPERATOR,@OPERATOREMAIL,@OPERATORTEL,@OPERATORFAX,@FINANCIALSTAFFCODE,@FINANCIALSTAFF,@FINANCIALSTAFFEMAIL,@FINANCIALSTAFFTEL,@FINANCIALSTAFFFAX,@PlACERECEIPTID,@SOURCECODE,@ISCONTAINERSOC,@DPAGE,@DLABEL,@LINKMAN,@VESSELID,@ISSUEPLACEID)";//@BSDATE
private string strSqlUpdateInfo = "update op_seae set MBLNO=@MBLNO,HBLNO=@HBLNO,CUSTNO=@CUSTNO,TRANSNO=@TRANSNO,CUSTOMERNAME=@CUSTOMERNAME,SHIPPERID=@SHIPPERID,CONSIGNEEID=@CONSIGNEEID,NOTIFYPARTYID=@NOTIFYPARTYID,SHIPPER=@SHIPPER,CONSIGNEE=@CONSIGNEE,NOTIFYPARTY=@NOTIFYPARTY,AGENTID=@AGENTID,AGENT=@AGENT,YARD=@YARD,VESSEL=@VESSEL,VOYNO=@VOYNO,{2}{3}{4}{5}{0}{1}PlACERECEIPT=@PlACERECEIPT,PORTLOADID=@PORTLOADID,PORTLOAD=@PORTLOAD,PORTDISCHARGEID=@PORTDISCHARGEID,PORTDISCHARGE=@PORTDISCHARGE,PLACEDELIVERYID=@PLACEDELIVERYID,PLACEDELIVERY=@PLACEDELIVERY,DESTINATIONID=@DESTINATIONID,DESTINATION=@DESTINATION,NOBILL=@NOBILL,ISSUETYPE=@ISSUETYPE,{6}{7}ISSUEPLACE=@ISSUEPLACE,BLFRT=@BLFRT,PREPARDAT=@PREPARDAT,PAYABLEAT=@PAYABLEAT,SERVICE=@SERVICE,MARKS=@MARKS,CNTRSEALNO=@CNTRSEALNO,NOPKGS=@NOPKGS,DESCRIPTION=@DESCRIPTION,GOODSNAME=@GOODSNAME,GROSSWEIGHT=@GROSSWEIGHT,MEASUREMENT=@MEASUREMENT,PKGS=@PKGS,KINDPKGS=@KINDPKGS,KGS=@KGS,CBM=@CBM,TOTALNO=@TOTALNO,CNTRNO=@CNTRNO,CNTR1=@CNTR1,CNTR2=@CNTR2,CNTR3=@CNTR3,CNTR4=@CNTR4,CNTR5=@CNTR5,CNTR6=@CNTR6,CNTR7=@CNTR7,CNTR8=@CNTR8,CNTR9=@CNTR9,CNTR10=@CNTR10,OTCNTR=@OTCNTR,TEU=@TEU,CNTRTOTAL=@CNTRTOTAL,OP=@OP,CUSTSERVICE=@CUSTSERVICE,LANE=@LANE,SALE=@SALE,CARRIER=@CARRIER,FORWARDER=@FORWARDER,CUSTOMSER=@CUSTOMSER,TRUCKER=@TRUCKER,INVNO=@INVNO,CARGOID=@CARGOID,DCLASS=@DCLASS,DUNNO=@DUNNO,REEFERF=@REEFERF,TEMPID=@TEMPID,TEMPSET=@TEMPSET,TEMPMAX=@TEMPMAX,TEMPMIN=@TEMPMIN,BSSOURCE=@BSSOURCE,BSSOURCEDETAIL=@BSSOURCEDETAIL,CUSTOMSNUM=@CUSTOMSNUM,CONTRACTNO=@CONTRACTNO,ORDTYPE=@ORDTYPE,ORDERNO=@ORDERNO,INSURANCEER=@INSURANCEER,INSURANCENO=@INSURANCENO,INAMOUT=@INAMOUT,ISVOU=@ISVOU,VOUNO=@VOUNO,REMARK=@REMARK,STATUS1=@STATUS1,STATUS2=@STATUS2,STATUS3=@STATUS3,STATUS4=@STATUS4,STATUS5=@STATUS5,ISFUMIGATION=@ISFUMIGATION,ISSTORAGE=@ISSTORAGE,ISLAND=@ISLAND,ISCUSTOMS=@ISCUSTOMS,ISINSPECTION=@ISINSPECTION,ISBOOKING=@ISBOOKING,ISAGENT=@ISAGENT,ISHBLNO=@ISHBLNO,SERVICE9=@SERVICE9,SERVICE10=@SERVICE10,DOC=@DOC,PACKINGTYPE=@PACKINGTYPE,WAREHOUSE=@WAREHOUSE,{8}{9}{10}{11}CORPID=@CORPID,SALEDEPT=@SALEDEPT,MBLFRT=@MBLFRT,{12}{13}STLNAME=@STLNAME,OPERATORCODE=@OPERATORCODE,OPERATOR=@OPERATOR,OPERATOREMAIL=@OPERATOREMAIL,OPERATORTEL=@OPERATORTEL,OPERATORFAX=@OPERATORFAX,FINANCIALSTAFFCODE=@FINANCIALSTAFFCODE,FINANCIALSTAFF=@FINANCIALSTAFF,FINANCIALSTAFFEMAIL=@FINANCIALSTAFFEMAIL,FINANCIALSTAFFTEL=@FINANCIALSTAFFTEL,FINANCIALSTAFFFAX=@FINANCIALSTAFFFAX,PlACERECEIPTID=@PlACERECEIPTID,BLTYPE=@BLTYPE,SOURCECODE=@SOURCECODE,ISCONTAINERSOC=@ISCONTAINERSOC,DPAGE=@DPAGE,DLABEL=@DLABEL,LINKMAN=@LINKMAN,VESSELID=@VESSELID,ISSUEPLACEID=@ISSUEPLACEID,ACCDATE=@ACCDATE where BSNO=@BSNO";
private string strSqlUpdateInfoEDI = "update op_seae set MBLNO=@MBLNO,SHIPPERID=@SHIPPERID,CONSIGNEEID=@CONSIGNEEID,NOTIFYPARTYID=@NOTIFYPARTYID,SHIPPER=@SHIPPER,CONSIGNEE=@CONSIGNEE,NOTIFYPARTY=@NOTIFYPARTY,VESSEL=@VESSEL,VOYNO=@VOYNO,PORTLOADID=@PORTLOADID,PORTLOAD=@PORTLOAD,PORTDISCHARGEID=@PORTDISCHARGEID,PORTDISCHARGE=@PORTDISCHARGE,PLACEDELIVERYID=@PLACEDELIVERYID,PLACEDELIVERY=@PLACEDELIVERY,DESTINATIONID=@DESTINATIONID,DESTINATION=@DESTINATION,NOBILL=@NOBILL,ISSUEPLACE=@ISSUEPLACE,BLFRT=@BLFRT,PREPARDAT=@PREPARDAT,PAYABLEAT=@PAYABLEAT,SERVICE=@SERVICE,MARKS=@MARKS,NOPKGS=@NOPKGS,DESCRIPTION=@DESCRIPTION,GROSSWEIGHT=@GROSSWEIGHT,MEASUREMENT=@MEASUREMENT,PKGS=@PKGS,KINDPKGS=@KINDPKGS,KGS=@KGS,CBM=@CBM,TOTALNO=@TOTALNO,CNTRNO=@CNTRNO,CNTR1=@CNTR1,CNTR2=@CNTR2,CNTR3=@CNTR3,CNTR4=@CNTR4,CNTR5=@CNTR5,CNTR6=@CNTR6,CNTR7=@CNTR7,CNTR8=@CNTR8,CNTR9=@CNTR9,CNTR10=@CNTR10,OTCNTR=@OTCNTR,TEU=@TEU,CNTRTOTAL=@CNTRTOTAL,CARGOID=@CARGOID,DCLASS=@DCLASS,TEMPID=@TEMPID,TEMPSET=@TEMPSET,ORDERNO=@ORDERNO,BLTYPE=@BLTYPE,INPUTBY=@INPUTBY{0}{1} where BSNO=@BSNO";
private const string SQL_UPDATE_OP_SEAE_FEE_LOCK = " UPDATE op_seae SET FEESTATUS = 1 WHERE BSNO = @bsno ";
private const string SQL_UPDATE_OP_SEAE_FEE_UNLOCK = " UPDATE op_seae SET FEESTATUS = 0 WHERE BSNO = @bsno ";
public SeaExportInfoDA()
{
}
#region 根据GID获取信息
/// <summary>
/// 根据GID获取委托op_seae信息
/// </summary>
/// <param name="strRoleGID"></param>
/// <returns></returns>
public TopSeaeEntity GetID(string strGID)
{
//初始化返回变量
TopSeaeEntity TopSeaeEntity = null;
//初始化参数并赋值
SqlParameter parm = new SqlParameter(PARM_MODULE_GID, SqlDbType.VarChar, 100);
parm.Value = strGID;
using (SqlDataReader sqlRead = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_SELECT_INFO, parm))
{
try
{
TopSeaeEntity = new TopSeaeEntity();
//读取字段值
while (sqlRead.Read())
{
if (!sqlRead.IsDBNull(0)) { TopSeaeEntity.BSNO = sqlRead.GetString(0); } //业务编号
if (!sqlRead.IsDBNull(1)) { TopSeaeEntity.MASTERNO = sqlRead.GetString(1); } //主编号
if (!sqlRead.IsDBNull(2)) { TopSeaeEntity.BSSTATUS = sqlRead.GetBoolean(2); } //业务状态
if (!sqlRead.IsDBNull(3)) { TopSeaeEntity.FEESTATUS = sqlRead.GetBoolean(3); } //费用状态
if (!sqlRead.IsDBNull(4)) { TopSeaeEntity.BSDATE = sqlRead.GetDateTime(4); } //录入日期
if (!sqlRead.IsDBNull(5)) { TopSeaeEntity.ACCDATE = sqlRead.GetString(5); } //会计期间
if (!sqlRead.IsDBNull(6)) { TopSeaeEntity.MBLNO = sqlRead.GetString(6); } //主提单号
if (!sqlRead.IsDBNull(7)) { TopSeaeEntity.HBLNO = sqlRead.GetString(7); } //分提单号
if (!sqlRead.IsDBNull(8)) { TopSeaeEntity.CUSTNO = sqlRead.GetString(8); } //委托编号
if (!sqlRead.IsDBNull(9)) { TopSeaeEntity.TRANSNO = sqlRead.GetString(9); } //运单号
if (!sqlRead.IsDBNull(10)) { TopSeaeEntity.CUSTOMERNAME = sqlRead.GetString(10); } //委托单位
if (!sqlRead.IsDBNull(11)) { TopSeaeEntity.BLTYPE = sqlRead.GetString(11); } //装运方式
if (!sqlRead.IsDBNull(12)) { TopSeaeEntity.SHIPPERID = sqlRead.GetString(12); } //发货人
if (!sqlRead.IsDBNull(13)) { TopSeaeEntity.CONSIGNEEID = sqlRead.GetString(13); } //收货人
if (!sqlRead.IsDBNull(14)) { TopSeaeEntity.NOTIFYPARTYID = sqlRead.GetString(14); } //通知人
if (!sqlRead.IsDBNull(15)) { TopSeaeEntity.SHIPPER = sqlRead.GetString(15); } //发货人内容
if (!sqlRead.IsDBNull(16)) { TopSeaeEntity.CONSIGNEE = sqlRead.GetString(16); } //收货人内容
if (!sqlRead.IsDBNull(17)) { TopSeaeEntity.NOTIFYPARTY = sqlRead.GetString(17); } //通知人内容
if (!sqlRead.IsDBNull(18)) { TopSeaeEntity.AGENTID = sqlRead.GetString(18); } //国外代理
if (!sqlRead.IsDBNull(19)) { TopSeaeEntity.AGENT = sqlRead.GetString(19); } //国外代理内容
if (!sqlRead.IsDBNull(20)) { TopSeaeEntity.YARD = sqlRead.GetString(20); } //场站
if (!sqlRead.IsDBNull(21)) { TopSeaeEntity.VESSEL = sqlRead.GetString(21); } //船名
if (!sqlRead.IsDBNull(22)) { TopSeaeEntity.VOYNO = sqlRead.GetString(22); } //航次
if (!sqlRead.IsDBNull(23)) { TopSeaeEntity.ETD = sqlRead.GetDateTime(23); } //开船日期
if (!sqlRead.IsDBNull(24)) { TopSeaeEntity.CLOSINGDATE = sqlRead.GetDateTime(24); } //截港日期
if (!sqlRead.IsDBNull(25)) { TopSeaeEntity.ETA = sqlRead.GetDateTime(25); } //预抵日期
if (!sqlRead.IsDBNull(26)) { TopSeaeEntity.PlACERECEIPT = sqlRead.GetString(26); } //收货地
if (!sqlRead.IsDBNull(27)) { TopSeaeEntity.PORTLOADID = sqlRead.GetString(27); } //装货港代码
if (!sqlRead.IsDBNull(28)) { TopSeaeEntity.PORTLOAD = sqlRead.GetString(28); } //装货港
if (!sqlRead.IsDBNull(29)) { TopSeaeEntity.PORTDISCHARGEID = sqlRead.GetString(29); } //卸货港代码
if (!sqlRead.IsDBNull(30)) { TopSeaeEntity.PORTDISCHARGE = sqlRead.GetString(30); } //卸货港
if (!sqlRead.IsDBNull(31)) { TopSeaeEntity.PLACEDELIVERYID = sqlRead.GetString(31); } //交货地代码
if (!sqlRead.IsDBNull(32)) { TopSeaeEntity.PLACEDELIVERY = sqlRead.GetString(32); } //交货地
if (!sqlRead.IsDBNull(33)) { TopSeaeEntity.DESTINATIONID = sqlRead.GetString(33); } //目的地代码
if (!sqlRead.IsDBNull(34)) { TopSeaeEntity.DESTINATION = sqlRead.GetString(34); } //目的地
if (!sqlRead.IsDBNull(35)) { TopSeaeEntity.NOBILL = sqlRead.GetString(35); } //提单份数
if (!sqlRead.IsDBNull(36)) { TopSeaeEntity.ISSUETYPE = sqlRead.GetString(36); } //签单方式
if (!sqlRead.IsDBNull(37)) { TopSeaeEntity.ISSUEDATE = sqlRead.GetDateTime(37); } //签单日期
if (!sqlRead.IsDBNull(38)) { TopSeaeEntity.ISSUEPLACE = sqlRead.GetString(38); } //签单地点
if (!sqlRead.IsDBNull(39)) { TopSeaeEntity.BLFRT = sqlRead.GetString(39); } //付费方式
if (!sqlRead.IsDBNull(40)) { TopSeaeEntity.PREPARDAT = sqlRead.GetString(40); } //预付地点
if (!sqlRead.IsDBNull(41)) { TopSeaeEntity.PAYABLEAT = sqlRead.GetString(41); } //到付地点
if (!sqlRead.IsDBNull(42)) { TopSeaeEntity.SERVICE = sqlRead.GetString(42); } //运输条款
if (!sqlRead.IsDBNull(43)) { TopSeaeEntity.MARKS = sqlRead.GetString(43); } //唛头
if (!sqlRead.IsDBNull(44)) { TopSeaeEntity.CNTRSEALNO = sqlRead.GetString(44); } //箱号封号
if (!sqlRead.IsDBNull(45)) { TopSeaeEntity.NOPKGS = sqlRead.GetString(45); } //件数包装
if (!sqlRead.IsDBNull(46)) { TopSeaeEntity.DESCRIPTION = sqlRead.GetString(46); } //货物描述
if (!sqlRead.IsDBNull(47)) { TopSeaeEntity.GOODSNAME = sqlRead.GetString(47); } //品名
if (!sqlRead.IsDBNull(48)) { TopSeaeEntity.GROSSWEIGHT = sqlRead.GetString(48); } //货物毛重
if (!sqlRead.IsDBNull(49)) { TopSeaeEntity.MEASUREMENT = sqlRead.GetString(49); } //货物尺码
if (!sqlRead.IsDBNull(50)) { TopSeaeEntity.PKGS = sqlRead.GetInt32(50); } //件数
if (!sqlRead.IsDBNull(51)) { TopSeaeEntity.KINDPKGS = sqlRead.GetString(51); } //包装
if (!sqlRead.IsDBNull(52)) { TopSeaeEntity.KGS = sqlRead.GetDecimal(52); } //毛重
if (!sqlRead.IsDBNull(53)) { TopSeaeEntity.CBM = sqlRead.GetDecimal(53); } //尺码
if (!sqlRead.IsDBNull(54)) { TopSeaeEntity.TOTALNO = sqlRead.GetString(54); } //件数大写
if (!sqlRead.IsDBNull(55)) { TopSeaeEntity.CNTRNO = sqlRead.GetString(55); } //集装箱大写
if (!sqlRead.IsDBNull(56)) { TopSeaeEntity.CNTR1 = sqlRead.GetInt32(56); } //箱型1
if (!sqlRead.IsDBNull(57)) { TopSeaeEntity.CNTR2 = sqlRead.GetInt32(57); } //箱型2
if (!sqlRead.IsDBNull(58)) { TopSeaeEntity.CNTR3 = sqlRead.GetInt32(58); } //箱型3
if (!sqlRead.IsDBNull(59)) { TopSeaeEntity.CNTR4 = sqlRead.GetInt32(59); } //箱型4
if (!sqlRead.IsDBNull(60)) { TopSeaeEntity.CNTR5 = sqlRead.GetInt32(60); } //箱型5
if (!sqlRead.IsDBNull(61)) { TopSeaeEntity.CNTR6 = sqlRead.GetInt32(61); } //箱型6
if (!sqlRead.IsDBNull(62)) { TopSeaeEntity.CNTR7 = sqlRead.GetInt32(62); } //箱型7
if (!sqlRead.IsDBNull(63)) { TopSeaeEntity.CNTR8 = sqlRead.GetInt32(63); } //箱型8
if (!sqlRead.IsDBNull(64)) { TopSeaeEntity.CNTR9 = sqlRead.GetInt32(64); } //箱型9
if (!sqlRead.IsDBNull(65)) { TopSeaeEntity.CNTR10 = sqlRead.GetInt32(65); } //箱型10
if (!sqlRead.IsDBNull(66)) { TopSeaeEntity.OTCNTR = sqlRead.GetInt32(66); } //其他箱型
if (!sqlRead.IsDBNull(67)) { TopSeaeEntity.TEU = sqlRead.GetInt32(67); } //箱TEU
if (!sqlRead.IsDBNull(68)) { TopSeaeEntity.CNTRTOTAL = sqlRead.GetString(68); } //集装箱
if (!sqlRead.IsDBNull(69)) { TopSeaeEntity.INPUTBY = sqlRead.GetString(69); } //录入人
if (!sqlRead.IsDBNull(70)) { TopSeaeEntity.OP = sqlRead.GetString(70); } //操作员
if (!sqlRead.IsDBNull(71)) { TopSeaeEntity.CUSTSERVICE = sqlRead.GetString(71); } //客服
if (!sqlRead.IsDBNull(72)) { TopSeaeEntity.LANE = sqlRead.GetString(72); } //航线
if (!sqlRead.IsDBNull(73)) { TopSeaeEntity.SALE = sqlRead.GetString(73); } //揽货人
if (!sqlRead.IsDBNull(74)) { TopSeaeEntity.CARRIER = sqlRead.GetString(74); } //船公司
if (!sqlRead.IsDBNull(75)) { TopSeaeEntity.FORWARDER = sqlRead.GetString(75); } //订舱代理
if (!sqlRead.IsDBNull(76)) { TopSeaeEntity.CUSTOMSER = sqlRead.GetString(76); } //报关行
if (!sqlRead.IsDBNull(77)) { TopSeaeEntity.TRUCKER = sqlRead.GetString(77); } //承运车队
if (!sqlRead.IsDBNull(78)) { TopSeaeEntity.INVNO = sqlRead.GetString(78); } //发票号
if (!sqlRead.IsDBNull(79)) { TopSeaeEntity.CARGOID = sqlRead.GetString(79); } //货物标识
if (!sqlRead.IsDBNull(80)) { TopSeaeEntity.DCLASS = sqlRead.GetString(80); } //危险品分类/等级
if (!sqlRead.IsDBNull(81)) { TopSeaeEntity.DUNNO = sqlRead.GetString(81); } //危险品编号
if (!sqlRead.IsDBNull(82)) { TopSeaeEntity.REEFERF = sqlRead.GetString(82); } //冷藏通风量
if (!sqlRead.IsDBNull(83)) { TopSeaeEntity.TEMPID = sqlRead.GetString(83); } //温度单位
if (!sqlRead.IsDBNull(84)) { TopSeaeEntity.TEMPSET = sqlRead.GetString(84); } //设置温度
if (!sqlRead.IsDBNull(85)) { TopSeaeEntity.TEMPMAX = sqlRead.GetString(85); } //最高温度
if (!sqlRead.IsDBNull(86)) { TopSeaeEntity.TEMPMIN = sqlRead.GetString(86); } //最低温度
if (!sqlRead.IsDBNull(87)) { TopSeaeEntity.BSSOURCE = sqlRead.GetString(87); } //业务来源
if (!sqlRead.IsDBNull(88)) { TopSeaeEntity.BSSOURCEDETAIL = sqlRead.GetString(88); } //来源明细
if (!sqlRead.IsDBNull(89)) { TopSeaeEntity.CUSTOMSNUM = sqlRead.GetInt16(89); } //报关票数
if (!sqlRead.IsDBNull(90)) { TopSeaeEntity.CONTRACTNO = sqlRead.GetString(90); } //运费协议号
if (!sqlRead.IsDBNull(91)) { TopSeaeEntity.ORDTYPE = sqlRead.GetString(91); } //订舱类型
if (!sqlRead.IsDBNull(92)) { TopSeaeEntity.ORDERNO = sqlRead.GetString(92); } //订舱编号
if (!sqlRead.IsDBNull(93)) { TopSeaeEntity.INSURANCEER = sqlRead.GetString(93); } //保险人
if (!sqlRead.IsDBNull(94)) { TopSeaeEntity.INSURANCENO = sqlRead.GetString(94); } //保险单号
if (!sqlRead.IsDBNull(95)) { TopSeaeEntity.INAMOUT = sqlRead.GetDecimal(95); } //保险金额
if (!sqlRead.IsDBNull(96)) { TopSeaeEntity.ISVOU = sqlRead.GetBoolean(96); } //是否生成凭证
if (!sqlRead.IsDBNull(97)) { TopSeaeEntity.VOUNO = sqlRead.GetString(97); } //凭证号
if (!sqlRead.IsDBNull(98)) { TopSeaeEntity.REMARK = sqlRead.GetString(98); } //备注
if (!sqlRead.IsDBNull(99)) { TopSeaeEntity.STATUS1 = sqlRead.GetBoolean(99); } //状态1
if (!sqlRead.IsDBNull(100)) { TopSeaeEntity.STATUS2 = sqlRead.GetBoolean(100); } //状态2
if (!sqlRead.IsDBNull(101)) { TopSeaeEntity.STATUS3 = sqlRead.GetBoolean(101); } //状态3
if (!sqlRead.IsDBNull(102)) { TopSeaeEntity.STATUS4 = sqlRead.GetBoolean(102); } //状态4
if (!sqlRead.IsDBNull(103)) { TopSeaeEntity.STATUS5 = sqlRead.GetBoolean(103); } //状态5
if (!sqlRead.IsDBNull(104)) { TopSeaeEntity.ISFUMIGATION = sqlRead.GetBoolean(104); } //熏蒸
if (!sqlRead.IsDBNull(105)) { TopSeaeEntity.ISSTORAGE = sqlRead.GetBoolean(105); } //仓储
if (!sqlRead.IsDBNull(106)) { TopSeaeEntity.ISLAND = sqlRead.GetBoolean(106); } //陆运
if (!sqlRead.IsDBNull(107)) { TopSeaeEntity.ISCUSTOMS = sqlRead.GetBoolean(107); } //报关
if (!sqlRead.IsDBNull(108)) { TopSeaeEntity.ISINSPECTION = sqlRead.GetBoolean(108); } //报检
if (!sqlRead.IsDBNull(109)) { TopSeaeEntity.ISBOOKING = sqlRead.GetBoolean(109); } //订舱
if (!sqlRead.IsDBNull(110)) { TopSeaeEntity.ISAGENT = sqlRead.GetBoolean(110); } //使用代理
if (!sqlRead.IsDBNull(111)) { TopSeaeEntity.ISHBLNO = sqlRead.GetBoolean(111); } //分单签单
if (!sqlRead.IsDBNull(112)) { TopSeaeEntity.SERVICE9 = sqlRead.GetBoolean(112); } //服务项目9
if (!sqlRead.IsDBNull(113)) { TopSeaeEntity.SERVICE10 = sqlRead.GetBoolean(113); } //服务项目10
if (!sqlRead.IsDBNull(114)) { TopSeaeEntity.DOC = sqlRead.GetString(114); } //单证
if (!sqlRead.IsDBNull(115)) { TopSeaeEntity.PACKINGTYPE = sqlRead.GetString(115); } //装箱类型
if (!sqlRead.IsDBNull(116)) { TopSeaeEntity.WAREHOUSE = sqlRead.GetString(116); } //仓库
if (!sqlRead.IsDBNull(117)) { TopSeaeEntity.CLOSEDOCDATE = sqlRead.GetDateTime(117); } //截单日期
if (!sqlRead.IsDBNull(118)) { TopSeaeEntity.INTOPORTDATE = sqlRead.GetDateTime(118); } //集港日期
if (!sqlRead.IsDBNull(119)) { TopSeaeEntity.CORPID = sqlRead.GetString(119); } //分公司代码
if (!sqlRead.IsDBNull(120)) { TopSeaeEntity.SALEDEPT = sqlRead.GetString(120); } //所属业务部门
if (!sqlRead.IsDBNull(121)) { TopSeaeEntity.MBLFRT = sqlRead.GetString(121); } //MBL付费方式
if (!sqlRead.IsDBNull(122)) { TopSeaeEntity.CREATETIME = sqlRead.GetDateTime(122); } //创建日期
if (!sqlRead.IsDBNull(123)) { TopSeaeEntity.STLNAME = sqlRead.GetString(123); } //结算方式
if (!sqlRead.IsDBNull(124)) { TopSeaeEntity.STLDATE = sqlRead.GetDateTime(124); } //结算日期
if (!sqlRead.IsDBNull(125)) { TopSeaeEntity.ORDERTYPE = sqlRead.GetString(125); } //委托方式
if (!sqlRead.IsDBNull(126)) { TopSeaeEntity.OPERATORCODE = sqlRead.GetString(126); } //客户操作代码
if (!sqlRead.IsDBNull(127)) { TopSeaeEntity.OPERATOR = sqlRead.GetString(127); } //客户操作名称
if (!sqlRead.IsDBNull(128)) { TopSeaeEntity.OPERATOREMAIL = sqlRead.GetString(128); } //操作电子邮箱
if (!sqlRead.IsDBNull(129)) { TopSeaeEntity.OPERATORTEL = sqlRead.GetString(129); } //操作电话
if (!sqlRead.IsDBNull(130)) { TopSeaeEntity.OPERATORFAX = sqlRead.GetString(130); } //操作传真
if (!sqlRead.IsDBNull(131)) { TopSeaeEntity.FINANCIALSTAFFCODE = sqlRead.GetString(131); } //客户财务代码
if (!sqlRead.IsDBNull(132)) { TopSeaeEntity.FINANCIALSTAFF = sqlRead.GetString(132); } //客户财务名称
if (!sqlRead.IsDBNull(133)) { TopSeaeEntity.FINANCIALSTAFFEMAIL = sqlRead.GetString(133); } //财务电子邮箱
if (!sqlRead.IsDBNull(134)) { TopSeaeEntity.FINANCIALSTAFFTEL = sqlRead.GetString(134); } //财务电话
if (!sqlRead.IsDBNull(135)) { TopSeaeEntity.FINANCIALSTAFFFAX = sqlRead.GetString(135); } //财务传真
if (!sqlRead.IsDBNull(136)) { TopSeaeEntity.PlACERECEIPTID = sqlRead.GetString(136); }//收货地代码
if (!sqlRead.IsDBNull(137)) { TopSeaeEntity.SOURCECODE = sqlRead.GetString(137); }//收货地代码
if (!sqlRead.IsDBNull(138)) { TopSeaeEntity.ISCONTAINERSOC = sqlRead.GetBoolean(138); }//
if (!sqlRead.IsDBNull(139)) { TopSeaeEntity.DPAGE = sqlRead.GetString(139); }//
if (!sqlRead.IsDBNull(140)) { TopSeaeEntity.DLABEL = sqlRead.GetString(140); }//
if (!sqlRead.IsDBNull(141)) { TopSeaeEntity.LINKMAN = sqlRead.GetString(141); }//
if (!sqlRead.IsDBNull(142)) { TopSeaeEntity.VESSELID = sqlRead.GetString(142); }//
if (!sqlRead.IsDBNull(143)) { TopSeaeEntity.ISSUEPLACEID = sqlRead.GetString(143); }//
}
}
catch (Exception exceError)
{
//抛出异常
throw exceError;
}
}
return TopSeaeEntity;
}
#endregion
#region
///// <summary>
///// 插入信息
///// </summary>
///// <param name="TopSeaeEntity">实体类</param>
///// <returns>值为1插入数据正常,-1操作异常</returns>
//public int InserInfo(TopSeaeEntity infoEntity)
//{
// int iResult = 0;
// //获取参数
// SqlParameter[] parms = GetInsertParms();
// parms[0].Value = infoEntity.BSNO;//业务编号
// parms[1].Value = infoEntity.MASTERNO;//主编号
// parms[2].Value = infoEntity.BSSTATUS;//业务状态
// parms[3].Value = infoEntity.FEESTATUS;//费用状态
// parms[4].Value = infoEntity.BSDATE;//录入日期
// parms[5].Value = infoEntity.ACCDATE;//会计期间
// parms[6].Value = infoEntity.MBLNO;//主提单号
// parms[7].Value = infoEntity.HBLNO;//分提单号
// parms[8].Value = infoEntity.CUSTNO;//委托编号
// parms[9].Value = infoEntity.TRANSNO;//运单号
// parms[10].Value = infoEntity.CUSTOMERNAME;//委托单位
// parms[11].Value = infoEntity.BLTYPE;//装运方式
// parms[12].Value = infoEntity.SHIPPERID;//发货人
// parms[13].Value = infoEntity.CONSIGNEEID;//收货人
// parms[14].Value = infoEntity.NOTIFYPARTYID;//通知人
// parms[15].Value = infoEntity.SHIPPER;//发货人内容
// parms[16].Value = infoEntity.CONSIGNEE;//收货人内容
// parms[17].Value = infoEntity.NOTIFYPARTY;//通知人内容
// parms[18].Value = infoEntity.AGENTID;//国外代理
// parms[19].Value = infoEntity.AGENT;//国外代理内容
// parms[20].Value = infoEntity.YARD;//场站
// parms[21].Value = infoEntity.VESSEL;//船名
// parms[22].Value = infoEntity.VOYNO;//航次
// parms[23].Value = infoEntity.ETD;//开船日期
// parms[24].Value = infoEntity.CLOSINGDATE;//截港日期
// parms[25].Value = infoEntity.ETA;//预抵日期
// parms[26].Value = infoEntity.PlACERECEIPT;//收货地
// parms[27].Value = infoEntity.PORTLOADID;//装货港代码
// parms[28].Value = infoEntity.PORTLOAD;//装货港
// parms[29].Value = infoEntity.PORTDISCHARGEID;//卸货港代码
// parms[30].Value = infoEntity.PORTDISCHARGE;//卸货港
// parms[31].Value = infoEntity.PLACEDELIVERYID;//交货地代码
// parms[32].Value = infoEntity.PLACEDELIVERY;//交货地
// parms[33].Value = infoEntity.DESTINATIONID;//目的地代码
// parms[34].Value = infoEntity.DESTINATION;//目的地
// parms[35].Value = infoEntity.NOBILL;//提单份数
// parms[36].Value = infoEntity.ISSUETYPE;//签单方式
// parms[37].Value = infoEntity.ISSUEDATE;//签单日期
// parms[38].Value = infoEntity.ISSUEPLACE;//签单地点
// parms[39].Value = infoEntity.BLFRT;//付费方式
// parms[40].Value = infoEntity.PREPARDAT;//预付地点
// parms[41].Value = infoEntity.PAYABLEAT;//到付地点
// parms[42].Value = infoEntity.SERVICE;//运输条款
// parms[43].Value = infoEntity.MARKS;//唛头
// parms[44].Value = infoEntity.CNTRSEALNO;//箱号封号
// parms[45].Value = infoEntity.NOPKGS;//件数包装
// parms[46].Value = infoEntity.DESCRIPTION;//货物描述
// parms[47].Value = infoEntity.GOODSNAME;//品名
// parms[48].Value = infoEntity.GROSSWEIGHT;//货物毛重
// parms[49].Value = infoEntity.MEASUREMENT;//货物尺码
// parms[50].Value = infoEntity.PKGS;//件数
// parms[51].Value = infoEntity.KINDPKGS;//包装
// parms[52].Value = infoEntity.KGS;//毛重
// parms[53].Value = infoEntity.CBM;//尺码
// parms[54].Value = infoEntity.TOTALNO;//件数大写
// parms[55].Value = infoEntity.CNTRNO;//集装箱大写
// parms[56].Value = infoEntity.CNTR1;//箱型1
// parms[57].Value = infoEntity.CNTR2;//箱型2
// parms[58].Value = infoEntity.CNTR3;//箱型3
// parms[59].Value = infoEntity.CNTR4;//箱型4
// parms[60].Value = infoEntity.CNTR5;//箱型5
// parms[61].Value = infoEntity.CNTR6;//箱型6
// parms[62].Value = infoEntity.CNTR7;//箱型7
// parms[63].Value = infoEntity.CNTR8;//箱型8
// parms[64].Value = infoEntity.CNTR9;//箱型9
// parms[65].Value = infoEntity.CNTR10;//箱型10
// parms[66].Value = infoEntity.OTCNTR;//其他箱型
// parms[67].Value = infoEntity.TEU;//箱TEU
// parms[68].Value = infoEntity.CNTRTOTAL;//集装箱
// parms[69].Value = infoEntity.INPUTBY;//录入人
// parms[70].Value = infoEntity.OP;//操作员
// parms[71].Value = infoEntity.CUSTSERVICE;//客服
// parms[72].Value = infoEntity.LANE;//航线
// parms[73].Value = infoEntity.SALE;//揽货人
// parms[74].Value = infoEntity.CARRIER;//船公司
// parms[75].Value = infoEntity.FORWARDER;//订舱代理
// parms[76].Value = infoEntity.CUSTOMSER;//报关行
// parms[77].Value = infoEntity.TRUCKER;//承运车队
// parms[78].Value = infoEntity.INVNO;//发票号
// parms[79].Value = infoEntity.CARGOID;//货物标识;//CHAR
// parms[80].Value = infoEntity.DCLASS;//危险品分类/等级
// parms[81].Value = infoEntity.DUNNO;//危险品编号
// parms[82].Value = infoEntity.REEFERF;//冷藏通风量
// parms[83].Value = infoEntity.TEMPID;//温度单位;//char
// parms[84].Value = infoEntity.TEMPSET;//设置温度
// parms[85].Value = infoEntity.TEMPMAX;//最高温度
// parms[86].Value = infoEntity.TEMPMIN;//最低温度
// parms[87].Value = infoEntity.BSSOURCE;//业务来源
// parms[88].Value = infoEntity.BSSOURCEDETAIL;//来源明细
// parms[89].Value = infoEntity.CUSTOMSNUM;//报关票数
// parms[90].Value = infoEntity.CONTRACTNO;//运费协议号
// parms[91].Value = infoEntity.ORDTYPE;//订舱类型
// parms[92].Value = infoEntity.ORDERNO;//订舱编号
// parms[93].Value = infoEntity.INSURANCEER;//保险人
// parms[94].Value = infoEntity.INSURANCENO;//保险单号
// parms[95].Value = infoEntity.INAMOUT;//保险金额
// parms[96].Value = infoEntity.ISVOU;//是否生成凭证
// parms[97].Value = infoEntity.VOUNO;//凭证号
// parms[98].Value = infoEntity.REMARK;//备注
// parms[99].Value = infoEntity.STATUS1;//状态1
// parms[100].Value = infoEntity.STATUS2;//状态2
// parms[101].Value = infoEntity.STATUS3;//状态3
// parms[102].Value = infoEntity.STATUS4;//状态4
// parms[103].Value = infoEntity.STATUS5;//状态5
// parms[104].Value = infoEntity.ISFUMIGATION;//熏蒸
// parms[105].Value = infoEntity.ISSTORAGE;//仓储
// parms[106].Value = infoEntity.ISLAND;//陆运
// parms[107].Value = infoEntity.ISCUSTOMS;//报关
// parms[108].Value = infoEntity.ISINSPECTION;//报检
// parms[109].Value = infoEntity.DOC;//单证
// parms[110].Value = infoEntity.PACKINGTYPE;//装箱类型
// parms[111].Value = infoEntity.WAREHOUSE;//仓库
// parms[112].Value = infoEntity.CLOSEDOCDATE;//截单日期
// parms[113].Value = infoEntity.INTOPORTDATE;//集港日期
// parms[114].Value = infoEntity.CORPID;//分公司代码
// parms[115].Value = infoEntity.SALEDEPT;//所属业务部门
// parms[116].Value = infoEntity.MBLFRT;//MBL付费方式
// parms[117].Value = infoEntity.PlACERECEIPTID;// 收货地代码
// using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
// {
// int existVal = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, SQL_INSERT_INFO, parms);
// if (existVal > 0)
// {
// iResult = 1;
// }
// else
// {
// iResult = -1;//执行异常
// }
// }
// return iResult;
//}
#endregion
public int InsertTopSeaes(IList<TopSeaeEntity> tempTopSeaeEntities)
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
int result = 0;
//判断是否有值
if (tempTopSeaeEntities[0].BSNO != null)
{
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
foreach (TopSeaeEntity TopSeae in tempTopSeaeEntities)
{
if (TopSeae.BSNO != null)
{
string alt = "";
alt = T_ALL_DA.GetStrSQL("MBLNO", "select MBLNO from op_seae where MBLNO='" + TopSeae.MBLNO.Trim() + "'");
if (alt.Trim() == "")
{
result = InserInfo(TopSeae);
}
else
{
result = UpdateInfo(TopSeae);
}
}
}
sqlTran.Commit();
result = 1;//状态为1表示插入成功
}
catch (Exception execError)
{
result = -1;//有异常,插入失败
sqlTran.Rollback();
result = -2;//插入异常,事务已回滚成功
throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
}
return result;
}
public int InsertTopSeaesEDI(IList<TopSeaeEntity> tempTopSeaeEntities, String strCompanyID)
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
int result = 0;
//判断是否有值
if (tempTopSeaeEntities[0].BSNO != null)
{
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
foreach (TopSeaeEntity TopSeae in tempTopSeaeEntities)
{
if (TopSeae.BSNO != null)
{
string alt = "";
alt = T_ALL_DA.GetStrSQL("BSNO", "select BSNO from op_seae where MBLNO='" + TopSeae.MBLNO.Trim() + "'");
if (alt.Trim() == "")
{
TopSeae.HBLNO = getCodeRule("分提单号", "HBLNO", TopSeae.ETD.ToString().Trim(), TopSeae.ACCDATE.ToString().Trim(), TopSeae.INPUTBY.ToString().Trim(), strCompanyID);//调用编码规则
TopSeae.CUSTNO = getCodeRule("委托编号", "CUSTNO", TopSeae.ETD.ToString().Trim(), TopSeae.ACCDATE.ToString().Trim(), TopSeae.INPUTBY.ToString().Trim(), strCompanyID);//调用编码规则
result = InserInfo(TopSeae);
}
else
{
TopSeae.BSNO = alt.Trim();
TopSeae.HBLNO = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from op_seae where MBLNO='" + TopSeae.MBLNO.Trim() + "'");
TopSeae.CUSTNO = T_ALL_DA.GetStrSQL("CUSTNO", "select CUSTNO from op_seae where MBLNO='" + TopSeae.MBLNO.Trim() + "'");
result = UpdateInfoEDI(TopSeae);
}
}
}
sqlTran.Commit();
//result = 1;//状态为1表示插入成功
}
catch (Exception execError)
{
result = -1;//有异常,插入失败
sqlTran.Rollback();
result = -2;//插入异常,事务已回滚成功
throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
}
return result;
}
public int InsertTopSeaesHBLNOCUSTNO(TopSeaeEntity infoEntity, String strCompanyID)
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
int result = 0;
//判断是否有值
if (infoEntity != null)
{
if (infoEntity.BSNO.ToString().Trim() != "")
{
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
string alt = "";
if (infoEntity.HBLNO.ToString().Trim() == "")
{
infoEntity.HBLNO = getCodeRule("分提单号", "HBLNO", infoEntity.ETD.ToString().Trim(), infoEntity.ACCDATE.ToString().Trim(), infoEntity.INPUTBY.ToString().Trim(), strCompanyID);//调用编码规则
}
alt = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from [op_seae] where HBLNO='" + infoEntity.HBLNO.ToString().Trim() + "'");
if (alt.Trim() != "")
{
infoEntity.HBLNO = getCodeRule("分提单号", "HBLNO", infoEntity.ETD.ToString().Trim(), infoEntity.ACCDATE.ToString().Trim(), infoEntity.INPUTBY.ToString().Trim(), strCompanyID);//调用编码规则
}
//
if (infoEntity.CUSTNO.ToString().Trim() == "")
{
infoEntity.CUSTNO = getCodeRule("委托编号", "CUSTNO", infoEntity.ETD.ToString().Trim(), infoEntity.ACCDATE.ToString().Trim(), infoEntity.INPUTBY.ToString().Trim(), strCompanyID);//调用编码规则
}
alt = T_ALL_DA.GetStrSQL("CUSTNO", "select CUSTNO from [op_seae] where CUSTNO='" + infoEntity.CUSTNO.ToString().Trim() + "'");
if (alt.Trim() != "")
{
infoEntity.CUSTNO = getCodeRule("委托编号", "CUSTNO", infoEntity.ETD.ToString().Trim(), infoEntity.ACCDATE.ToString().Trim(), infoEntity.INPUTBY.ToString().Trim(), strCompanyID);//调用编码规则
}
//
result = InserInfo(infoEntity);
sqlTran.Commit();
//result = 1;//状态为1表示插入成功
}
catch (Exception execError)
{
result = -1;//有异常,插入失败
sqlTran.Rollback();
result = -2;//插入异常,事务已回滚成功
throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
}
}
return result;
}
public int UpdateTopSeaesHBLNOCUSTNO(TopSeaeEntity infoEntity, string strCompanyID)
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
int result = 0;
//判断是否有值
if (infoEntity != null)
{
if (infoEntity.BSNO.ToString().Trim() != "")
{
TopSeaeEntity TopSeaeEntity1 = new TopSeaeEntity();
TopSeaeEntity1 = GetID(infoEntity.BSNO.ToString().Trim());
string strUserID = T_ALL_DA.GetStrSQL("GID", "select GID from [user] where SHOWNAME='" + TopSeaeEntity1.INPUTBY.ToString().Trim() + "' and DELETEUSER='False'");
DateTime fwqdate = System.Convert.ToDateTime(T_ALL_DA.GetStrSQL("fwqdate", "select fwqdate=getdate()"));
string sCODENAME = T_ALL_DA.GetStrSQL("CODENAME", "select CODENAME from [company] where GID=(select top 1 COMPANYID from user_company where USERID='" + strUserID.Trim() + "')");
string sDEPTNO = T_ALL_DA.GetStrSQL("DEPTNO", "select DEPTNO from [sys_dept] where LINKID=(select top 1 COMPANYID from user_company where USERID='" + strUserID.Trim() + "')");
//
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
string alt = "";
string strRULENAME = "";
string strfield="";
string strETD = TopSeaeEntity1.ACCDATE.ToString().Trim();
string strACCDATE = TopSeaeEntity1.ACCDATE.ToString().Trim();
if (strETD.Trim().IndexOf("0001")>-1)
{
strETD = "";
}
//调用编码规则
string strRULEYEAR = "";
string strRULECONTENT = "";
string strCODENAME = "";
string strDEPTNO = "";
string strRULENOLENGTH = "";
int iRULENOLENGTH = 0;
int inum = 0;
string strCONTENT = "";
//
DataSet ds = T_ALL_DA.GetAllSQL("select * from code_rule where RULENAME='" + strRULENAME.Trim() + "' and RULETYPE=1 ");
if (ds != null)
{
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["ISSTARTUSING"].ToString().Trim().Equals("True"))
{
if (ds.Tables[0].Rows[0]["RULEDATE"].ToString().Trim().Equals("业务日期"))
{
if (strETD.Trim() == "")
{
//return "";
}
DateTime dETD = System.Convert.ToDateTime(strETD.Trim());
if (ds.Tables[0].Rows[0]["ISCLEAREDINEARLY"].ToString().Trim().Equals("True"))
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dETD.ToString("yyyy") + dETD.ToString("MM");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dETD.ToString("yy") + dETD.ToString("MM");
}
}
else
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dETD.ToString("yyyy");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dETD.ToString("yy");
}
}
}
else if (ds.Tables[0].Rows[0]["RULEDATE"].ToString().Trim().Equals("会计期间"))
{
if (strACCDATE.Trim() == "")
{
//return "";
}
DateTime dACCDATE = System.Convert.ToDateTime(strACCDATE.Trim() + "-01");
if (ds.Tables[0].Rows[0]["ISCLEAREDINEARLY"].ToString().Trim().Equals("True"))
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dACCDATE.ToString("yyyy") + dACCDATE.ToString("MM");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dACCDATE.ToString("yy") + dACCDATE.ToString("MM");
}
}
else
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dACCDATE.ToString("yyyy");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dACCDATE.ToString("yy");
}
}
}
else if (ds.Tables[0].Rows[0]["RULEDATE"].ToString().Trim().Equals("自然月份"))
{
//DateTime fwqdate = System.Convert.ToDateTime(T_ALL_DA.GetStrSQL("fwqdate", "select fwqdate=getdate()"));
if (ds.Tables[0].Rows[0]["ISCLEAREDINEARLY"].ToString().Trim().Equals("True"))
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = fwqdate.ToString("yyyy") + fwqdate.ToString("MM");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = fwqdate.ToString("yy") + fwqdate.ToString("MM");
}
}
else
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = fwqdate.ToString("yyyy");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = fwqdate.ToString("yy");
}
}
}
//
if (ds.Tables[0].Rows[0]["ISCOMPANY"].ToString().Trim().Equals("True"))
{
//strCODENAME = T_ALL_DA.GetStrSQL("CODENAME", "select CODENAME from [company] where GID=(select top 1 COMPANYID from user_company where USERID='" + strUserID.Trim() + "')");
strCODENAME = sCODENAME;
}
if (ds.Tables[0].Rows[0]["ISDEPT"].ToString().Trim().Equals("True"))
{
//strDEPTNO = T_ALL_DA.GetStrSQL("DEPTNO", "select DEPTNO from [sys_dept] where LINKID=(select top 1 COMPANYID from user_company where USERID='" + strUserID.Trim() + "')");
strDEPTNO = sDEPTNO;
}
strRULECONTENT = ds.Tables[0].Rows[0]["RULECONTENT"].ToString().Trim();
strRULECONTENT = strRULECONTENT.Replace("《COMPANY》", strCODENAME);
strRULECONTENT = strRULECONTENT.Replace("《DEPT》", strDEPTNO);
//
iRULENOLENGTH = int.Parse(ds.Tables[0].Rows[0]["RULENOLENGTH"].ToString().Trim());
strCONTENT = strRULECONTENT + strRULEYEAR;
//获取分公司的票号头字符
string tempBANKSHEAD = T_ALL_DA.GetStrSQL("BANKSHEAD", "SELECT TOP 1 BANKSHEAD FROM company WHERE GID='" + strCompanyID.Trim() + "'");
strCONTENT = tempBANKSHEAD + strCONTENT;
//
strRULENOLENGTH = T_ALL_DA.GetStrSQL(strfield, "select top 1 " + strfield + " from [op_seae] where " + strfield + " like '" + strCONTENT.Trim() + "%' order by " + strfield + " DESC");
if (strRULENOLENGTH == "")
{
strRULENOLENGTH = "1";
}
else
{
strRULENOLENGTH = strRULENOLENGTH.Replace(strCONTENT.Trim(), "");
inum = int.Parse(strRULENOLENGTH.Trim());
inum = inum + 1;
strRULENOLENGTH = inum.ToString();
}
int j = iRULENOLENGTH - strRULENOLENGTH.Length;
for (int i = 1; i <= j; i++)
{
strRULENOLENGTH = "0" + strRULENOLENGTH;
}
//
strCONTENT = strCONTENT + strRULENOLENGTH;
//return strCONTENT;
}
}
}
//return "";
if (infoEntity.HBLNO.ToString().Trim() == "")
{
if (TopSeaeEntity1.HBLNO.ToString().Trim() == "")
{
infoEntity.HBLNO = getCodeRule("分提单号", "HBLNO", TopSeaeEntity1.ETD.ToString().Trim(), TopSeaeEntity1.ACCDATE.ToString().Trim(), strUserID.Trim(), strCompanyID);//调用编码规则
}
else
{
infoEntity.HBLNO = TopSeaeEntity1.HBLNO;
}
}
else
{
alt = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from [op_seae] where HBLNO='" + infoEntity.HBLNO.ToString().Trim() + "' and BSNO<>'" + infoEntity.BSNO.ToString().Trim().ToString().Trim() + "'");
if (alt.Trim() != "")
{
//Page.ClientScript.RegisterStartupScript(this.GetType(), "key5", "<script>alert('分提单号重复!');</script>");
result=8;
}
}
//
if (infoEntity.CUSTNO.ToString().Trim() == "")
{
if (TopSeaeEntity1.CUSTNO.ToString().Trim() == "")
{
infoEntity.CUSTNO = getCodeRule("委托编号", "CUSTNO", TopSeaeEntity1.ETD.ToString().Trim(), TopSeaeEntity1.ACCDATE.ToString().Trim(), strUserID.Trim(), strCompanyID);//调用编码规则
}
else
{
infoEntity.CUSTNO = TopSeaeEntity1.CUSTNO;
}
}
else
{
alt = T_ALL_DA.GetStrSQL("CUSTNO", "select CUSTNO from [op_seae] where CUSTNO='" + infoEntity.CUSTNO.ToString().Trim() + "' and BSNO<>'" + infoEntity.BSNO.ToString().Trim().ToString().Trim() + "'");
if (alt.Trim() != "")
{
//Page.ClientScript.RegisterStartupScript(this.GetType(), "key6", "<script>alert('委托编号重复!');</script>");
result=9;
}
}
//
if (result == 0)
{
result = UpdateInfo(infoEntity);
}
sqlTran.Commit();
//result = 1;//状态为1表示插入成功
}
catch (Exception execError)
{
result = -1;//有异常,插入失败
sqlTran.Rollback();
result = -2;//插入异常,事务已回滚成功
throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
}
}
return result;
}
/// <summary>
/// 插入信息
/// </summary>
/// <param name="TopSeaeEntity">实体类</param>
/// <returns>值为1插入数据正常,-1操作异常</returns>
public int InserInfo(TopSeaeEntity infoEntity)
{
int iResult = 0;
//获取参数
SqlParameter[] parms = GetInsertParms();
parms[0].Value = infoEntity.BSNO;//业务编号
parms[1].Value = infoEntity.MASTERNO;//主编号
parms[2].Value = infoEntity.BSSTATUS;//业务状态
parms[3].Value = infoEntity.FEESTATUS;//费用状态
parms[4].Value = infoEntity.ACCDATE;//会计期间
parms[5].Value = infoEntity.MBLNO;//主提单号
parms[6].Value = infoEntity.HBLNO;//分提单号
parms[7].Value = infoEntity.CUSTNO;//委托编号
parms[8].Value = infoEntity.TRANSNO;//运单号
parms[9].Value = infoEntity.CUSTOMERNAME;//委托单位
parms[10].Value = infoEntity.BLTYPE;//装运方式
parms[11].Value = infoEntity.SHIPPERID;//发货人
parms[12].Value = infoEntity.CONSIGNEEID;//收货人
parms[13].Value = infoEntity.NOTIFYPARTYID;//通知人
parms[14].Value = infoEntity.SHIPPER;//发货人内容
parms[15].Value = infoEntity.CONSIGNEE;//收货人内容
parms[16].Value = infoEntity.NOTIFYPARTY;//通知人内容
parms[17].Value = infoEntity.AGENTID;//国外代理
parms[18].Value = infoEntity.AGENT;//国外代理内容
parms[19].Value = infoEntity.YARD;//场站
parms[20].Value = infoEntity.VESSEL;//船名
parms[21].Value = infoEntity.VOYNO;//航次
parms[22].Value = infoEntity.PlACERECEIPT;//收货地
parms[23].Value = infoEntity.PORTLOADID;//装货港代码
parms[24].Value = infoEntity.PORTLOAD;//装货港
parms[25].Value = infoEntity.PORTDISCHARGEID;//卸货港代码
parms[26].Value = infoEntity.PORTDISCHARGE;//卸货港
parms[27].Value = infoEntity.PLACEDELIVERYID;//交货地代码
parms[28].Value = infoEntity.PLACEDELIVERY;//交货地
parms[29].Value = infoEntity.DESTINATIONID;//目的地代码
parms[30].Value = infoEntity.DESTINATION;//目的地
parms[31].Value = infoEntity.NOBILL;//提单份数
parms[32].Value = infoEntity.ISSUETYPE;//签单方式
parms[33].Value = infoEntity.ISSUEPLACE;//签单地点
parms[34].Value = infoEntity.BLFRT;//付费方式
parms[35].Value = infoEntity.PREPARDAT;//预付地点
parms[36].Value = infoEntity.PAYABLEAT;//到付地点
parms[37].Value = infoEntity.SERVICE;//运输条款
parms[38].Value = infoEntity.MARKS;//唛头
parms[39].Value = infoEntity.CNTRSEALNO;//箱号封号
parms[40].Value = infoEntity.NOPKGS;//件数包装
parms[41].Value = infoEntity.DESCRIPTION;//货物描述
parms[42].Value = infoEntity.GOODSNAME;//品名
parms[43].Value = infoEntity.GROSSWEIGHT;//货物毛重
parms[44].Value = infoEntity.MEASUREMENT;//货物尺码
parms[45].Value = infoEntity.PKGS;//件数
parms[46].Value = infoEntity.KINDPKGS;//包装
parms[47].Value = infoEntity.KGS;//毛重
parms[48].Value = infoEntity.CBM;//尺码
parms[49].Value = infoEntity.TOTALNO;//件数大写
parms[50].Value = infoEntity.CNTRNO;//集装箱大写
parms[51].Value = infoEntity.CNTR1;//箱型1
parms[52].Value = infoEntity.CNTR2;//箱型2
parms[53].Value = infoEntity.CNTR3;//箱型3
parms[54].Value = infoEntity.CNTR4;//箱型4
parms[55].Value = infoEntity.CNTR5;//箱型5
parms[56].Value = infoEntity.CNTR6;//箱型6
parms[57].Value = infoEntity.CNTR7;//箱型7
parms[58].Value = infoEntity.CNTR8;//箱型8
parms[59].Value = infoEntity.CNTR9;//箱型9
parms[60].Value = infoEntity.CNTR10;//箱型10
parms[61].Value = infoEntity.OTCNTR;//其他箱型
parms[62].Value = infoEntity.TEU;//箱TEU
parms[63].Value = infoEntity.CNTRTOTAL;//集装箱
parms[64].Value = infoEntity.INPUTBY;//录入人
parms[65].Value = infoEntity.OP;//操作员
parms[66].Value = infoEntity.CUSTSERVICE;//客服
parms[67].Value = infoEntity.LANE;//航线
parms[68].Value = infoEntity.SALE;//揽货人
parms[69].Value = infoEntity.CARRIER;//船公司
parms[70].Value = infoEntity.FORWARDER;//订舱代理
parms[71].Value = infoEntity.CUSTOMSER;//报关行
parms[72].Value = infoEntity.TRUCKER;//承运车队
parms[73].Value = infoEntity.INVNO;//发票号
parms[74].Value = infoEntity.CARGOID;//货物标识;//CHAR
parms[75].Value = infoEntity.DCLASS;//危险品分类/等级
parms[76].Value = infoEntity.DUNNO;//危险品编号
parms[77].Value = infoEntity.REEFERF;//冷藏通风量
parms[78].Value = infoEntity.TEMPID;//温度单位;//char
parms[79].Value = infoEntity.TEMPSET;//设置温度
parms[80].Value = infoEntity.TEMPMAX;//最高温度
parms[81].Value = infoEntity.TEMPMIN;//最低温度
parms[82].Value = infoEntity.BSSOURCE;//业务来源
parms[83].Value = infoEntity.BSSOURCEDETAIL;//来源明细
parms[84].Value = infoEntity.CUSTOMSNUM;//报关票数
parms[85].Value = infoEntity.CONTRACTNO;//运费协议号
parms[86].Value = infoEntity.ORDTYPE;//订舱类型
parms[87].Value = infoEntity.ORDERNO;//订舱编号
parms[88].Value = infoEntity.INSURANCEER;//保险人
parms[89].Value = infoEntity.INSURANCENO;//保险单号
parms[90].Value = infoEntity.INAMOUT;//保险金额
parms[91].Value = infoEntity.ISVOU;//是否生成凭证
parms[92].Value = infoEntity.VOUNO;//凭证号
parms[93].Value = infoEntity.REMARK;//备注
parms[94].Value = infoEntity.STATUS1;//状态1
parms[95].Value = infoEntity.STATUS2;//状态2
parms[96].Value = infoEntity.STATUS3;//状态3
parms[97].Value = infoEntity.STATUS4;//状态4
parms[98].Value = infoEntity.STATUS5;//状态5
parms[99].Value = infoEntity.ISFUMIGATION;//熏蒸
parms[100].Value = infoEntity.ISSTORAGE;//仓储
parms[101].Value = infoEntity.ISLAND;//陆运
parms[102].Value = infoEntity.ISCUSTOMS;//报关
parms[103].Value = infoEntity.ISINSPECTION;//报检
parms[104].Value = infoEntity.DOC;//单证
parms[105].Value = infoEntity.PACKINGTYPE;//装箱类型
parms[106].Value = infoEntity.WAREHOUSE;//仓库
parms[107].Value = infoEntity.CORPID;//分公司代码
parms[108].Value = infoEntity.SALEDEPT;//所属业务部门
parms[109].Value = infoEntity.MBLFRT;//MBL付费方式
parms[110].Value = infoEntity.ISBOOKING;//订舱
parms[111].Value = infoEntity.ISAGENT;//使用代理
parms[112].Value = infoEntity.ISHBLNO;//分单签单
parms[113].Value = infoEntity.SERVICE9;//服务项目9
parms[114].Value = infoEntity.SERVICE10;//服务项目10
parms[115].Value = infoEntity.STLNAME;//结算方式
parms[116].Value = infoEntity.ORDERTYPE;//委托方式
parms[117].Value = infoEntity.OPERATORCODE;// 客户操作代码
parms[118].Value = infoEntity.OPERATOR;// 客户操作名称
parms[119].Value = infoEntity.OPERATOREMAIL;// 操作电子邮箱
parms[120].Value = infoEntity.OPERATORTEL;// 操作电话
parms[121].Value = infoEntity.OPERATORFAX;// 操作传真
parms[122].Value = infoEntity.FINANCIALSTAFFCODE;// 客户财务代码
parms[123].Value = infoEntity.FINANCIALSTAFF;// 客户财务名称
parms[124].Value = infoEntity.FINANCIALSTAFFEMAIL;// 财务电子邮箱
parms[125].Value = infoEntity.FINANCIALSTAFFTEL;// 财务电话
parms[126].Value = infoEntity.FINANCIALSTAFFFAX;// 财务传真
parms[127].Value = infoEntity.PlACERECEIPTID;// 收货地代码
parms[128].Value = infoEntity.SOURCECODE;//
parms[129].Value = infoEntity.ISCONTAINERSOC;//
parms[130].Value = infoEntity.DPAGE;//
parms[131].Value = infoEntity.DLABEL;//
parms[132].Value = infoEntity.LINKMAN;//
parms[133].Value = infoEntity.VESSELID;//
parms[134].Value = infoEntity.ISSUEPLACEID;//
//parms[116].Value = infoEntity.STLDATE;//结算日期
//parms[110].Value = infoEntity.ETD;//开船日期
//parms[111].Value = infoEntity.CLOSINGDATE;//截港日期
//parms[112].Value = infoEntity.ETA;//预抵日期
//parms[113].Value = infoEntity.ISSUEDATE;//签单日期
//parms[114].Value = infoEntity.CLOSEDOCDATE;//截单日期
//parms[115].Value = infoEntity.INTOPORTDATE;//集港日期
//parms[116].Value = infoEntity.BSDATE;//录入日期
string strETA = infoEntity.ETA.ToString().IndexOf("0001")>-1 ? "" : "'" + infoEntity.ETA.ToString() + "',";
string strETA_name = strETA.Equals("") ? "" : "ETA,";
string strETD = infoEntity.ETD.ToString().IndexOf("0001")>-1 ? "" : "'" + infoEntity.ETD.ToString() + "',";
string strETD_name = strETD.Equals("") ? "" : "ETD,";
string strCLOSINGDATE = infoEntity.CLOSINGDATE.ToString().IndexOf("0001")>-1 ? "" : "'" + infoEntity.CLOSINGDATE.ToString() + "',";
string strCLOSINGDATE_name = strCLOSINGDATE.Equals("") ? "" : "CLOSINGDATE,";
string strISSUEDATE = infoEntity.ISSUEDATE.ToString().IndexOf("0001")>-1 ? "" : "'" + infoEntity.ISSUEDATE.ToString() + "',";
string strISSUEDATE_name = strISSUEDATE.Equals("") ? "" : "ISSUEDATE,";
string strCLOSEDOCDATE = infoEntity.CLOSEDOCDATE.ToString().IndexOf("0001")>-1 ? "" : "'" + infoEntity.CLOSEDOCDATE.ToString() + "',";
string strCLOSEDOCDATE_name = strCLOSEDOCDATE.Equals("") ? "" : "CLOSEDOCDATE,";
string strINTOPORTDATE = infoEntity.INTOPORTDATE.ToString().IndexOf("0001")>-1 ? "" : "'" + infoEntity.INTOPORTDATE.ToString() + "',";
string strINTOPORTDATE_name = strINTOPORTDATE.Equals("") ? "" : "INTOPORTDATE,";
string strSTLDATE = infoEntity.STLDATE.ToString().IndexOf("0001")>-1 ? "" : "'" + infoEntity.STLDATE.ToString() + "',";
string strSTLDATE_name = strSTLDATE.Equals("") ? "" : "STLDATE,";
strSql = String.Format(strSql, strETA_name, strETA, strETD_name, strETD, strCLOSINGDATE_name, strCLOSINGDATE, strISSUEDATE_name, strISSUEDATE, strCLOSEDOCDATE_name, strCLOSEDOCDATE, strINTOPORTDATE_name, strINTOPORTDATE, strSTLDATE_name, strSTLDATE);
//
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int existVal = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql, parms);
if (existVal > 0)
{
iResult = 1;
//
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入op_seae海运业务信息表','插入操作','BSNO=" + infoEntity.BSNO + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
else
{
iResult = -1;//执行异常
}
}
return iResult;
}
/// <summary>
/// 更新信息
/// </summary>
/// <param name="TopSeaeEntity">实体类</param>
/// <returns>值为1更新数据正常,-1操作异常</returns>
public int UpdateInfo(TopSeaeEntity infoEntity)
{
int iResult = 0;
//获取参数
SqlParameter[] parms = GetUpdateParms();
parms[0].Value = infoEntity.BSNO;//业务编号
parms[1].Value = infoEntity.MBLNO;//主提单号
parms[2].Value = infoEntity.HBLNO;//分提单号
parms[3].Value = infoEntity.CUSTNO;//委托编号
parms[4].Value = infoEntity.TRANSNO;//运单号
parms[5].Value = infoEntity.CUSTOMERNAME;//委托单位
parms[6].Value = infoEntity.SHIPPERID;//发货人
parms[7].Value = infoEntity.CONSIGNEEID;//收货人
parms[8].Value = infoEntity.NOTIFYPARTYID;//通知人
parms[9].Value = infoEntity.SHIPPER;//发货人内容
parms[10].Value = infoEntity.CONSIGNEE;//收货人内容
parms[11].Value = infoEntity.NOTIFYPARTY;//通知人内容
parms[12].Value = infoEntity.AGENTID;//国外代理
parms[13].Value = infoEntity.AGENT;//国外代理内容
parms[14].Value = infoEntity.YARD;//场站
parms[15].Value = infoEntity.VESSEL;//船名
parms[16].Value = infoEntity.VOYNO;//航次
parms[17].Value = infoEntity.PlACERECEIPT;//收货地
parms[18].Value = infoEntity.PORTLOADID;//装货港代码
parms[19].Value = infoEntity.PORTLOAD;//装货港
parms[20].Value = infoEntity.PORTDISCHARGEID;//卸货港代码
parms[21].Value = infoEntity.PORTDISCHARGE;//卸货港
parms[22].Value = infoEntity.PLACEDELIVERYID;//交货地代码
parms[23].Value = infoEntity.PLACEDELIVERY;//交货地
parms[24].Value = infoEntity.DESTINATIONID;//目的地代码
parms[25].Value = infoEntity.DESTINATION;//目的地
parms[26].Value = infoEntity.NOBILL;//提单份数
parms[27].Value = infoEntity.ISSUETYPE;//签单方式
parms[28].Value = infoEntity.ISSUEPLACE;//签单地点
parms[29].Value = infoEntity.BLFRT;//付费方式
parms[30].Value = infoEntity.PREPARDAT;//预付地点
parms[31].Value = infoEntity.PAYABLEAT;//到付地点
parms[32].Value = infoEntity.SERVICE;//运输条款
parms[33].Value = infoEntity.MARKS;//唛头
parms[34].Value = infoEntity.CNTRSEALNO;//箱号封号
parms[35].Value = infoEntity.NOPKGS;//件数包装
parms[36].Value = infoEntity.DESCRIPTION;//货物描述
parms[37].Value = infoEntity.GOODSNAME;//品名
parms[38].Value = infoEntity.GROSSWEIGHT;//货物毛重
parms[39].Value = infoEntity.MEASUREMENT;//货物尺码
parms[40].Value = infoEntity.PKGS;//件数
parms[41].Value = infoEntity.KINDPKGS;//包装
parms[42].Value = infoEntity.KGS;//毛重
parms[43].Value = infoEntity.CBM;//尺码
parms[44].Value = infoEntity.TOTALNO;//件数大写
parms[45].Value = infoEntity.CNTRNO;//集装箱大写
parms[46].Value = infoEntity.CNTR1;//箱型1
parms[47].Value = infoEntity.CNTR2;//箱型2
parms[48].Value = infoEntity.CNTR3;//箱型3
parms[49].Value = infoEntity.CNTR4;//箱型4
parms[50].Value = infoEntity.CNTR5;//箱型5
parms[51].Value = infoEntity.CNTR6;//箱型6
parms[52].Value = infoEntity.CNTR7;//箱型7
parms[53].Value = infoEntity.CNTR8;//箱型8
parms[54].Value = infoEntity.CNTR9;//箱型9
parms[55].Value = infoEntity.CNTR10;//箱型10
parms[56].Value = infoEntity.OTCNTR;//其他箱型
parms[57].Value = infoEntity.TEU;//箱TEU
parms[58].Value = infoEntity.CNTRTOTAL;//集装箱
//parms[59].Value = infoEntity.INPUTBY;//录入人
parms[59].Value = infoEntity.OP;//操作员
parms[60].Value = infoEntity.CUSTSERVICE;//客服
parms[61].Value = infoEntity.LANE;//航线
parms[62].Value = infoEntity.SALE;//揽货人
parms[63].Value = infoEntity.CARRIER;//船公司
parms[64].Value = infoEntity.FORWARDER;//订舱代理
parms[65].Value = infoEntity.CUSTOMSER;//报关行
parms[66].Value = infoEntity.TRUCKER;//承运车队
parms[67].Value = infoEntity.INVNO;//发票号
parms[68].Value = infoEntity.CARGOID;//货物标识;//CHAR
parms[69].Value = infoEntity.DCLASS;//危险品分类/等级
parms[70].Value = infoEntity.DUNNO;//危险品编号
parms[71].Value = infoEntity.REEFERF;//冷藏通风量
parms[72].Value = infoEntity.TEMPID;//温度单位;//char
parms[73].Value = infoEntity.TEMPSET;//设置温度
parms[74].Value = infoEntity.TEMPMAX;//最高温度
parms[75].Value = infoEntity.TEMPMIN;//最低温度
parms[76].Value = infoEntity.BSSOURCE;//业务来源
parms[77].Value = infoEntity.BSSOURCEDETAIL;//来源明细
parms[78].Value = infoEntity.CUSTOMSNUM;//报关票数
parms[79].Value = infoEntity.CONTRACTNO;//运费协议号
parms[80].Value = infoEntity.ORDTYPE;//订舱类型
parms[81].Value = infoEntity.ORDERNO;//订舱编号
parms[82].Value = infoEntity.INSURANCEER;//保险人
parms[83].Value = infoEntity.INSURANCENO;//保险单号
parms[84].Value = infoEntity.INAMOUT;//保险金额
parms[85].Value = infoEntity.ISVOU;//是否生成凭证
parms[86].Value = infoEntity.VOUNO;//凭证号
parms[87].Value = infoEntity.REMARK;//备注
parms[88].Value = infoEntity.STATUS1;//状态1
parms[89].Value = infoEntity.STATUS2;//状态2
parms[90].Value = infoEntity.STATUS3;//状态3
parms[91].Value = infoEntity.STATUS4;//状态4
parms[92].Value = infoEntity.STATUS5;//状态5
parms[93].Value = infoEntity.ISFUMIGATION;//熏蒸
parms[94].Value = infoEntity.ISSTORAGE;//仓储
parms[95].Value = infoEntity.ISLAND;//陆运
parms[96].Value = infoEntity.ISCUSTOMS;//报关
parms[97].Value = infoEntity.ISINSPECTION;//报检
parms[98].Value = infoEntity.DOC;//单证
parms[99].Value = infoEntity.PACKINGTYPE;//装箱类型
parms[100].Value = infoEntity.WAREHOUSE;//仓库
parms[101].Value = infoEntity.CORPID;//分公司代码
parms[102].Value = infoEntity.SALEDEPT;//所属业务部门
parms[103].Value = infoEntity.MBLFRT;//MBL付费方式
parms[104].Value = infoEntity.ISBOOKING;//订舱
parms[105].Value = infoEntity.ISAGENT;//使用代理
parms[106].Value = infoEntity.ISHBLNO;//分单签单
parms[107].Value = infoEntity.SERVICE9;//服务项目9
parms[108].Value = infoEntity.SERVICE10;//服务项目10
parms[109].Value = infoEntity.STLNAME;//结算方式
parms[110].Value = infoEntity.OPERATORCODE;//
parms[111].Value = infoEntity.OPERATOR;//
parms[112].Value = infoEntity.OPERATOREMAIL;//
parms[113].Value = infoEntity.OPERATORTEL;//
parms[114].Value = infoEntity.OPERATORFAX;//
parms[115].Value = infoEntity.FINANCIALSTAFFCODE;//
parms[116].Value = infoEntity.FINANCIALSTAFF;//
parms[117].Value = infoEntity.FINANCIALSTAFFEMAIL;//
parms[118].Value = infoEntity.FINANCIALSTAFFTEL;//
parms[119].Value = infoEntity.FINANCIALSTAFFFAX;//
parms[120].Value = infoEntity.PlACERECEIPTID;//
parms[121].Value = infoEntity.BLTYPE;//
parms[122].Value = infoEntity.SOURCECODE;//
parms[123].Value = infoEntity.ISCONTAINERSOC;//
parms[124].Value = infoEntity.DPAGE;//
parms[125].Value = infoEntity.DLABEL;//
parms[126].Value = infoEntity.LINKMAN;//
parms[127].Value = infoEntity.VESSELID;//
parms[128].Value = infoEntity.ISSUEPLACEID;//
parms[129].Value = infoEntity.ACCDATE;//
//parms[111].Value = infoEntity.STLDATE;//结算日期
//parms[105].Value = infoEntity.ETD;//开船日期
//parms[106].Value = infoEntity.CLOSINGDATE;//截港日期
//parms[107].Value = infoEntity.ETA;//预抵日期
//parms[108].Value = infoEntity.ISSUEDATE;//签单日期
//parms[109].Value = infoEntity.CLOSEDOCDATE;//截单日期
//parms[110].Value = infoEntity.INTOPORTDATE;//集港日期
//
string strETA = infoEntity.ETA.ToString().IndexOf("0001")>-1 ? "null," : "'" + infoEntity.ETA.ToString() + "',";
string strETA_name = "ETA="; //strETA.Equals("") ? "" : "ETA=";
string strETD = infoEntity.ETD.ToString().IndexOf("0001")>-1 ? "null," : "'" + infoEntity.ETD.ToString() + "',";
string strETD_name = "ETD=";//strETD.Equals("") ? "" : "ETD=";
string strCLOSINGDATE = infoEntity.CLOSINGDATE.ToString().IndexOf("0001")>-1 ? "null," : "'" + infoEntity.CLOSINGDATE.ToString() + "',";
string strCLOSINGDATE_name = "CLOSINGDATE=";//strCLOSINGDATE.Equals("") ? "" : "CLOSINGDATE=";
string strISSUEDATE = infoEntity.ISSUEDATE.ToString().IndexOf("0001")>-1 ? "null," : "'" + infoEntity.ISSUEDATE.ToString() + "',";
string strISSUEDATE_name = "ISSUEDATE=";//strISSUEDATE.Equals("") ? "" : "ISSUEDATE=";
string strCLOSEDOCDATE = infoEntity.CLOSEDOCDATE.ToString().IndexOf("0001")>-1 ? "null," : "'" + infoEntity.CLOSEDOCDATE.ToString() + "',";
string strCLOSEDOCDATE_name = "CLOSEDOCDATE=";//strCLOSEDOCDATE.Equals("") ? "" : "CLOSEDOCDATE=";
string strINTOPORTDATE = infoEntity.INTOPORTDATE.ToString().IndexOf("0001")>-1 ? "null," : "'" + infoEntity.INTOPORTDATE.ToString() + "',";
string strINTOPORTDATE_name = "INTOPORTDATE=";//strINTOPORTDATE.Equals("") ? "" : "INTOPORTDATE=";
string strSTLDATE = infoEntity.STLDATE.ToString().IndexOf("0001")>-1 ? "null," : "'" + infoEntity.STLDATE.ToString() + "',";
string strSTLDATE_name = "STLDATE=";//strSTLDATE.Equals("") ? "" : "STLDATE=";
strSqlUpdateInfo = String.Format(strSqlUpdateInfo, strETA_name, strETA, strETD_name, strETD, strCLOSINGDATE_name, strCLOSINGDATE, strISSUEDATE_name, strISSUEDATE, strCLOSEDOCDATE_name, strCLOSEDOCDATE, strINTOPORTDATE_name, strINTOPORTDATE, strSTLDATE_name, strSTLDATE);
//
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int existVal = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSqlUpdateInfo, parms);
if (existVal > 0)
{
iResult = 1;
//
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新op_seae海运业务信息表','更新操作','BSNO=" + infoEntity.BSNO + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
else
{
iResult = -1;//执行异常
}
}
return iResult;
}
/// <summary>
/// 更新信息
/// </summary>
/// <param name="TopSeaeEntity">实体类</param>
/// <returns>值为1更新数据正常,-1操作异常</returns>
public int UpdateInfoEDI(TopSeaeEntity infoEntity)
{
int iResult = 0;
//获取参数
SqlParameter[] parms = GetUpdateParmsEDI();
parms[0].Value = infoEntity.BSNO;//业务编号
parms[1].Value = infoEntity.MBLNO;//主提单号
parms[2].Value = infoEntity.SHIPPERID;//发货人
parms[3].Value = infoEntity.CONSIGNEEID;//收货人
parms[4].Value = infoEntity.NOTIFYPARTYID;//通知人
parms[5].Value = infoEntity.SHIPPER;//发货人内容
parms[6].Value = infoEntity.CONSIGNEE;//收货人内容
parms[7].Value = infoEntity.NOTIFYPARTY;//通知人内容
parms[8].Value = infoEntity.VESSEL;//船名
parms[9].Value = infoEntity.VOYNO;//航次
parms[10].Value = infoEntity.PORTLOADID;//装货港代码
parms[11].Value = infoEntity.PORTLOAD;//装货港
parms[12].Value = infoEntity.PORTDISCHARGEID;//卸货港代码
parms[13].Value = infoEntity.PORTDISCHARGE;//卸货港
parms[14].Value = infoEntity.PLACEDELIVERYID;//交货地代码
parms[15].Value = infoEntity.PLACEDELIVERY;//交货地
parms[16].Value = infoEntity.DESTINATIONID;//目的地代码
parms[17].Value = infoEntity.DESTINATION;//目的地
parms[18].Value = infoEntity.NOBILL;//提单份数
parms[19].Value = infoEntity.ISSUEPLACE;//签单地点
parms[20].Value = infoEntity.BLFRT;//付费方式
parms[21].Value = infoEntity.PREPARDAT;//预付地点
parms[22].Value = infoEntity.PAYABLEAT;//到付地点
parms[23].Value = infoEntity.SERVICE;//运输条款
parms[24].Value = infoEntity.MARKS;//唛头
parms[25].Value = infoEntity.NOPKGS;//件数包装
parms[26].Value = infoEntity.DESCRIPTION;//货物描述
parms[27].Value = infoEntity.GROSSWEIGHT;//货物毛重
parms[28].Value = infoEntity.MEASUREMENT;//货物尺码
parms[29].Value = infoEntity.PKGS;//件数
parms[30].Value = infoEntity.KINDPKGS;//包装
parms[31].Value = infoEntity.KGS;//毛重
parms[32].Value = infoEntity.CBM;//尺码
parms[33].Value = infoEntity.TOTALNO;//件数大写
parms[34].Value = infoEntity.CNTRNO;//集装箱大写
parms[35].Value = infoEntity.CNTR1;//箱型1
parms[36].Value = infoEntity.CNTR2;//箱型2
parms[37].Value = infoEntity.CNTR3;//箱型3
parms[38].Value = infoEntity.CNTR4;//箱型4
parms[39].Value = infoEntity.CNTR5;//箱型5
parms[40].Value = infoEntity.CNTR6;//箱型6
parms[41].Value = infoEntity.CNTR7;//箱型7
parms[42].Value = infoEntity.CNTR8;//箱型8
parms[43].Value = infoEntity.CNTR9;//箱型9
parms[44].Value = infoEntity.CNTR10;//箱型10
parms[45].Value = infoEntity.OTCNTR;//其他箱型
parms[46].Value = infoEntity.TEU;//箱TEU
parms[47].Value = infoEntity.CNTRTOTAL;//集装箱
parms[48].Value = infoEntity.CARGOID;//货物标识;//CHAR
parms[49].Value = infoEntity.DCLASS;//危险品分类/等级
parms[50].Value = infoEntity.TEMPID;//温度单位;//char
parms[51].Value = infoEntity.TEMPSET;//设置温度
parms[52].Value = infoEntity.ORDERNO;//订舱编号
parms[53].Value = infoEntity.BLTYPE;//装运方式
parms[54].Value = infoEntity.INPUTBY;//录入人
//parms[122].Value = infoEntity.SOURCECODE;//
//parms[123].Value = infoEntity.ISCONTAINERSOC;//
//parms[124].Value = infoEntity.DPAGE;//
//parms[125].Value = infoEntity.DLABEL;//
//parms[126].Value = infoEntity.LINKMAN;//
//parms[105].Value = infoEntity.ETD;//开船日期
//parms[108].Value = infoEntity.ISSUEDATE;//签单日期
//
string strETD = infoEntity.ETD.ToString().IndexOf("0001")>-1 ? "" : ",ETD='" + infoEntity.ETD.ToString() + "'";
string strISSUEDATE = infoEntity.ISSUEDATE.ToString().IndexOf("0001")>-1 ? "" : ",ISSUEDATE='" + infoEntity.ISSUEDATE.ToString() + "'";
strSqlUpdateInfoEDI = String.Format(strSqlUpdateInfoEDI, strETD,strISSUEDATE);
//
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int existVal = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSqlUpdateInfoEDI, parms);
if (existVal > 0)
{
iResult = 1;
//
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新op_seae海运业务信息表','更新操作','BSNO=" + infoEntity.BSNO + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
else
{
iResult = -1;//执行异常
}
}
return iResult;
}
#region 生成插入语句参数
/// <summary>
/// 生成插入语句参数
/// </summary>
/// <returns>返回SqlParameter数组</returns>
private SqlParameter[] GetInsertParms()
{
SqlParameter[] parms = new SqlParameter[]{
new SqlParameter("@BSNO",SqlDbType.VarChar,100),//业务编号
new SqlParameter("@MASTERNO",SqlDbType.VarChar,100),//主编号
new SqlParameter("@BSSTATUS",SqlDbType.Bit),//业务状态
new SqlParameter("@FEESTATUS",SqlDbType.Bit),//费用状态
//new SqlParameter("@BSDATE",SqlDbType.SmallDateTime),//录入日期
new SqlParameter("@ACCDATE",SqlDbType.VarChar,7),//会计期间
new SqlParameter("@MBLNO",SqlDbType.VarChar,30),//主提单号
new SqlParameter("@HBLNO",SqlDbType.VarChar,30),//分提单号
new SqlParameter("@CUSTNO",SqlDbType.VarChar,30),//委托编号
new SqlParameter("@TRANSNO",SqlDbType.VarChar,30),//运单号
new SqlParameter("@CUSTOMERNAME",SqlDbType.VarChar,20),//委托单位
new SqlParameter("@BLTYPE",SqlDbType.VarChar,8),//装运方式
new SqlParameter("@SHIPPERID",SqlDbType.VarChar,20),//发货人
new SqlParameter("@CONSIGNEEID",SqlDbType.VarChar,20),//收货人
new SqlParameter("@NOTIFYPARTYID",SqlDbType.VarChar,20),//通知人
new SqlParameter("@SHIPPER",SqlDbType.VarChar,600),//发货人内容
new SqlParameter("@CONSIGNEE",SqlDbType.VarChar,600),//收货人内容
new SqlParameter("@NOTIFYPARTY",SqlDbType.VarChar,600),//通知人内容
new SqlParameter("@AGENTID",SqlDbType.VarChar,20),//国外代理
new SqlParameter("@AGENT",SqlDbType.VarChar,600),//国外代理内容
new SqlParameter("@YARD",SqlDbType.VarChar,20),//场站
new SqlParameter("@VESSEL",SqlDbType.VarChar,60),//船名
new SqlParameter("@VOYNO",SqlDbType.VarChar,12),//航次
//new SqlParameter("@ETD",SqlDbType.SmallDateTime),//开船日期
//new SqlParameter("@CLOSINGDATE",SqlDbType.SmallDateTime),//截港日期
//new SqlParameter("@ETA",SqlDbType.SmallDateTime),//预抵日期
new SqlParameter("@PlACERECEIPT",SqlDbType.VarChar,60),//收货地
new SqlParameter("@PORTLOADID",SqlDbType.VarChar,36),//装货港代码
new SqlParameter("@PORTLOAD",SqlDbType.VarChar,60),//装货港
new SqlParameter("@PORTDISCHARGEID",SqlDbType.VarChar,36),//卸货港代码
new SqlParameter("@PORTDISCHARGE",SqlDbType.VarChar,60),//卸货港
new SqlParameter("@PLACEDELIVERYID",SqlDbType.VarChar,36),//交货地代码
new SqlParameter("@PLACEDELIVERY",SqlDbType.VarChar,60),//交货地
new SqlParameter("@DESTINATIONID",SqlDbType.VarChar,36),//目的地代码
new SqlParameter("@DESTINATION",SqlDbType.VarChar,60),//目的地
new SqlParameter("@NOBILL",SqlDbType.VarChar,5),//提单份数
new SqlParameter("@ISSUETYPE",SqlDbType.VarChar,12),//签单方式
//new SqlParameter("@ISSUEDATE",SqlDbType.SmallDateTime),//签单日期
new SqlParameter("@ISSUEPLACE",SqlDbType.VarChar,60),//签单地点
new SqlParameter("@BLFRT",SqlDbType.VarChar,20),//付费方式
new SqlParameter("@PREPARDAT",SqlDbType.VarChar,50),//预付地点
new SqlParameter("@PAYABLEAT",SqlDbType.VarChar,50),//到付地点
new SqlParameter("@SERVICE",SqlDbType.VarChar,10),//运输条款
new SqlParameter("@MARKS",SqlDbType.VarChar,600),//唛头
new SqlParameter("@CNTRSEALNO",SqlDbType.VarChar,4000),//箱号封号
new SqlParameter("@NOPKGS",SqlDbType.VarChar,120),//件数包装
new SqlParameter("@DESCRIPTION",SqlDbType.VarChar,600),//货物描述
new SqlParameter("@GOODSNAME",SqlDbType.VarChar,30),//品名
new SqlParameter("@GROSSWEIGHT",SqlDbType.VarChar,600),//货物毛重
new SqlParameter("@MEASUREMENT",SqlDbType.VarChar,600),//货物尺码
new SqlParameter("@PKGS",SqlDbType.Int),//件数
new SqlParameter("@KINDPKGS",SqlDbType.VarChar,20),//包装
new SqlParameter("@KGS",SqlDbType.Decimal),//毛重
new SqlParameter("@CBM",SqlDbType.Decimal),//尺码
new SqlParameter("@TOTALNO",SqlDbType.VarChar,100),//件数大写
new SqlParameter("@CNTRNO",SqlDbType.VarChar,100),//集装箱大写
new SqlParameter("@CNTR1",SqlDbType.Int),//箱型1
new SqlParameter("@CNTR2",SqlDbType.Int),//箱型2
new SqlParameter("@CNTR3",SqlDbType.Int),//箱型3
new SqlParameter("@CNTR4",SqlDbType.Int),//箱型4
new SqlParameter("@CNTR5",SqlDbType.Int),//箱型5
new SqlParameter("@CNTR6",SqlDbType.Int),//箱型6
new SqlParameter("@CNTR7",SqlDbType.Int),//箱型7
new SqlParameter("@CNTR8",SqlDbType.Int),//箱型8
new SqlParameter("@CNTR9",SqlDbType.Int),//箱型9
new SqlParameter("@CNTR10",SqlDbType.Int),//箱型10
new SqlParameter("@OTCNTR",SqlDbType.Int),//其他箱型
new SqlParameter("@TEU",SqlDbType.Int),//箱TEU
new SqlParameter("@CNTRTOTAL",SqlDbType.VarChar,4000),//集装箱
new SqlParameter("@INPUTBY",SqlDbType.VarChar,10),//录入人
new SqlParameter("@OP",SqlDbType.VarChar,10),//操作员
new SqlParameter("@CUSTSERVICE",SqlDbType.VarChar,10),//客服
new SqlParameter("@LANE",SqlDbType.VarChar,30),//航线
new SqlParameter("@SALE",SqlDbType.VarChar,10),//揽货人
new SqlParameter("@CARRIER",SqlDbType.VarChar,20),//船公司
new SqlParameter("@FORWARDER",SqlDbType.VarChar,20),//订舱代理
new SqlParameter("@CUSTOMSER",SqlDbType.VarChar,20),//报关行
new SqlParameter("@TRUCKER",SqlDbType.VarChar,20),//承运车队
new SqlParameter("@INVNO",SqlDbType.VarChar,20),//发票号
new SqlParameter("@CARGOID",SqlDbType.Char,1),//货物标识
new SqlParameter("@DCLASS",SqlDbType.VarChar,5),//危险品分类/等级
new SqlParameter("@DUNNO",SqlDbType.VarChar,16),//危险品编号
new SqlParameter("@REEFERF",SqlDbType.VarChar,5),//冷藏通风量
new SqlParameter("@TEMPID",SqlDbType.Char,1),//温度单位
new SqlParameter("@TEMPSET",SqlDbType.VarChar,5),//设置温度
new SqlParameter("@TEMPMAX",SqlDbType.VarChar,5),//最高温度
new SqlParameter("@TEMPMIN",SqlDbType.VarChar,5),//最低温度
new SqlParameter("@BSSOURCE",SqlDbType.VarChar,36),//业务来源
new SqlParameter("@BSSOURCEDETAIL",SqlDbType.VarChar,36),//来源明细
new SqlParameter("@CUSTOMSNUM",SqlDbType.SmallInt),//报关票数
new SqlParameter("@CONTRACTNO",SqlDbType.VarChar,100),//运费协议号
new SqlParameter("@ORDTYPE",SqlDbType.VarChar,10),//订舱类型
new SqlParameter("@ORDERNO",SqlDbType.VarChar,20),//订舱编号
new SqlParameter("@INSURANCEER",SqlDbType.VarChar,30),//保险人
new SqlParameter("@INSURANCENO",SqlDbType.VarChar,20),//保险单号
new SqlParameter("@INAMOUT",SqlDbType.Decimal),//保险金额
new SqlParameter("@ISVOU",SqlDbType.Bit),//是否生成凭证
new SqlParameter("@VOUNO",SqlDbType.VarChar,12),//凭证号
new SqlParameter("@REMARK",SqlDbType.VarChar,4000),//备注
new SqlParameter("@STATUS1",SqlDbType.Bit),//状态1
new SqlParameter("@STATUS2",SqlDbType.Bit),//状态2
new SqlParameter("@STATUS3",SqlDbType.Bit),//状态3
new SqlParameter("@STATUS4",SqlDbType.Bit),//状态4
new SqlParameter("@STATUS5",SqlDbType.Bit),//状态5
new SqlParameter("@ISFUMIGATION",SqlDbType.Bit),//熏蒸
new SqlParameter("@ISSTORAGE",SqlDbType.Bit),//仓储
new SqlParameter("@ISLAND",SqlDbType.Bit),//陆运
new SqlParameter("@ISCUSTOMS",SqlDbType.Bit),//报关
new SqlParameter("@ISINSPECTION",SqlDbType.Bit),//报检
new SqlParameter("@DOC",SqlDbType.VarChar,10),//单证
new SqlParameter("@PACKINGTYPE",SqlDbType.VarChar,10),//装箱类型
new SqlParameter("@WAREHOUSE",SqlDbType.VarChar,20),//仓库
//new SqlParameter("@CLOSEDOCDATE",SqlDbType.SmallDateTime),//截单日期
//new SqlParameter("@INTOPORTDATE",SqlDbType.SmallDateTime),//集港日期
new SqlParameter("@CORPID",SqlDbType.VarChar,36),//分公司代码
new SqlParameter("@SALEDEPT",SqlDbType.VarChar,20),//所属业务部门
new SqlParameter("@MBLFRT",SqlDbType.VarChar,20),//MBL付费方式
new SqlParameter("@ISBOOKING",SqlDbType.Bit),//订舱
new SqlParameter("@ISAGENT",SqlDbType.Bit),//使用代理
new SqlParameter("@ISHBLNO",SqlDbType.Bit),//分单签单
new SqlParameter("@SERVICE9",SqlDbType.Bit),//服务项目9
new SqlParameter("@SERVICE10",SqlDbType.Bit),//服务项目10
new SqlParameter("@STLNAME",SqlDbType.VarChar,6),//结算方式
new SqlParameter("@ORDERTYPE",SqlDbType.VarChar,10),//委托方式
new SqlParameter("@OPERATORCODE",SqlDbType.VarChar,6),// 客户操作代码
new SqlParameter("@OPERATOR",SqlDbType.VarChar,20),// 客户操作名称
new SqlParameter("@OPERATOREMAIL",SqlDbType.VarChar,50),// 操作电子邮箱
new SqlParameter("@OPERATORTEL",SqlDbType.VarChar,50),// 操作电话
new SqlParameter("@OPERATORFAX",SqlDbType.VarChar,50),// 操作传真
new SqlParameter("@FINANCIALSTAFFCODE",SqlDbType.VarChar,6),// 客户财务代码
new SqlParameter("@FINANCIALSTAFF",SqlDbType.VarChar,20),// 客户财务名称
new SqlParameter("@FINANCIALSTAFFEMAIL",SqlDbType.VarChar,50),// 财务电子邮箱
new SqlParameter("@FINANCIALSTAFFTEL",SqlDbType.VarChar,50),// 财务电话
new SqlParameter("@FINANCIALSTAFFFAX",SqlDbType.VarChar,50),// 财务传真
new SqlParameter("@PlACERECEIPTID",SqlDbType.VarChar,36),//收货地代码
new SqlParameter("@SOURCECODE",SqlDbType.VarChar,1),//集装箱(器)来源代码
new SqlParameter("@ISCONTAINERSOC",SqlDbType.Bit),//货主箱标志,是否自有箱
new SqlParameter("@DPAGE",SqlDbType.VarChar,7),//危险品页号
new SqlParameter("@DLABEL",SqlDbType.VarChar,32),//危险品标签
new SqlParameter("@LINKMAN",SqlDbType.VarChar,35),//危险品联系人
new SqlParameter("@VESSELID",SqlDbType.VarChar,9),//
new SqlParameter("@ISSUEPLACEID",SqlDbType.VarChar,5)//
//new SqlParameter("@STLNAME",SqlDbType.DateTime)//结算日期
};
return parms;
}
#endregion
#region 生成更新语句参数
/// <summary>
/// 生成更新语句参数
/// </summary>
/// <returns>返回SqlParameter数组</returns>
private SqlParameter[] GetUpdateParms()
{
SqlParameter[] parms = new SqlParameter[]{
new SqlParameter("@BSNO",SqlDbType.VarChar,100),//业务编号
new SqlParameter("@MBLNO",SqlDbType.VarChar,30),//主提单号
new SqlParameter("@HBLNO",SqlDbType.VarChar,30),//分提单号
new SqlParameter("@CUSTNO",SqlDbType.VarChar,30),//委托编号
new SqlParameter("@TRANSNO",SqlDbType.VarChar,30),//运单号
new SqlParameter("@CUSTOMERNAME",SqlDbType.VarChar,20),//委托单位
new SqlParameter("@SHIPPERID",SqlDbType.VarChar,20),//发货人
new SqlParameter("@CONSIGNEEID",SqlDbType.VarChar,20),//收货人
new SqlParameter("@NOTIFYPARTYID",SqlDbType.VarChar,20),//通知人
new SqlParameter("@SHIPPER",SqlDbType.VarChar,600),//发货人内容
new SqlParameter("@CONSIGNEE",SqlDbType.VarChar,600),//收货人内容
new SqlParameter("@NOTIFYPARTY",SqlDbType.VarChar,600),//通知人内容
new SqlParameter("@AGENTID",SqlDbType.VarChar,20),//国外代理
new SqlParameter("@AGENT",SqlDbType.VarChar,600),//国外代理内容
new SqlParameter("@YARD",SqlDbType.VarChar,20),//场站
new SqlParameter("@VESSEL",SqlDbType.VarChar,60),//船名
new SqlParameter("@VOYNO",SqlDbType.VarChar,12),//航次
//new SqlParameter("@ETD",SqlDbType.SmallDateTime),//开船日期
//new SqlParameter("@CLOSINGDATE",SqlDbType.SmallDateTime),//截港日期
//new SqlParameter("@ETA",SqlDbType.SmallDateTime),//预抵日期
new SqlParameter("@PlACERECEIPT",SqlDbType.VarChar,60),//收货地
new SqlParameter("@PORTLOADID",SqlDbType.VarChar,36),//装货港代码
new SqlParameter("@PORTLOAD",SqlDbType.VarChar,60),//装货港
new SqlParameter("@PORTDISCHARGEID",SqlDbType.VarChar,36),//卸货港代码
new SqlParameter("@PORTDISCHARGE",SqlDbType.VarChar,60),//卸货港
new SqlParameter("@PLACEDELIVERYID",SqlDbType.VarChar,36),//交货地代码
new SqlParameter("@PLACEDELIVERY",SqlDbType.VarChar,60),//交货地
new SqlParameter("@DESTINATIONID",SqlDbType.VarChar,36),//目的地代码
new SqlParameter("@DESTINATION",SqlDbType.VarChar,60),//目的地
new SqlParameter("@NOBILL",SqlDbType.VarChar,5),//提单份数
new SqlParameter("@ISSUETYPE",SqlDbType.VarChar,12),//签单方式
//new SqlParameter("@ISSUEDATE",SqlDbType.SmallDateTime),//签单日期
new SqlParameter("@ISSUEPLACE",SqlDbType.VarChar,60),//签单地点
new SqlParameter("@BLFRT",SqlDbType.VarChar,20),//付费方式
new SqlParameter("@PREPARDAT",SqlDbType.VarChar,50),//预付地点
new SqlParameter("@PAYABLEAT",SqlDbType.VarChar,50),//到付地点
new SqlParameter("@SERVICE",SqlDbType.VarChar,10),//运输条款
new SqlParameter("@MARKS",SqlDbType.VarChar,600),//唛头
new SqlParameter("@CNTRSEALNO",SqlDbType.VarChar,4000),//箱号封号
new SqlParameter("@NOPKGS",SqlDbType.VarChar,120),//件数包装
new SqlParameter("@DESCRIPTION",SqlDbType.VarChar,600),//货物描述
new SqlParameter("@GOODSNAME",SqlDbType.VarChar,30),//品名
new SqlParameter("@GROSSWEIGHT",SqlDbType.VarChar,600),//货物毛重
new SqlParameter("@MEASUREMENT",SqlDbType.VarChar,600),//货物尺码
new SqlParameter("@PKGS",SqlDbType.Int),//件数
new SqlParameter("@KINDPKGS",SqlDbType.VarChar,20),//包装
new SqlParameter("@KGS",SqlDbType.Decimal),//毛重
new SqlParameter("@CBM",SqlDbType.Decimal),//尺码
new SqlParameter("@TOTALNO",SqlDbType.VarChar,100),//件数大写
new SqlParameter("@CNTRNO",SqlDbType.VarChar,100),//集装箱大写
new SqlParameter("@CNTR1",SqlDbType.Int),//箱型1
new SqlParameter("@CNTR2",SqlDbType.Int),//箱型2
new SqlParameter("@CNTR3",SqlDbType.Int),//箱型3
new SqlParameter("@CNTR4",SqlDbType.Int),//箱型4
new SqlParameter("@CNTR5",SqlDbType.Int),//箱型5
new SqlParameter("@CNTR6",SqlDbType.Int),//箱型6
new SqlParameter("@CNTR7",SqlDbType.Int),//箱型7
new SqlParameter("@CNTR8",SqlDbType.Int),//箱型8
new SqlParameter("@CNTR9",SqlDbType.Int),//箱型9
new SqlParameter("@CNTR10",SqlDbType.Int),//箱型10
new SqlParameter("@OTCNTR",SqlDbType.Int),//其他箱型
new SqlParameter("@TEU",SqlDbType.Int),//箱TEU
new SqlParameter("@CNTRTOTAL",SqlDbType.VarChar,4000),//集装箱
//new SqlParameter("@INPUTBY",SqlDbType.VarChar,10),//录入人
new SqlParameter("@OP",SqlDbType.VarChar,10),//操作员
new SqlParameter("@CUSTSERVICE",SqlDbType.VarChar,10),//客服
new SqlParameter("@LANE",SqlDbType.VarChar,30),//航线
new SqlParameter("@SALE",SqlDbType.VarChar,10),//揽货人
new SqlParameter("@CARRIER",SqlDbType.VarChar,20),//船公司
new SqlParameter("@FORWARDER",SqlDbType.VarChar,20),//订舱代理
new SqlParameter("@CUSTOMSER",SqlDbType.VarChar,20),//报关行
new SqlParameter("@TRUCKER",SqlDbType.VarChar,20),//承运车队
new SqlParameter("@INVNO",SqlDbType.VarChar,20),//发票号
new SqlParameter("@CARGOID",SqlDbType.Char,1),//货物标识
new SqlParameter("@DCLASS",SqlDbType.VarChar,5),//危险品分类/等级
new SqlParameter("@DUNNO",SqlDbType.VarChar,16),//危险品编号
new SqlParameter("@REEFERF",SqlDbType.VarChar,5),//冷藏通风量
new SqlParameter("@TEMPID",SqlDbType.Char,1),//温度单位
new SqlParameter("@TEMPSET",SqlDbType.VarChar,5),//设置温度
new SqlParameter("@TEMPMAX",SqlDbType.VarChar,5),//最高温度
new SqlParameter("@TEMPMIN",SqlDbType.VarChar,5),//最低温度
new SqlParameter("@BSSOURCE",SqlDbType.VarChar,36),//业务来源
new SqlParameter("@BSSOURCEDETAIL",SqlDbType.VarChar,36),//来源明细
new SqlParameter("@CUSTOMSNUM",SqlDbType.SmallInt),//报关票数
new SqlParameter("@CONTRACTNO",SqlDbType.VarChar,100),//运费协议号
new SqlParameter("@ORDTYPE",SqlDbType.VarChar,10),//订舱类型
new SqlParameter("@ORDERNO",SqlDbType.VarChar,20),//订舱编号
new SqlParameter("@INSURANCEER",SqlDbType.VarChar,30),//保险人
new SqlParameter("@INSURANCENO",SqlDbType.VarChar,20),//保险单号
new SqlParameter("@INAMOUT",SqlDbType.Decimal),//保险金额
new SqlParameter("@ISVOU",SqlDbType.Bit),//是否生成凭证
new SqlParameter("@VOUNO",SqlDbType.VarChar,12),//凭证号
new SqlParameter("@REMARK",SqlDbType.VarChar,4000),//备注
new SqlParameter("@STATUS1",SqlDbType.Bit),//状态1
new SqlParameter("@STATUS2",SqlDbType.Bit),//状态2
new SqlParameter("@STATUS3",SqlDbType.Bit),//状态3
new SqlParameter("@STATUS4",SqlDbType.Bit),//状态4
new SqlParameter("@STATUS5",SqlDbType.Bit),//状态5
new SqlParameter("@ISFUMIGATION",SqlDbType.Bit),//熏蒸
new SqlParameter("@ISSTORAGE",SqlDbType.Bit),//仓储
new SqlParameter("@ISLAND",SqlDbType.Bit),//陆运
new SqlParameter("@ISCUSTOMS",SqlDbType.Bit),//报关
new SqlParameter("@ISINSPECTION",SqlDbType.Bit),//报检
new SqlParameter("@DOC",SqlDbType.VarChar,10),//单证
new SqlParameter("@PACKINGTYPE",SqlDbType.VarChar,10),//装箱类型
new SqlParameter("@WAREHOUSE",SqlDbType.VarChar,20),//仓库
//new SqlParameter("@CLOSEDOCDATE",SqlDbType.SmallDateTime),//截单日期
//new SqlParameter("@INTOPORTDATE",SqlDbType.SmallDateTime),//集港日期
new SqlParameter("@CORPID",SqlDbType.VarChar,36),//分公司代码
new SqlParameter("@SALEDEPT",SqlDbType.VarChar,20),//所属业务部门
new SqlParameter("@MBLFRT",SqlDbType.VarChar,20),//MBL付费方式
new SqlParameter("@ISBOOKING",SqlDbType.Bit),//订舱
new SqlParameter("@ISAGENT",SqlDbType.Bit),//使用代理
new SqlParameter("@ISHBLNO",SqlDbType.Bit),//分单签单
new SqlParameter("@SERVICE9",SqlDbType.Bit),//服务项目9
new SqlParameter("@SERVICE10",SqlDbType.Bit),//服务项目10
new SqlParameter("@STLNAME",SqlDbType.VarChar,6),//结算方式
new SqlParameter("@OPERATORCODE",SqlDbType.VarChar,6),// 客户操作代码
new SqlParameter("@OPERATOR",SqlDbType.VarChar,20),// 客户操作名称
new SqlParameter("@OPERATOREMAIL",SqlDbType.VarChar,50),// 操作电子邮箱
new SqlParameter("@OPERATORTEL",SqlDbType.VarChar,50),// 操作电话
new SqlParameter("@OPERATORFAX",SqlDbType.VarChar,50),// 操作传真
new SqlParameter("@FINANCIALSTAFFCODE",SqlDbType.VarChar,6),// 客户财务代码
new SqlParameter("@FINANCIALSTAFF",SqlDbType.VarChar,20),// 客户财务名称
new SqlParameter("@FINANCIALSTAFFEMAIL",SqlDbType.VarChar,50),// 财务电子邮箱
new SqlParameter("@FINANCIALSTAFFTEL",SqlDbType.VarChar,50),// 财务电话
new SqlParameter("@FINANCIALSTAFFFAX",SqlDbType.VarChar,50),// 财务传真
new SqlParameter("@PlACERECEIPTID",SqlDbType.VarChar,36),//收货地代码
new SqlParameter("@BLTYPE",SqlDbType.VarChar,8),//装运方式
new SqlParameter("@SOURCECODE",SqlDbType.VarChar,1),//集装箱(器)来源代码
new SqlParameter("@ISCONTAINERSOC",SqlDbType.Bit),//货主箱标志,是否自有箱
new SqlParameter("@DPAGE",SqlDbType.VarChar,7),//危险品页号
new SqlParameter("@DLABEL",SqlDbType.VarChar,32),//危险品标签
new SqlParameter("@LINKMAN",SqlDbType.VarChar,35),//危险品联系人
new SqlParameter("@VESSELID",SqlDbType.VarChar,9),//
new SqlParameter("@ISSUEPLACEID",SqlDbType.VarChar,5),//
new SqlParameter("@ACCDATE",SqlDbType.VarChar,7)//
//new SqlParameter("@STLNAME",SqlDbType.DateTime)//结算日期
};
return parms;
}
#endregion
#region 生成更新语句参数
/// <summary>
/// 生成更新语句参数
/// </summary>
/// <returns>返回SqlParameter数组</returns>
private SqlParameter[] GetUpdateParmsEDI()
{
SqlParameter[] parms = new SqlParameter[]{
new SqlParameter("@BSNO",SqlDbType.VarChar,100),//业务编号
new SqlParameter("@MBLNO",SqlDbType.VarChar,30),//主提单号
new SqlParameter("@SHIPPERID",SqlDbType.VarChar,20),//发货人
new SqlParameter("@CONSIGNEEID",SqlDbType.VarChar,20),//收货人
new SqlParameter("@NOTIFYPARTYID",SqlDbType.VarChar,20),//通知人
new SqlParameter("@SHIPPER",SqlDbType.VarChar,600),//发货人内容
new SqlParameter("@CONSIGNEE",SqlDbType.VarChar,600),//收货人内容
new SqlParameter("@NOTIFYPARTY",SqlDbType.VarChar,600),//通知人内容
new SqlParameter("@VESSEL",SqlDbType.VarChar,60),//船名
new SqlParameter("@VOYNO",SqlDbType.VarChar,12),//航次
new SqlParameter("@PORTLOADID",SqlDbType.VarChar,36),//装货港代码
new SqlParameter("@PORTLOAD",SqlDbType.VarChar,60),//装货港
new SqlParameter("@PORTDISCHARGEID",SqlDbType.VarChar,36),//卸货港代码
new SqlParameter("@PORTDISCHARGE",SqlDbType.VarChar,60),//卸货港
new SqlParameter("@PLACEDELIVERYID",SqlDbType.VarChar,36),//交货地代码
new SqlParameter("@PLACEDELIVERY",SqlDbType.VarChar,60),//交货地
new SqlParameter("@DESTINATIONID",SqlDbType.VarChar,36),//目的地代码
new SqlParameter("@DESTINATION",SqlDbType.VarChar,60),//目的地
new SqlParameter("@NOBILL",SqlDbType.VarChar,5),//提单份数
new SqlParameter("@ISSUEPLACE",SqlDbType.VarChar,60),//签单地点
new SqlParameter("@BLFRT",SqlDbType.VarChar,20),//付费方式
new SqlParameter("@PREPARDAT",SqlDbType.VarChar,50),//预付地点
new SqlParameter("@PAYABLEAT",SqlDbType.VarChar,50),//到付地点
new SqlParameter("@SERVICE",SqlDbType.VarChar,10),//运输条款
new SqlParameter("@MARKS",SqlDbType.VarChar,600),//唛头
new SqlParameter("@NOPKGS",SqlDbType.VarChar,120),//件数包装
new SqlParameter("@DESCRIPTION",SqlDbType.VarChar,600),//货物描述
new SqlParameter("@GROSSWEIGHT",SqlDbType.VarChar,600),//货物毛重
new SqlParameter("@MEASUREMENT",SqlDbType.VarChar,600),//货物尺码
new SqlParameter("@PKGS",SqlDbType.Int),//件数
new SqlParameter("@KINDPKGS",SqlDbType.VarChar,20),//包装
new SqlParameter("@KGS",SqlDbType.Decimal),//毛重
new SqlParameter("@CBM",SqlDbType.Decimal),//尺码
new SqlParameter("@TOTALNO",SqlDbType.VarChar,100),//件数大写
new SqlParameter("@CNTRNO",SqlDbType.VarChar,100),//集装箱大写
new SqlParameter("@CNTR1",SqlDbType.Int),//箱型1
new SqlParameter("@CNTR2",SqlDbType.Int),//箱型2
new SqlParameter("@CNTR3",SqlDbType.Int),//箱型3
new SqlParameter("@CNTR4",SqlDbType.Int),//箱型4
new SqlParameter("@CNTR5",SqlDbType.Int),//箱型5
new SqlParameter("@CNTR6",SqlDbType.Int),//箱型6
new SqlParameter("@CNTR7",SqlDbType.Int),//箱型7
new SqlParameter("@CNTR8",SqlDbType.Int),//箱型8
new SqlParameter("@CNTR9",SqlDbType.Int),//箱型9
new SqlParameter("@CNTR10",SqlDbType.Int),//箱型10
new SqlParameter("@OTCNTR",SqlDbType.Int),//其他箱型
new SqlParameter("@TEU",SqlDbType.Int),//箱TEU
new SqlParameter("@CNTRTOTAL",SqlDbType.VarChar,4000),//集装箱
new SqlParameter("@CARGOID",SqlDbType.Char,1),//货物标识
new SqlParameter("@DCLASS",SqlDbType.VarChar,5),//危险品分类/等级
new SqlParameter("@TEMPID",SqlDbType.Char,1),//温度单位
new SqlParameter("@TEMPSET",SqlDbType.VarChar,5),//设置温度
new SqlParameter("@ORDERNO",SqlDbType.VarChar,20),//订舱编号
new SqlParameter("@BLTYPE",SqlDbType.VarChar,8),//装运方式
new SqlParameter("@INPUTBY",SqlDbType.VarChar,10)//录入人
};
return parms;
}
#endregion
#region 返回所有海运出口数据集
/// <summary>
/// 返回所有海运出口数据集
/// </summary>
/// <param name="strSql"></param>
/// <returns></returns>
public DataSet GetSeaExportList()
{
DataSet userSet = new DataSet();
userSet = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_SELECT_INFO);
return userSet;
}
#endregion
#region 根据SQL语句查询海运出口数据集
/// <summary>
/// 根据SQL语句查询海运出口数据集
/// </summary>
/// <param name="strSql"></param>
/// <returns></returns>
public DataSet GetExcuteSql(string strSql)
{
DataSet userSet = new DataSet();
userSet = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSql);
return userSet;
}
#endregion
#region 根据SQL语句查询海运出口数据集
/// <summary>
/// 返回 某字段
/// </summary>
/// <returns></returns>
public DataSet GetFieldAll(string strBSNO)
{
string str = "select * from op_seae where BSNO='" + strBSNO + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
#endregion
#region 获取海运出口委托记录总页数
/// <summary>
/// 获取海运出口委托记录总页数
/// </summary>
/// <param name="strSql">sql查询语句</param>
/// <returns>返回int型海运出口委托记录总页数</returns>
public int GetPageTotal(string strSql)
{
int iResult = 0;
using (SqlDataReader sqlRead = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSql, null))
{
try
{
while (sqlRead.Read())
{
iResult = sqlRead.GetInt32(0);
}
}
catch (Exception error)
{
throw error;
}
}
return iResult;
}
#endregion
#region 删除委托信息
/// <summary>
/// 删除委托信息
/// </summary>
/// <param name="tempBSNO">委托信息GID</param>
/// <returns>值1表示删除成功 值-1表示有异常删除失败 值-2表示插入异常,事务已回滚成功</returns>
public int DeleteOrder(string tempBSNO)
{
int iResult = 0;
SqlParameter parm = new SqlParameter(PARM_SEAE_BSNO, SqlDbType.VarChar, 100);
parm.Value = tempBSNO;
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_DELETE_INFO, parm);
iResult = 1;//状态为1表示删除成功
sqlTran.Commit();
}
catch (Exception execError)
{
iResult = -1;//有异常,删除失败
sqlTran.Rollback();
iResult = -2;//插入异常,事务已回滚成功
throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
return iResult;
}
#endregion
#region 提取规则编号
/// <summary>
/// 提取规则编号
/// </summary>
/// <param name="strRULENAME">规则项目名称</param>
/// <param name="strfield">需要加规则的字段</param>
/// <returns></returns>
protected String getCodeRule(string strRULENAME, string strfield, string strETD, string strACCDATE, string strUserID, string strCompanyID)
{
//调用编码规则
if (strETD.Trim().IndexOf("0001")>-1)
{
strETD = "";
}
string strRULEYEAR = "";
string strRULECONTENT = "";
string strCODENAME = "";
string strDEPTNO = "";
string strRULENOLENGTH = "";
int iRULENOLENGTH = 0;
int inum = 0;
string strCONTENT = "";
T_ALL_DA T_ALL_DA = new T_ALL_DA();
//
DataSet ds = T_ALL_DA.GetAllSQL("select * from code_rule where RULENAME='" + strRULENAME.Trim() + "' and RULETYPE=1");
if (ds != null)
{
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["ISSTARTUSING"].ToString().Trim().Equals("True"))
{
if (ds.Tables[0].Rows[0]["RULEDATE"].ToString().Trim().Equals("业务日期"))
{
if (strETD.Trim() == "")
{
return "";
}
DateTime dETD = System.Convert.ToDateTime(strETD.Trim());
if (ds.Tables[0].Rows[0]["ISCLEAREDINEARLY"].ToString().Trim().Equals("True"))
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dETD.ToString("yyyy") + dETD.ToString("MM");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dETD.ToString("yy") + dETD.ToString("MM");
}
}
else
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dETD.ToString("yyyy");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dETD.ToString("yy");
}
}
}
else if (ds.Tables[0].Rows[0]["RULEDATE"].ToString().Trim().Equals("会计期间"))
{
if (strACCDATE.Trim() == "")
{
return "";
}
DateTime dACCDATE = System.Convert.ToDateTime(strACCDATE.Trim() + "-01");
if (ds.Tables[0].Rows[0]["ISCLEAREDINEARLY"].ToString().Trim().Equals("True"))
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dACCDATE.ToString("yyyy") + dACCDATE.ToString("MM");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dACCDATE.ToString("yy") + dACCDATE.ToString("MM");
}
}
else
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dACCDATE.ToString("yyyy");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dACCDATE.ToString("yy");
}
}
}
else if (ds.Tables[0].Rows[0]["RULEDATE"].ToString().Trim().Equals("自然月份"))
{
DateTime fwqdate = System.Convert.ToDateTime(T_ALL_DA.GetStrSQL("fwqdate", "select fwqdate=getdate()"));
if (ds.Tables[0].Rows[0]["ISCLEAREDINEARLY"].ToString().Trim().Equals("True"))
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = fwqdate.ToString("yyyy") + fwqdate.ToString("MM");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = fwqdate.ToString("yy") + fwqdate.ToString("MM");
}
}
else
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = fwqdate.ToString("yyyy");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = fwqdate.ToString("yy");
}
}
}
//
if (ds.Tables[0].Rows[0]["ISCOMPANY"].ToString().Trim().Equals("True"))
{
strCODENAME = T_ALL_DA.GetStrSQL("CODENAME", "select CODENAME from [company] where GID=(select top 1 COMPANYID from user_company where USERID='" + strUserID.Trim() + "')");
}
if (ds.Tables[0].Rows[0]["ISDEPT"].ToString().Trim().Equals("True"))
{
strDEPTNO = T_ALL_DA.GetStrSQL("DEPTNO", "select DEPTNO from [sys_dept] where LINKID=(select top 1 COMPANYID from user_company where USERID='" + strUserID.Trim() + "')");
}
strRULECONTENT = ds.Tables[0].Rows[0]["RULECONTENT"].ToString().Trim();
strRULECONTENT = strRULECONTENT.Replace("《COMPANY》", strCODENAME);
strRULECONTENT = strRULECONTENT.Replace("《DEPT》", strDEPTNO);
//
iRULENOLENGTH = int.Parse(ds.Tables[0].Rows[0]["RULENOLENGTH"].ToString().Trim());
strCONTENT = strRULECONTENT + strRULEYEAR;
//获取分公司的票号头字符
string tempBANKSHEAD = T_ALL_DA.GetStrSQL("BANKSHEAD", "SELECT TOP 1 BANKSHEAD FROM company WHERE GID='" + strCompanyID.Trim() + "'");
strCONTENT = tempBANKSHEAD + strCONTENT;
//
strRULENOLENGTH = T_ALL_DA.GetStrSQL(strfield, "select top 1 " + strfield + " from [op_seae] where " + strfield + " like '" + strCONTENT.Trim() + "%' order by " + strfield + " DESC");
if (strRULENOLENGTH == "")
{
strRULENOLENGTH = "1";
}
else
{
strRULENOLENGTH = strRULENOLENGTH.Replace(strCONTENT.Trim(), "");
inum = int.Parse(strRULENOLENGTH.Trim());
inum = inum + 1;
strRULENOLENGTH = inum.ToString();
}
int j = iRULENOLENGTH - strRULENOLENGTH.Length;
for (int i = 1; i <= j; i++)
{
strRULENOLENGTH = "0" + strRULENOLENGTH;
}
//
strCONTENT = strCONTENT + strRULENOLENGTH;
return strCONTENT;
}
}
}
return "";
}
#endregion
#region 委托业务费用加锁
/// <summary>
/// 委托业务费用加锁
/// </summary>
/// <param name="tempBSNO">委托业务编号</param>
/// <returns>值等于1表示加锁成功 值不等于1表示加锁失败</returns>
public int LockFeeStatus(string tempBSNO)
{
int iResult = 0;
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
SqlParameter[] parms = new SqlParameter[] {
new SqlParameter(PARM_SEAE_BSNO,SqlDbType.VarChar,100)
};
parms[0].Value = tempBSNO;
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, SQL_UPDATE_OP_SEAE_FEE_LOCK, parms);
sqlTran.Commit();
iResult = 1;//状态为1表示更新成功
}
catch (Exception execError)
{
iResult = -1;//有异常,更新失败
sqlTran.Rollback();
iResult = -2;//更新异常,事务已回滚成功
throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
return iResult;
}
#endregion
#region 委托业务费用解锁
/// <summary>
/// 委托业务费用解锁
/// </summary>
/// <param name="tempBSNO">委托业务编号</param>
/// <returns>值等于1表示解锁成功 值不等于1表示解锁失败</returns>
public int UnLockFeeStatus(string tempBSNO)
{
int iResult = 0;
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
SqlParameter[] parms = new SqlParameter[] {
new SqlParameter(PARM_SEAE_BSNO,SqlDbType.VarChar,100)
};
parms[0].Value = tempBSNO;
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, SQL_UPDATE_OP_SEAE_FEE_UNLOCK, parms);
sqlTran.Commit();
iResult = 1;//状态为1表示更新成功
}
catch (Exception execError)
{
iResult = -1;//有异常,更新失败
sqlTran.Rollback();
iResult = -2;//更新异常,事务已回滚成功
throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
return iResult;
}
#endregion
}
}