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.

1566 lines
107 KiB
C#

10 months ago
using System;
using System.Data;
using System.Configuration;
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 DSWeb.DataAccess;
using DSWeb.Models;
using System.Data.SqlClient;
using System.Collections.Generic;
namespace DSWeb.EntityDA
{
public class CrmSeaeorderDA
{
//ch_fee
#region CH_FEE
private const string PARM_FEE_GID = "@gid";
private const string PARM_FEE_BSNO = "@bsno";
private const string PARM_FEE_TYPE = "@fee_type";
private const string PARM_FEE_NAME = "@fee_name";
private const string PARM_FEE_DESCRIPTION = "@fee_description";
private const string PARM_FEE_CUSTOMER_TYPE = "@customer_type";
private const string PARM_FEE_CUSTOMER_NAME = "@customer_name";
private const string PARM_FEE_UNIT = "@unit";
private const string PARM_FEE_UNIT_PRICE = "@unit_price";
private const string PARM_FEE_QUANTITY = "@quantity";
private const string PARM_FEE_AMOUNT = "@amount";
private const string PARM_FEE_CURRENCY = "@currency";
private const string PARM_FEE_EXCHANGE_RATE = "@exchange_rate";
private const string PARM_FEE_REASON = "@reason";
private const string PARM_FEE_REMARK = "@remark";
private const string PARM_FEE_COMMISSION_RATE = "@comm_rate";
private const string PARM_FEE_SETTLEMENT = "@settlement";
private const string PARM_FEE_INVOICE = "@invoice";
private const string PARM_FEE_ORDER_AMOUNT = "@order_amount";
private const string PARM_FEE_ORDER_INVOCE = "@order_invoice";
private const string PARM_FEE_SUBMIT_DATE = "@submit_date";
private const string PARM_FEE_AUDIT_OPERATOR = "@audit_operator";
private const string PARM_FEE_AUDIT_DATE = "@audit_date";
private const string PARM_FEE_ENTER_OPERATOR = "@enter_operator";
private const string PARM_FEE_ENTER_DATE = "@enter_date";
private const string PARM_FEE_DEBITNO = "@debitno";
private const string PARM_FEE_ISDEBIT = "@is_debit";
private const string PARM_FEE_ISOPEN = "@is_open";
private const string PARM_FEE_ISADVANCEPAY = "@is_advance_pay";
private const string PARM_FEE_SORT = "@sort";
private const string PARM_FEE_ISINVOICE = "@is_invoice";
private const string PARM_FEE_STATUS = "@fee_status";
private const string PARM_FEE_FRT = "@fee_frt";
private const string PARM_FEE_IS_CRM_ORDER_FEE = "@is_crmorderfee";
#endregion
//crm_orderfee
#region CRM_ORDERFEE
private const string PARM_CRM_ORDER_FEE_GID = "@gid";
private const string PARM_CRM_ORDER_FEE_BSNO = "@bsno";
private const string PARM_CRM_ORDER_FEE_TYPE = "@fee_type";
private const string PARM_CRM_ORDER_FEE_NAME = "@fee_name";
private const string PARM_CRM_ORDER_FEE_DESCRIPTION = "@fee_description";
private const string PARM_CRM_ORDER_FEE_CUSTOMER_TYPE = "@customer_type";
private const string PARM_CRM_ORDER_FEE_CUSTOMER_NAME = "@customer_name";
private const string PARM_CRM_ORDER_FEE_UNIT = "@unit";
private const string PARM_CRM_ORDER_FEE_UNIT_PRICE = "@unit_price";
private const string PARM_CRM_ORDER_FEE_QUANTITY = "@quantity";
private const string PARM_CRM_ORDER_FEE_AMOUNT = "@amount";
private const string PARM_CRM_ORDER_FEE_CURRENCY = "@currency";
private const string PARM_CRM_ORDER_FEE_EXCHANGE_RATE = "@exchange_rate";
private const string PARM_CRM_ORDER_FEE_REASON = "@reason";
private const string PARM_CRM_ORDER_FEE_REMARK = "@remark";
private const string PARM_CRM_ORDER_FEE_COMMISSION_RATE = "@comm_rate";
private const string PARM_CRM_ORDER_FEE_SETTLEMENT = "@settlement";
private const string PARM_CRM_ORDER_FEE_INVOICE = "@invoice";
private const string PARM_CRM_ORDER_FEE_ORDER_AMOUNT = "@order_amount";
private const string PARM_CRM_ORDER_FEE_ORDER_INVOCE = "@order_invoice";
private const string PARM_CRM_ORDER_FEE_SUBMIT_DATE = "@submit_date";
private const string PARM_CRM_ORDER_FEE_AUDIT_OPERATOR = "@audit_operator";
private const string PARM_CRM_ORDER_FEE_AUDIT_DATE = "@audit_date";
private const string PARM_CRM_ORDER_FEE_ENTER_OPERATOR = "@enter_operator";
private const string PARM_CRM_ORDER_FEE_ENTER_DATE = "@enter_date";
private const string PARM_CRM_ORDER_FEE_DEBITNO = "@debitno";
private const string PARM_CRM_ORDER_FEE_ISDEBIT = "@is_debit";
private const string PARM_CRM_ORDER_FEE_ISOPEN = "@is_open";
private const string PARM_CRM_ORDER_FEE_ISADVANCEPAY = "@is_advance_pay";
private const string PARM_CRM_ORDER_FEE_SORT = "@sort";
private const string PARM_CRM_ORDER_FEE_ISINVOICE = "@is_invoice";
private const string PARM_CRM_ORDER_FEE_STATUS = "@fee_status";
private const string PARM_CRM_ORDER_FEE_FRT = "@fee_frt";
private const string PARM_CRM_ORDER_FEE_AUDIT_STATUS = "@audit_status";
private const string PARM_CRM_ORDER_FEE_IS_SUBMIT2_FEE = "@is_submit2fee";
#endregion
private const string PARM_MODULE_GID = "@ORDNO";
private const string PARM_CRM_SEAEORDER_ORD_NO = "@order_no";
private const string PARM_CRM_SEAEORDER_OR_STATUS = "@order_status";
private const string PARM_CRM_SEAEORDER_OR_REASON = "@order_reason";
private const string SQL_INSERT_FEE = " INSERT INTO ch_fee(GID, BSNO, FEETYPE, FEENAME, FEEDESCRIPTION, CUSTOMERTYPE, CUSTOMERNAME, UNIT, UNITPRICE, QUANTITY, AMOUNT, CURRENCY, "
+ " EXCHANGERATE, REASON, REMARK, COMMISSIONRATE, SETTLEMENT, INVOICE, ORDERAMOUNT, ORDERINVOICE, AUDITOPERATOR, "
+ " ENTEROPERATOR, ENTERDATE, DEBITNO, ISDEBIT, ISOPEN, ISADVANCEDPAY, SORT, ISINVOICE, FEESTATUS, FEEFRT,ISCRMORDERFEE ) "
+ " VALUES "
+ " (@gid,@bsno,@fee_type,@fee_name,@fee_description,@customer_type,@customer_name,@unit,@unit_price,@quantity,@amount,@currency, "
+ " @exchange_rate,@reason,@remark,@comm_rate,@settlement,@invoice,@order_amount,@order_invoice,@audit_operator, "
+ " @enter_operator,@enter_date,@debitno,@is_debit,@is_open,@is_advance_pay,@sort,@is_invoice,@fee_status,@fee_frt,@is_crmorderfee)";
private string SQL_INSER_OP_SEAE_BY_ORDER = "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) "
+ " 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)";//@BSDATE
private const string SQL_UPDATE_ORDER_FEE_IS_SUBMIT = "UPDATE crm_orderfee SET ISSUBMIT2FEE = 1 WHERE GID = @gid";
private const string SQL_SELECT_INFO = "select ORDNO,BSNO,ORSTATUS,MBLNO,CUSTOMERNAME,ORDTYPE,SHIPPERID,CONSIGNEEID,NOTIFYPARTYID,SHIPPER,CONSIGNEE,NOTIFYPARTY,VESSEL,VOYNO,PlACERECEIPT,PORTLOADID,PORTDISCHARGEID,PLACEDELIVERYID,DESTINATIONID,PORTLOAD,PORTDISCHARGE,PLACEDELIVERY,DESTINATION,NOBILL,ISSUETYPE,ISSUEPLACE,BLFRT,PREPARDAT,PAYABLEAT,SERVICE,MARKS,NOPKGS,DESCRIPTION,GOODSNAME,GROSSWEIGHT,MEASUREMENT,PKGS,KINDPKGS,KGS,CBM,TOTALNO,CNTRTOTAL,INPUTBY,INVNO,CARGOID,DCLASS,DUNNO,REEFERF,TEMPID,TEMPSET,TEMPMAX,TEMPMIN,CUSTOMSNUM,REMARK,STATUS1,STATUS2,STATUS3,STATUS4,STATUS5,ISFUMIGATION,ISSTORAGE,ISLAND,ISCUSTOMS,ISINSPECTION,ISBOOKING,ISAGENT,STLNAME,OCEANFEE,ISUSD,ISCOMMISSIONBACK,CARRIER,CARRIERATTN,CARRIERTEL,CARRIEREMAIL,FORWARDER,FORWARDERATTN,FORWARDERTEL,FORWARDEREMAIL,SALE,BLTYPE,BSDATE,ETD,ISSUEDATE,STLDATE,ORREASON,ISHBLNO,SERVICE9,SERVICE10,OP,DOC,AUDITOPERATOR,AUDITDATE from crm_seaeorder where ORDNO=@ORDNO";
private const string SQL_DELETE_INFO = "DELETE FROM crm_seaeorder WHERE ORDNO=@ORDNO";
private string strSql = "insert into crm_seaeorder(ORDNO,BSNO,ORSTATUS,MBLNO,CUSTOMERNAME,ORDTYPE,SHIPPERID,CONSIGNEEID,NOTIFYPARTYID,SHIPPER,CONSIGNEE,NOTIFYPARTY,VESSEL,VOYNO,PlACERECEIPT,PORTLOADID,PORTDISCHARGEID,PLACEDELIVERYID,DESTINATIONID,PORTLOAD,PORTDISCHARGE,PLACEDELIVERY,DESTINATION,NOBILL,ISSUETYPE,ISSUEPLACE,BLFRT,PREPARDAT,PAYABLEAT,SERVICE,MARKS,NOPKGS,DESCRIPTION,GOODSNAME,GROSSWEIGHT,MEASUREMENT,PKGS,KINDPKGS,KGS,CBM,TOTALNO,CNTRTOTAL,INPUTBY,INVNO,CARGOID,DCLASS,DUNNO,REEFERF,TEMPID,TEMPSET,TEMPMAX,TEMPMIN,CUSTOMSNUM,REMARK,STATUS1,STATUS2,STATUS3,STATUS4,STATUS5,ISFUMIGATION,ISSTORAGE,ISLAND,ISCUSTOMS,ISINSPECTION,ISBOOKING,ISAGENT,ISHBLNO,SERVICE9,SERVICE10,STLNAME,OCEANFEE,ISUSD,ISCOMMISSIONBACK,CARRIER,CARRIERATTN,CARRIERTEL,CARRIEREMAIL,FORWARDER,FORWARDERATTN,FORWARDERTEL,FORWARDEREMAIL,SALE,BLTYPE,{0}{2}{4}BSDATE,ORREASON,OP,DOC,AUDITOPERATOR) "//ETD,ISSUEDATE,STLDATE,AUDITDATE
+ " values(@ORDNO,@BSNO,@ORSTATUS,@MBLNO,@CUSTOMERNAME,@ORDTYPE,@SHIPPERID,@CONSIGNEEID,@NOTIFYPARTYID,@SHIPPER,@CONSIGNEE,@NOTIFYPARTY,@VESSEL,@VOYNO,@PlACERECEIPT,@PORTLOADID,@PORTDISCHARGEID,@PLACEDELIVERYID,@DESTINATIONID,@PORTLOAD,@PORTDISCHARGE,@PLACEDELIVERY,@DESTINATION,@NOBILL,@ISSUETYPE,@ISSUEPLACE,@BLFRT,@PREPARDAT,@PAYABLEAT,@SERVICE,@MARKS,@NOPKGS,@DESCRIPTION,@GOODSNAME,@GROSSWEIGHT,@MEASUREMENT,@PKGS,@KINDPKGS,@KGS,@CBM,@TOTALNO,@CNTRTOTAL,@INPUTBY,@INVNO,@CARGOID,@DCLASS,@DUNNO,@REEFERF,@TEMPID,@TEMPSET,@TEMPMAX,@TEMPMIN,@CUSTOMSNUM,@REMARK,@STATUS1,@STATUS2,@STATUS3,@STATUS4,@STATUS5,@ISFUMIGATION,@ISSTORAGE,@ISLAND,@ISCUSTOMS,@ISINSPECTION,@ISBOOKING,@ISAGENT,@ISHBLNO,@SERVICE9,@SERVICE10,@STLNAME,@OCEANFEE,@ISUSD,@ISCOMMISSIONBACK,@CARRIER,@CARRIERATTN,@CARRIERTEL,@CARRIEREMAIL,@FORWARDER,@FORWARDERATTN,@FORWARDERTEL,@FORWARDEREMAIL,@SALE,@BLTYPE,{1}{3}{5}getdate(),'',@OP,@DOC,'')";//@ETD,@ISSUEDATE,@STLDATE,getdate()
private string strSqlUpdateInfo = "update crm_seaeorder set ORSTATUS=@ORSTATUS,MBLNO=@MBLNO,CUSTOMERNAME=@CUSTOMERNAME,ORDTYPE=@ORDTYPE,SHIPPERID=@SHIPPERID,CONSIGNEEID=@CONSIGNEEID,NOTIFYPARTYID=@NOTIFYPARTYID,SHIPPER=@SHIPPER,CONSIGNEE=@CONSIGNEE,NOTIFYPARTY=@NOTIFYPARTY,VESSEL=@VESSEL,VOYNO=@VOYNO,PlACERECEIPT=@PlACERECEIPT,PORTLOADID=@PORTLOADID,PORTDISCHARGEID=@PORTDISCHARGEID,PLACEDELIVERYID=@PLACEDELIVERYID,DESTINATIONID=@DESTINATIONID,PORTLOAD=@PORTLOAD,PORTDISCHARGE=@PORTDISCHARGE,PLACEDELIVERY=@PLACEDELIVERY,DESTINATION=@DESTINATION,NOBILL=@NOBILL,ISSUETYPE=@ISSUETYPE,ISSUEPLACE=@ISSUEPLACE,BLFRT=@BLFRT,PREPARDAT=@PREPARDAT,PAYABLEAT=@PAYABLEAT,SERVICE=@SERVICE,MARKS=@MARKS,NOPKGS=@NOPKGS,DESCRIPTION=@DESCRIPTION,GOODSNAME=@GOODSNAME,GROSSWEIGHT=@GROSSWEIGHT,MEASUREMENT=@MEASUREMENT,PKGS=@PKGS,KINDPKGS=@KINDPKGS,KGS=@KGS,CBM=@CBM,TOTALNO=@TOTALNO,CNTRTOTAL=@CNTRTOTAL,INVNO=@INVNO,CARGOID=@CARGOID,DCLASS=@DCLASS,DUNNO=@DUNNO,REEFERF=@REEFERF,TEMPID=@TEMPID,TEMPSET=@TEMPSET,TEMPMAX=@TEMPMAX,TEMPMIN=@TEMPMIN,CUSTOMSNUM=@CUSTOMSNUM,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,STLNAME=@STLNAME,OCEANFEE=@OCEANFEE,ISUSD=@ISUSD,ISCOMMISSIONBACK=@ISCOMMISSIONBACK,CARRIER=@CARRIER,CARRIERATTN=@CARRIERATTN,CARRIERTEL=@CARRIERTEL,CARRIEREMAIL=@CARRIEREMAIL,FORWARDER=@FORWARDER,FORWARDERATTN=@FORWARDERATTN,FORWARDERTEL=@FORWARDERTEL,FORWARDEREMAIL=@FORWARDEREMAIL,SALE=@SALE,{0}{1}{2}{3}{4}{5}BLTYPE=@BLTYPE,OP=@OP,DOC=@DOC where ORDNO=@ORDNO ";//ETD=@ETD,ISSUEDATE=@ISSUEDATE,STLDATE=@STLDATE,
private const string SQL_UPDATE_CRM_SEAEORDER = " UPDATE crm_seaeorder SET ORSTATUS = @order_status,ORREASON = @order_reason WHERE ORDNO = @order_no ";
private const string SQL_SELECT_CRM_ORDER_FEE_COUNT_BY_ORDNO = " SELECT COUNT(*) FROM crm_orderfee WHERE BSNO IN (SELECT BSNO FROM crm_seaeorder WHERE ORDNO = @order_no ) ";
private const string SQL_SELECT_CRM_ORDER_FEE_COUNT_BY_BSNO = " SELECT COUNT(*) FROM crm_orderfee WHERE BSNO = @bsno ";
public CrmSeaeorderDA()
{
}
#region 根据GID获取信息
/// <summary>
/// 根据GID获取信息
/// </summary>
/// <param name="strRoleGID"></param>
/// <returns></returns>
public CrmSeaeorderEntity GetID(string strGID)
{
//初始化返回变量
CrmSeaeorderEntity CrmSeaeorderEntity = 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
{
CrmSeaeorderEntity = new CrmSeaeorderEntity();
//读取字段值
while (sqlRead.Read())
{
if (!sqlRead.IsDBNull(0)) { CrmSeaeorderEntity.ORDNO = sqlRead.GetString(0); }//编号
if (!sqlRead.IsDBNull(1)) { CrmSeaeorderEntity.BSNO = sqlRead.GetString(1); }//业务编号
if (!sqlRead.IsDBNull(2)) { CrmSeaeorderEntity.ORSTATUS = sqlRead.GetString(2); }//订舱状态
if (!sqlRead.IsDBNull(3)) { CrmSeaeorderEntity.MBLNO = sqlRead.GetString(3); }//主提单号
if (!sqlRead.IsDBNull(4)) { CrmSeaeorderEntity.CUSTOMERNAME = sqlRead.GetString(4); }//委托单位
if (!sqlRead.IsDBNull(5)) { CrmSeaeorderEntity.ORDTYPE = sqlRead.GetString(5); }//订舱类型
if (!sqlRead.IsDBNull(6)) { CrmSeaeorderEntity.SHIPPERID = sqlRead.GetString(6); }//发货人
if (!sqlRead.IsDBNull(7)) { CrmSeaeorderEntity.CONSIGNEEID = sqlRead.GetString(7); }//收货人
if (!sqlRead.IsDBNull(8)) { CrmSeaeorderEntity.NOTIFYPARTYID = sqlRead.GetString(8); }//通知人
if (!sqlRead.IsDBNull(9)) { CrmSeaeorderEntity.SHIPPER = sqlRead.GetString(9); }//发货人内容
if (!sqlRead.IsDBNull(10)) { CrmSeaeorderEntity.CONSIGNEE = sqlRead.GetString(10); }//收货人内容
if (!sqlRead.IsDBNull(11)) { CrmSeaeorderEntity.NOTIFYPARTY = sqlRead.GetString(11); }//通知人内容
if (!sqlRead.IsDBNull(12)) { CrmSeaeorderEntity.VESSEL = sqlRead.GetString(12); }//船名
if (!sqlRead.IsDBNull(13)) { CrmSeaeorderEntity.VOYNO = sqlRead.GetString(13); }//航次
if (!sqlRead.IsDBNull(14)) { CrmSeaeorderEntity.PlACERECEIPT = sqlRead.GetString(14); }//收货地
if (!sqlRead.IsDBNull(15)) { CrmSeaeorderEntity.PORTLOADID = sqlRead.GetString(15); }//装货港代码
if (!sqlRead.IsDBNull(16)) { CrmSeaeorderEntity.PORTDISCHARGEID = sqlRead.GetString(16); }//卸货港代码
if (!sqlRead.IsDBNull(17)) { CrmSeaeorderEntity.PLACEDELIVERYID = sqlRead.GetString(17); }//交货地代码
if (!sqlRead.IsDBNull(18)) { CrmSeaeorderEntity.DESTINATIONID = sqlRead.GetString(18); }//目的地代码
if (!sqlRead.IsDBNull(19)) { CrmSeaeorderEntity.PORTLOAD = sqlRead.GetString(19); }//装货港
if (!sqlRead.IsDBNull(20)) { CrmSeaeorderEntity.PORTDISCHARGE = sqlRead.GetString(20); }//卸货港
if (!sqlRead.IsDBNull(21)) { CrmSeaeorderEntity.PLACEDELIVERY = sqlRead.GetString(21); }//交货地
if (!sqlRead.IsDBNull(22)) { CrmSeaeorderEntity.DESTINATION = sqlRead.GetString(22); }//目的地
if (!sqlRead.IsDBNull(23)) { CrmSeaeorderEntity.NOBILL = sqlRead.GetString(23); }//提单份数
if (!sqlRead.IsDBNull(24)) { CrmSeaeorderEntity.ISSUETYPE = sqlRead.GetString(24); }//签单方式
if (!sqlRead.IsDBNull(25)) { CrmSeaeorderEntity.ISSUEPLACE = sqlRead.GetString(25); }//签单地点
if (!sqlRead.IsDBNull(26)) { CrmSeaeorderEntity.BLFRT = sqlRead.GetString(26); }//付费方式
if (!sqlRead.IsDBNull(27)) { CrmSeaeorderEntity.PREPARDAT = sqlRead.GetString(27); }//预付地点
if (!sqlRead.IsDBNull(28)) { CrmSeaeorderEntity.PAYABLEAT = sqlRead.GetString(28); }//到付地点
if (!sqlRead.IsDBNull(29)) { CrmSeaeorderEntity.SERVICE = sqlRead.GetString(29); }//运输条款
if (!sqlRead.IsDBNull(30)) { CrmSeaeorderEntity.MARKS = sqlRead.GetString(30); }//唛头
if (!sqlRead.IsDBNull(31)) { CrmSeaeorderEntity.NOPKGS = sqlRead.GetString(31); }//件数包装
if (!sqlRead.IsDBNull(32)) { CrmSeaeorderEntity.DESCRIPTION = sqlRead.GetString(32); }//货物描述
if (!sqlRead.IsDBNull(33)) { CrmSeaeorderEntity.GOODSNAME = sqlRead.GetString(33); }//品名
if (!sqlRead.IsDBNull(34)) { CrmSeaeorderEntity.GROSSWEIGHT = sqlRead.GetString(34); }//货物毛重
if (!sqlRead.IsDBNull(35)) { CrmSeaeorderEntity.MEASUREMENT = sqlRead.GetString(35); }//货物尺码
if (!sqlRead.IsDBNull(36)) { CrmSeaeorderEntity.PKGS = sqlRead.GetInt32(36); }//件数
if (!sqlRead.IsDBNull(37)) { CrmSeaeorderEntity.KINDPKGS = sqlRead.GetString(37); }//包装
if (!sqlRead.IsDBNull(38)) { CrmSeaeorderEntity.KGS = sqlRead.GetDecimal(38); }//毛重
if (!sqlRead.IsDBNull(39)) { CrmSeaeorderEntity.CBM = sqlRead.GetDecimal(39); }//尺码
if (!sqlRead.IsDBNull(40)) { CrmSeaeorderEntity.TOTALNO = sqlRead.GetString(40); }//件数大写
if (!sqlRead.IsDBNull(41)) { CrmSeaeorderEntity.CNTRTOTAL = sqlRead.GetString(41); }//集装箱
if (!sqlRead.IsDBNull(42)) { CrmSeaeorderEntity.INPUTBY = sqlRead.GetString(42); }//录入人
if (!sqlRead.IsDBNull(43)) { CrmSeaeorderEntity.INVNO = sqlRead.GetString(43); }//发票号
if (!sqlRead.IsDBNull(44)) { CrmSeaeorderEntity.CARGOID = sqlRead.GetString(44); }//货物标识
if (!sqlRead.IsDBNull(45)) { CrmSeaeorderEntity.DCLASS = sqlRead.GetString(45); }//危险品分类
if (!sqlRead.IsDBNull(46)) { CrmSeaeorderEntity.DUNNO = sqlRead.GetString(46); }//危险品编号
if (!sqlRead.IsDBNull(47)) { CrmSeaeorderEntity.REEFERF = sqlRead.GetString(47); }//冷藏通风量
if (!sqlRead.IsDBNull(48)) { CrmSeaeorderEntity.TEMPID = sqlRead.GetString(48); }//温度单位
if (!sqlRead.IsDBNull(49)) { CrmSeaeorderEntity.TEMPSET = sqlRead.GetString(49); }//设置温度
if (!sqlRead.IsDBNull(50)) { CrmSeaeorderEntity.TEMPMAX = sqlRead.GetString(50); }//最高温度
if (!sqlRead.IsDBNull(51)) { CrmSeaeorderEntity.TEMPMIN = sqlRead.GetString(51); }//最低温度
if (!sqlRead.IsDBNull(52)) { CrmSeaeorderEntity.CUSTOMSNUM = sqlRead.GetInt32(52); }//报关票数
if (!sqlRead.IsDBNull(53)) { CrmSeaeorderEntity.REMARK = sqlRead.GetString(53); }//备注
if (!sqlRead.IsDBNull(54)) { CrmSeaeorderEntity.STATUS1 = sqlRead.GetBoolean(54); }//状态1
if (!sqlRead.IsDBNull(55)) { CrmSeaeorderEntity.STATUS2 = sqlRead.GetBoolean(55); }//状态2
if (!sqlRead.IsDBNull(56)) { CrmSeaeorderEntity.STATUS3 = sqlRead.GetBoolean(56); }//状态3
if (!sqlRead.IsDBNull(57)) { CrmSeaeorderEntity.STATUS4 = sqlRead.GetBoolean(57); }//状态4
if (!sqlRead.IsDBNull(58)) { CrmSeaeorderEntity.STATUS5 = sqlRead.GetBoolean(58); }//状态5
if (!sqlRead.IsDBNull(59)) { CrmSeaeorderEntity.ISFUMIGATION = sqlRead.GetBoolean(59); }//熏蒸
if (!sqlRead.IsDBNull(60)) { CrmSeaeorderEntity.ISSTORAGE = sqlRead.GetBoolean(60); }//仓储
if (!sqlRead.IsDBNull(61)) { CrmSeaeorderEntity.ISLAND = sqlRead.GetBoolean(61); }//陆运
if (!sqlRead.IsDBNull(62)) { CrmSeaeorderEntity.ISCUSTOMS = sqlRead.GetBoolean(62); }//报关
if (!sqlRead.IsDBNull(63)) { CrmSeaeorderEntity.ISINSPECTION = sqlRead.GetBoolean(63); }//报检
if (!sqlRead.IsDBNull(64)) { CrmSeaeorderEntity.ISBOOKING = sqlRead.GetBoolean(64); }//订舱
if (!sqlRead.IsDBNull(65)) { CrmSeaeorderEntity.ISAGENT = sqlRead.GetBoolean(65); }//使用代理
if (!sqlRead.IsDBNull(66)) { CrmSeaeorderEntity.STLNAME = sqlRead.GetString(66); }//结算方式
if (!sqlRead.IsDBNull(67)) { CrmSeaeorderEntity.OCEANFEE = sqlRead.GetDecimal(67); }//海运费
if (!sqlRead.IsDBNull(68)) { CrmSeaeorderEntity.ISUSD = sqlRead.GetBoolean(68); }//是否美元结算
if (!sqlRead.IsDBNull(69)) { CrmSeaeorderEntity.ISCOMMISSIONBACK = sqlRead.GetBoolean(69); }//是否退佣金
if (!sqlRead.IsDBNull(70)) { CrmSeaeorderEntity.CARRIER = sqlRead.GetString(70); }//船公司
if (!sqlRead.IsDBNull(71)) { CrmSeaeorderEntity.CARRIERATTN = sqlRead.GetString(71); }//船公司联系人
if (!sqlRead.IsDBNull(72)) { CrmSeaeorderEntity.CARRIERTEL = sqlRead.GetString(72); }//船公司电话
if (!sqlRead.IsDBNull(73)) { CrmSeaeorderEntity.CARRIEREMAIL = sqlRead.GetString(73); }//船公司电子邮箱
if (!sqlRead.IsDBNull(74)) { CrmSeaeorderEntity.FORWARDER = sqlRead.GetString(74); }//订舱代理
if (!sqlRead.IsDBNull(75)) { CrmSeaeorderEntity.FORWARDERATTN = sqlRead.GetString(75); }//订舱联系人
if (!sqlRead.IsDBNull(76)) { CrmSeaeorderEntity.FORWARDERTEL = sqlRead.GetString(76); }//订舱电话
if (!sqlRead.IsDBNull(77)) { CrmSeaeorderEntity.FORWARDEREMAIL = sqlRead.GetString(77); }//订舱电子邮箱
if (!sqlRead.IsDBNull(78)) { CrmSeaeorderEntity.SALE = sqlRead.GetString(78); }//揽货人
if (!sqlRead.IsDBNull(79)) { CrmSeaeorderEntity.BLTYPE = sqlRead.GetString(79); }//装箱方式
if (!sqlRead.IsDBNull(80)) { CrmSeaeorderEntity.BSDATE = sqlRead.GetDateTime(80); }//录入日期
if (!sqlRead.IsDBNull(81)) { CrmSeaeorderEntity.ETD = sqlRead.GetDateTime(81); }//开船日期
if (!sqlRead.IsDBNull(82)) { CrmSeaeorderEntity.ISSUEDATE = sqlRead.GetDateTime(82); }//签单日期
if (!sqlRead.IsDBNull(83)) { CrmSeaeorderEntity.STLDATE = sqlRead.GetDateTime(83); }//结算日期
if (!sqlRead.IsDBNull(84)) { CrmSeaeorderEntity.ORREASON = sqlRead.GetString(84); }//驳回原因
if (!sqlRead.IsDBNull(85)) { CrmSeaeorderEntity.ISHBLNO = sqlRead.GetBoolean(85); }//分单签单
if (!sqlRead.IsDBNull(86)) { CrmSeaeorderEntity.SERVICE9 = sqlRead.GetBoolean(86); }//服务项目9
if (!sqlRead.IsDBNull(87)) { CrmSeaeorderEntity.SERVICE10 = sqlRead.GetBoolean(87); }//服务项目10
if (!sqlRead.IsDBNull(88)) { CrmSeaeorderEntity.OP = sqlRead.GetString(88); }//操作
if (!sqlRead.IsDBNull(89)) { CrmSeaeorderEntity.DOC = sqlRead.GetString(89); }//单证
if (!sqlRead.IsDBNull(90)) { CrmSeaeorderEntity.AUDITOPERATOR = sqlRead.GetString(90); }//审核人
if (!sqlRead.IsDBNull(91)) { CrmSeaeorderEntity.AUDITDATE = sqlRead.GetDateTime(91); }//审核日期
}
}
catch (Exception exceError)
{
//抛出异常
throw exceError;
}
}
return CrmSeaeorderEntity;
}
#endregion
/// <summary>
/// 插入信息
/// </summary>
/// <param name="CrmSeaeorderEntity">实体类</param>
/// <returns>值为1插入数据正常,-1操作异常</returns>
public int InserInfo(CrmSeaeorderEntity infoEntity)
{
int iResult = 0;
//获取参数
SqlParameter[] parms = GetInsertParms();
parms[0].Value = infoEntity.ORDNO;//编号
parms[1].Value = infoEntity.BSNO;//业务编号
parms[2].Value = infoEntity.ORSTATUS;//订舱状态
parms[3].Value = infoEntity.MBLNO;//主提单号
parms[4].Value = infoEntity.CUSTOMERNAME;//委托单位
parms[5].Value = infoEntity.ORDTYPE;//订舱类型
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.VESSEL;//船名
parms[13].Value = infoEntity.VOYNO;//航次
parms[14].Value = infoEntity.PlACERECEIPT;//收货地
parms[15].Value = infoEntity.PORTLOADID;//装货港代码
parms[16].Value = infoEntity.PORTDISCHARGEID;//卸货港代码
parms[17].Value = infoEntity.PLACEDELIVERYID;//交货地代码
parms[18].Value = infoEntity.DESTINATIONID;//目的地代码
parms[19].Value = infoEntity.PORTLOAD;//装货港
parms[20].Value = infoEntity.PORTDISCHARGE;//卸货港
parms[21].Value = infoEntity.PLACEDELIVERY;//交货地
parms[22].Value = infoEntity.DESTINATION;//目的地
parms[23].Value = infoEntity.NOBILL;//提单份数
parms[24].Value = infoEntity.ISSUETYPE;//签单方式
parms[25].Value = infoEntity.ISSUEPLACE;//签单地点
parms[26].Value = infoEntity.BLFRT;//付费方式
parms[27].Value = infoEntity.PREPARDAT;//预付地点
parms[28].Value = infoEntity.PAYABLEAT;//到付地点
parms[29].Value = infoEntity.SERVICE;//运输条款
parms[30].Value = infoEntity.MARKS;//唛头
parms[31].Value = infoEntity.NOPKGS;//件数包装
parms[32].Value = infoEntity.DESCRIPTION;//货物描述
parms[33].Value = infoEntity.GOODSNAME;//品名
parms[34].Value = infoEntity.GROSSWEIGHT;//货物毛重
parms[35].Value = infoEntity.MEASUREMENT;//货物尺码
parms[36].Value = infoEntity.PKGS;//件数
parms[37].Value = infoEntity.KINDPKGS;//包装
parms[38].Value = infoEntity.KGS;//毛重
parms[39].Value = infoEntity.CBM;//尺码
parms[40].Value = infoEntity.TOTALNO;//件数大写
parms[41].Value = infoEntity.CNTRTOTAL;//集装箱
parms[42].Value = infoEntity.INPUTBY;//录入人
parms[43].Value = infoEntity.INVNO;//发票号
parms[44].Value = infoEntity.CARGOID;//货物标识
parms[45].Value = infoEntity.DCLASS;//危险品分类
parms[46].Value = infoEntity.DUNNO;//危险品编号
parms[47].Value = infoEntity.REEFERF;//冷藏通风量
parms[48].Value = infoEntity.TEMPID;//温度单位
parms[49].Value = infoEntity.TEMPSET;//设置温度
parms[50].Value = infoEntity.TEMPMAX;//最高温度
parms[51].Value = infoEntity.TEMPMIN;//最低温度
parms[52].Value = infoEntity.CUSTOMSNUM;//报关票数
parms[53].Value = infoEntity.REMARK;//备注
parms[54].Value = infoEntity.STATUS1;//状态1
parms[55].Value = infoEntity.STATUS2;//状态2
parms[56].Value = infoEntity.STATUS3;//状态3
parms[57].Value = infoEntity.STATUS4;//状态4
parms[58].Value = infoEntity.STATUS5;//状态5
parms[59].Value = infoEntity.ISFUMIGATION;//熏蒸
parms[60].Value = infoEntity.ISSTORAGE;//仓储
parms[61].Value = infoEntity.ISLAND;//陆运
parms[62].Value = infoEntity.ISCUSTOMS;//报关
parms[63].Value = infoEntity.ISINSPECTION;//报检
parms[64].Value = infoEntity.ISBOOKING;//订舱
parms[65].Value = infoEntity.ISAGENT;//使用代理
parms[66].Value = infoEntity.STLNAME;//结算方式
parms[67].Value = infoEntity.OCEANFEE;//海运费
parms[68].Value = infoEntity.ISUSD;//是否美元结算
parms[69].Value = infoEntity.ISCOMMISSIONBACK;//是否退佣金
parms[70].Value = infoEntity.CARRIER;//船公司
parms[71].Value = infoEntity.CARRIERATTN;//船公司联系人
parms[72].Value = infoEntity.CARRIERTEL;//船公司电话
parms[73].Value = infoEntity.CARRIEREMAIL;//船公司电子邮箱
parms[74].Value = infoEntity.FORWARDER;//订舱代理
parms[75].Value = infoEntity.FORWARDERATTN;//订舱联系人
parms[76].Value = infoEntity.FORWARDERTEL;//订舱电话
parms[77].Value = infoEntity.FORWARDEREMAIL;//订舱电子邮箱
parms[78].Value = infoEntity.SALE;//揽货人
parms[79].Value = infoEntity.BLTYPE;//装箱方式
parms[80].Value = infoEntity.ISHBLNO;//分单签单
parms[81].Value = infoEntity.SERVICE9;//服务项目9
parms[82].Value = infoEntity.SERVICE10;//服务项目10
parms[83].Value = infoEntity.OP;//操作
parms[84].Value = infoEntity.DOC;//单证
//parms[80].Value = infoEntity.BSDATE;//录入日期
//parms[81].Value = infoEntity.ETD;//开船日期
//parms[82].Value = infoEntity.ISSUEDATE;//签单日期
//parms[83].Value = infoEntity.STLDATE;//结算日期
//开船日期
string strETD = infoEntity.ETD.ToString().IndexOf("0001")>-1 ? "" : "'" + infoEntity.ETD.ToString() + "',";
string strETD_name = strETD.Equals("") ? "" : "ETD,";
//签单日期
string strISSUEDATE = infoEntity.ISSUEDATE.ToString().IndexOf("0001")>-1 ? "" : "'" + infoEntity.ISSUEDATE.ToString() + "',";
string strISSUEDATE_name = strISSUEDATE.Equals("") ? "" : "ISSUEDATE,";
//结算日期
string strSTLDATE = infoEntity.STLDATE.ToString().IndexOf("0001")>-1 ? "" : "'" + infoEntity.STLDATE.ToString() + "',";
string strSTLDATE_name = strSTLDATE.Equals("") ? "" : "STLDATE,";
strSql = String.Format(strSql, strETD_name, strETD, strISSUEDATE_name, strISSUEDATE, 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('插入crm_seaeorder海运业务预订舱表','插入操作','BSNO=" + infoEntity.BSNO + "','" + infoEntity.INPUTBY + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
else
{
iResult = -1;//执行异常
}
}
return iResult;
}
/// <summary>
/// 更新信息
/// </summary>
/// <param name="CrmSeaeorderEntity">实体类</param>
/// <returns>值为1更新数据正常,-1操作异常</returns>
public int UpdateInfo(CrmSeaeorderEntity infoEntity)
{
int iResult = 0;
//获取参数
SqlParameter[] parms = GetUpdateParms();
parms[0].Value = infoEntity.ORDNO;//编号
parms[1].Value = infoEntity.ORSTATUS;//订舱状态
parms[2].Value = infoEntity.MBLNO;//主提单号
parms[3].Value = infoEntity.CUSTOMERNAME;//委托单位
parms[4].Value = infoEntity.ORDTYPE;//订舱类型
parms[5].Value = infoEntity.SHIPPERID;//发货人
parms[6].Value = infoEntity.CONSIGNEEID;//收货人
parms[7].Value = infoEntity.NOTIFYPARTYID;//通知人
parms[8].Value = infoEntity.SHIPPER;//发货人内容
parms[9].Value = infoEntity.CONSIGNEE;//收货人内容
parms[10].Value = infoEntity.NOTIFYPARTY;//通知人内容
parms[11].Value = infoEntity.VESSEL;//船名
parms[12].Value = infoEntity.VOYNO;//航次
parms[13].Value = infoEntity.PlACERECEIPT;//收货地
parms[14].Value = infoEntity.PORTLOADID;//装货港代码
parms[15].Value = infoEntity.PORTDISCHARGEID;//卸货港代码
parms[16].Value = infoEntity.PLACEDELIVERYID;//交货地代码
parms[17].Value = infoEntity.DESTINATIONID;//目的地代码
parms[18].Value = infoEntity.PORTLOAD;//装货港
parms[19].Value = infoEntity.PORTDISCHARGE;//卸货港
parms[20].Value = infoEntity.PLACEDELIVERY;//交货地
parms[21].Value = infoEntity.DESTINATION;//目的地
parms[22].Value = infoEntity.NOBILL;//提单份数
parms[23].Value = infoEntity.ISSUETYPE;//签单方式
parms[24].Value = infoEntity.ISSUEPLACE;//签单地点
parms[25].Value = infoEntity.BLFRT;//付费方式
parms[26].Value = infoEntity.PREPARDAT;//预付地点
parms[27].Value = infoEntity.PAYABLEAT;//到付地点
parms[28].Value = infoEntity.SERVICE;//运输条款
parms[29].Value = infoEntity.MARKS;//唛头
parms[30].Value = infoEntity.NOPKGS;//件数包装
parms[31].Value = infoEntity.DESCRIPTION;//货物描述
parms[32].Value = infoEntity.GOODSNAME;//品名
parms[33].Value = infoEntity.GROSSWEIGHT;//货物毛重
parms[34].Value = infoEntity.MEASUREMENT;//货物尺码
parms[35].Value = infoEntity.PKGS;//件数
parms[36].Value = infoEntity.KINDPKGS;//包装
parms[37].Value = infoEntity.KGS;//毛重
parms[38].Value = infoEntity.CBM;//尺码
parms[39].Value = infoEntity.TOTALNO;//件数大写
parms[40].Value = infoEntity.CNTRTOTAL;//集装箱
parms[41].Value = infoEntity.INVNO;//发票号
parms[42].Value = infoEntity.CARGOID;//货物标识
parms[43].Value = infoEntity.DCLASS;//危险品分类
parms[44].Value = infoEntity.DUNNO;//危险品编号
parms[45].Value = infoEntity.REEFERF;//冷藏通风量
parms[46].Value = infoEntity.TEMPID;//温度单位
parms[47].Value = infoEntity.TEMPSET;//设置温度
parms[48].Value = infoEntity.TEMPMAX;//最高温度
parms[49].Value = infoEntity.TEMPMIN;//最低温度
parms[50].Value = infoEntity.CUSTOMSNUM;//报关票数
parms[51].Value = infoEntity.REMARK;//备注
parms[52].Value = infoEntity.STATUS1;//状态1
parms[53].Value = infoEntity.STATUS2;//状态2
parms[54].Value = infoEntity.STATUS3;//状态3
parms[55].Value = infoEntity.STATUS4;//状态4
parms[56].Value = infoEntity.STATUS5;//状态5
parms[57].Value = infoEntity.ISFUMIGATION;//熏蒸
parms[58].Value = infoEntity.ISSTORAGE;//仓储
parms[59].Value = infoEntity.ISLAND;//陆运
parms[60].Value = infoEntity.ISCUSTOMS;//报关
parms[61].Value = infoEntity.ISINSPECTION;//报检
parms[62].Value = infoEntity.ISBOOKING;//订舱
parms[63].Value = infoEntity.ISAGENT;//使用代理
parms[64].Value = infoEntity.STLNAME;//结算方式
parms[65].Value = infoEntity.OCEANFEE;//海运费
parms[66].Value = infoEntity.ISUSD;//是否美元结算
parms[67].Value = infoEntity.ISCOMMISSIONBACK;//是否退佣金
parms[68].Value = infoEntity.CARRIER;//船公司
parms[69].Value = infoEntity.CARRIERATTN;//船公司联系人
parms[70].Value = infoEntity.CARRIERTEL;//船公司电话
parms[71].Value = infoEntity.CARRIEREMAIL;//船公司电子邮箱
parms[72].Value = infoEntity.FORWARDER;//订舱代理
parms[73].Value = infoEntity.FORWARDERATTN;//订舱联系人
parms[74].Value = infoEntity.FORWARDERTEL;//订舱电话
parms[75].Value = infoEntity.FORWARDEREMAIL;//订舱电子邮箱
parms[76].Value = infoEntity.SALE;//揽货人
parms[77].Value = infoEntity.BLTYPE;//装箱方式
parms[78].Value = infoEntity.ISHBLNO;//分单签单
parms[79].Value = infoEntity.SERVICE9;//服务项目9
parms[80].Value = infoEntity.SERVICE10;//服务项目10
parms[81].Value = infoEntity.OP;//服务项目10
parms[82].Value = infoEntity.DOC;//单证
//parms[78].Value = infoEntity.ETD;//开船日期
//parms[79].Value = infoEntity.ISSUEDATE;//签单日期
//parms[80].Value = infoEntity.STLDATE;//结算日期
//开船日期
string strETD = infoEntity.ETD.ToString().IndexOf("0001")>-1 ? "null," : "'" + infoEntity.ETD.ToString() + "',";
string strETD_name = "ETD=";//strETD.Equals("") ? "" : "ETD=";
//签单日期
string strISSUEDATE = infoEntity.ISSUEDATE.ToString().IndexOf("0001")>-1 ? "null," : "'" + infoEntity.ISSUEDATE.ToString() + "',";
string strISSUEDATE_name = "ISSUEDATE=";//strISSUEDATE.Equals("") ? "" : "ISSUEDATE=";
//结算日期
string strSTLDATE = infoEntity.STLDATE.ToString().IndexOf("0001")>-1 ? "null," : "'" + infoEntity.STLDATE.ToString() + "',";
string strSTLDATE_name = "STLDATE=";//strSTLDATE.Equals("") ? "" : "STLDATE=";
strSqlUpdateInfo = String.Format(strSqlUpdateInfo, strETD_name, strETD, strISSUEDATE_name, strISSUEDATE, 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('更新所有crm_seaeorder海运业务预订舱表内容','更新操作','BSNO=" + infoEntity.BSNO + "','')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
else
{
iResult = -1;//执行异常
}
}
return iResult;
}
/// <summary>
/// 插入信息
/// </summary>
/// <param name="CrmSeaeorderEntity">实体类</param>
/// <returns>值为1插入数据正常,-1操作异常</returns>
public int InserInfoCNTRTOTAL(string strSql, string strUserID)
{
int iResult = 0;
//
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int existVal = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql, null);
if (existVal > 0)
{
iResult = 1;
//
//strSql = strSql.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入crm_seaeorder海运业务预订舱表集装箱字段','插入操作','" + strSql + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
else
{
iResult = -1;//执行异常
}
}
return iResult;
}
/// <summary>
/// 更新信息
/// </summary>
/// <param name="CrmSeaeorderEntity">实体类</param>
/// <returns>值为1更新数据正常,-1操作异常</returns>
public int UpdateInfoCNTRTOTAL(string strSql, string strUserID)
{
int iResult = 0;
//
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int existVal = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql, null);
if (existVal > 0)
{
iResult = 1;
//
//strSql = strSql.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新所有crm_seaeorder海运业务预订舱表集装箱字段','更新操作','" + strSql + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
else
{
iResult = -1;//执行异常
}
}
return iResult;
}
#region 提交销售订舱审核
/// <summary>
/// 提交销售订舱审核
/// </summary>
/// <param name="tempOrderNo">销售订舱业务编号</param>
/// <param name="tempOrderStatus">订舱状态</param>
/// <param name="tempReason">审核原因</param>
/// <returns>值1表示提交成功 值不等于1表示提交失败</returns>
public int PostAudit(string tempOrderNo,string tempOrderStatus,string tempReason)
{
int iResult = 0;
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
SqlParameter[] parms = new SqlParameter[] {
new SqlParameter(PARM_CRM_SEAEORDER_ORD_NO,SqlDbType.VarChar,36),
new SqlParameter(PARM_CRM_SEAEORDER_OR_STATUS,SqlDbType.Char,1),
new SqlParameter(PARM_CRM_SEAEORDER_OR_REASON,SqlDbType.VarChar,600)
};
parms[0].Value = tempOrderNo;
parms[1].Value = tempOrderStatus;
parms[2].Value = tempReason;
iResult = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, SQL_UPDATE_CRM_SEAEORDER, parms);
}
return iResult;
}
#endregion
#region 生成插入语句参数
/// <summary>
/// 生成插入语句参数
/// </summary>
/// <returns>返回SqlParameter数组</returns>
private SqlParameter[] GetInsertParms()
{
SqlParameter[] parms = new SqlParameter[]{
new SqlParameter("@ORDNO",SqlDbType.VarChar,36),//编号
new SqlParameter("@BSNO",SqlDbType.VarChar,100),//业务编号
new SqlParameter("@ORSTATUS",SqlDbType.Char,1),//订舱状态
new SqlParameter("@MBLNO",SqlDbType.VarChar,30),//主提单号
new SqlParameter("@CUSTOMERNAME",SqlDbType.VarChar,20),//委托单位
new SqlParameter("@ORDTYPE",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("@VESSEL",SqlDbType.VarChar,60),//船名
new SqlParameter("@VOYNO",SqlDbType.VarChar,12),//航次
new SqlParameter("@PlACERECEIPT",SqlDbType.VarChar,60),//收货地
new SqlParameter("@PORTLOADID",SqlDbType.VarChar,36),//装货港代码
new SqlParameter("@PORTDISCHARGEID",SqlDbType.VarChar,36),//卸货港代码
new SqlParameter("@PLACEDELIVERYID",SqlDbType.VarChar,36),//交货地代码
new SqlParameter("@DESTINATIONID",SqlDbType.VarChar,36),//目的地代码
new SqlParameter("@PORTLOAD",SqlDbType.VarChar,60),//装货港
new SqlParameter("@PORTDISCHARGE",SqlDbType.VarChar,60),//卸货港
new SqlParameter("@PLACEDELIVERY",SqlDbType.VarChar,60),//交货地
new SqlParameter("@DESTINATION",SqlDbType.VarChar,60),//目的地
new SqlParameter("@NOBILL",SqlDbType.VarChar,5),//提单份数
new SqlParameter("@ISSUETYPE",SqlDbType.VarChar,12),//签单方式
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("@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("@CNTRTOTAL",SqlDbType.VarChar,4000),//集装箱
new SqlParameter("@INPUTBY",SqlDbType.VarChar,10),//录入人
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("@CUSTOMSNUM",SqlDbType.Int),//报关票数
new SqlParameter("@REMARK",SqlDbType.VarChar,200),//备注
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("@ISBOOKING",SqlDbType.Bit),//订舱
new SqlParameter("@ISAGENT",SqlDbType.Bit),//使用代理
new SqlParameter("@STLNAME",SqlDbType.VarChar,6),//结算方式
new SqlParameter("@OCEANFEE",SqlDbType.Decimal),//海运费
new SqlParameter("@ISUSD",SqlDbType.Bit),//是否美元结算
new SqlParameter("@ISCOMMISSIONBACK",SqlDbType.Bit),//是否退佣金
new SqlParameter("@CARRIER",SqlDbType.VarChar,20),//船公司
new SqlParameter("@CARRIERATTN",SqlDbType.VarChar,20),//船公司联系人
new SqlParameter("@CARRIERTEL",SqlDbType.VarChar,50),//船公司电话
new SqlParameter("@CARRIEREMAIL",SqlDbType.VarChar,50),//船公司电子邮箱
new SqlParameter("@FORWARDER",SqlDbType.VarChar,20),//订舱代理
new SqlParameter("@FORWARDERATTN",SqlDbType.VarChar,20),//订舱联系人
new SqlParameter("@FORWARDERTEL",SqlDbType.VarChar,50),//订舱电话
new SqlParameter("@FORWARDEREMAIL",SqlDbType.VarChar,50),//订舱电子邮箱
new SqlParameter("@SALE",SqlDbType.VarChar,10),//揽货人
new SqlParameter("@BLTYPE",SqlDbType.VarChar,10),//装箱方式
new SqlParameter("@ISHBLNO",SqlDbType.Bit),//分单签单
new SqlParameter("@SERVICE9",SqlDbType.Bit),//服务项目9
new SqlParameter("@SERVICE10",SqlDbType.Bit),//服务项目10
new SqlParameter("@OP",SqlDbType.VarChar,10),//操作
new SqlParameter("@DOC",SqlDbType.VarChar,10)//单证
//new SqlParameter("@BSDATE",SqlDbType.DateTime),//录入日期
//new SqlParameter("@ETD",SqlDbType.DateTime),//开船日期
//new SqlParameter("@ISSUEDATE",SqlDbType.DateTime),//签单日期
//new SqlParameter("@STLDATE",SqlDbType.DateTime),//结算日期
};
return parms;
}
#endregion
#region 生成更新语句参数
/// <summary>
/// 生成更新语句参数
/// </summary>
/// <returns>返回SqlParameter数组</returns>
private SqlParameter[] GetUpdateParms()
{
SqlParameter[] parms = new SqlParameter[]{
new SqlParameter("@ORDNO",SqlDbType.VarChar,36),//编号
//new SqlParameter("@BSNO",SqlDbType.VarChar,100),//业务编号
new SqlParameter("@ORSTATUS",SqlDbType.Char,1),//订舱状态
new SqlParameter("@MBLNO",SqlDbType.VarChar,30),//主提单号
new SqlParameter("@CUSTOMERNAME",SqlDbType.VarChar,20),//委托单位
new SqlParameter("@ORDTYPE",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("@VESSEL",SqlDbType.VarChar,60),//船名
new SqlParameter("@VOYNO",SqlDbType.VarChar,12),//航次
new SqlParameter("@PlACERECEIPT",SqlDbType.VarChar,60),//收货地
new SqlParameter("@PORTLOADID",SqlDbType.VarChar,36),//装货港代码
new SqlParameter("@PORTDISCHARGEID",SqlDbType.VarChar,36),//卸货港代码
new SqlParameter("@PLACEDELIVERYID",SqlDbType.VarChar,36),//交货地代码
new SqlParameter("@DESTINATIONID",SqlDbType.VarChar,36),//目的地代码
new SqlParameter("@PORTLOAD",SqlDbType.VarChar,60),//装货港
new SqlParameter("@PORTDISCHARGE",SqlDbType.VarChar,60),//卸货港
new SqlParameter("@PLACEDELIVERY",SqlDbType.VarChar,60),//交货地
new SqlParameter("@DESTINATION",SqlDbType.VarChar,60),//目的地
new SqlParameter("@NOBILL",SqlDbType.VarChar,5),//提单份数
new SqlParameter("@ISSUETYPE",SqlDbType.VarChar,12),//签单方式
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("@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("@CNTRTOTAL",SqlDbType.VarChar,4000),//集装箱
//new SqlParameter("@INPUTBY",SqlDbType.VarChar,10),//录入人
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("@CUSTOMSNUM",SqlDbType.Int),//报关票数
new SqlParameter("@REMARK",SqlDbType.VarChar,200),//备注
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("@ISBOOKING",SqlDbType.Bit),//订舱
new SqlParameter("@ISAGENT",SqlDbType.Bit),//使用代理
new SqlParameter("@STLNAME",SqlDbType.VarChar,6),//结算方式
new SqlParameter("@OCEANFEE",SqlDbType.Decimal),//海运费
new SqlParameter("@ISUSD",SqlDbType.Bit),//是否美元结算
new SqlParameter("@ISCOMMISSIONBACK",SqlDbType.Bit),//是否退佣金
new SqlParameter("@CARRIER",SqlDbType.VarChar,20),//船公司
new SqlParameter("@CARRIERATTN",SqlDbType.VarChar,20),//船公司联系人
new SqlParameter("@CARRIERTEL",SqlDbType.VarChar,50),//船公司电话
new SqlParameter("@CARRIEREMAIL",SqlDbType.VarChar,50),//船公司电子邮箱
new SqlParameter("@FORWARDER",SqlDbType.VarChar,20),//订舱代理
new SqlParameter("@FORWARDERATTN",SqlDbType.VarChar,20),//订舱联系人
new SqlParameter("@FORWARDERTEL",SqlDbType.VarChar,50),//订舱电话
new SqlParameter("@FORWARDEREMAIL",SqlDbType.VarChar,50),//订舱电子邮箱
new SqlParameter("@SALE",SqlDbType.VarChar,10),//揽货人
new SqlParameter("@BLTYPE",SqlDbType.VarChar,10),//装箱方式
new SqlParameter("@ISHBLNO",SqlDbType.Bit),//分单签单
new SqlParameter("@SERVICE9",SqlDbType.Bit),//服务项目9
new SqlParameter("@SERVICE10",SqlDbType.Bit),//服务项目10
new SqlParameter("@OP",SqlDbType.VarChar,10),//操作
new SqlParameter("@DOC",SqlDbType.VarChar,10)//单证
//new SqlParameter("@BSDATE",SqlDbType.DateTime),//录入日期
//new SqlParameter("@ETD",SqlDbType.DateTime),//开船日期
//new SqlParameter("@ISSUEDATE",SqlDbType.DateTime),//签单日期
//new SqlParameter("@STLDATE",SqlDbType.DateTime),//结算日期
};
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 GetSeaExportListByCondition(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 strORDNO)
{
DataSet DS = new DataSet();
try
{
string str = "select * from crm_seaeorder where ORDNO='" + strORDNO + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
int ii = DS.Tables[0].Rows.Count;
}
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="strSel">销售订舱信息GID</param>
/// <param name="strUserID">删除人ID</param>
/// <returns>值1表示删除成功 值-1表示有异常删除失败 值-2表示插入异常,事务已回滚成功</returns>
public String GetCrmSeaeorderDel(string strSel, string strUserID)
{
string alt = "";
string str = "delete from crm_seaeorder where ORDNO='" + strSel + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "销售订舱信息表crm_seaeorder删除操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除销售订舱信息表crm_seaeorder','删除操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
#endregion
public int AuditPassCopyToOpSeae(TopSeaeEntity infoEntity, IList<CrmOrderFeeEntity> tempCrmOrderFeeEntities, string strUserID)
{
int iResult = 0;
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
#region 插入委托表参数设置
//获取参数
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,200),//备注
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("@STLNAME",SqlDbType.DateTime)//结算日期
};
#endregion
#region 插入委托表参数赋值
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[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;//录入日期
#endregion
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(SQL_INSER_OP_SEAE_BY_ORDER, strETA_name, strETA, strETD_name, strETD, strCLOSINGDATE_name, strCLOSINGDATE, strISSUEDATE_name, strISSUEDATE, strCLOSEDOCDATE_name, strCLOSEDOCDATE, strINTOPORTDATE_name, strINTOPORTDATE, strSTLDATE_name, strSTLDATE);
//将订舱信息写入委托表
iResult = -3;//订舱信息写入委托表出错
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, strSql,parms);
//将订舱费用插入到委托费用表
SqlParameter[] inserFeeParms = new SqlParameter[]{
new SqlParameter(PARM_FEE_GID,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_BSNO,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TYPE,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_NAME,SqlDbType.VarChar,100),
new SqlParameter(PARM_FEE_DESCRIPTION,SqlDbType.VarChar,100),
new SqlParameter(PARM_FEE_CUSTOMER_TYPE,SqlDbType.VarChar,50),
new SqlParameter(PARM_FEE_CUSTOMER_NAME,SqlDbType.VarChar,50),
new SqlParameter(PARM_FEE_UNIT,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_UNIT_PRICE,SqlDbType.Decimal,18),
new SqlParameter(PARM_FEE_QUANTITY,SqlDbType.Decimal,18),
new SqlParameter(PARM_FEE_AMOUNT,SqlDbType.Decimal,18),
new SqlParameter(PARM_FEE_CURRENCY,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_EXCHANGE_RATE,SqlDbType.Decimal,18),
new SqlParameter(PARM_FEE_REASON,SqlDbType.VarChar,50),
new SqlParameter(PARM_FEE_REMARK,SqlDbType.VarChar,100),
new SqlParameter(PARM_FEE_COMMISSION_RATE,SqlDbType.Decimal,18),
new SqlParameter(PARM_FEE_SETTLEMENT,SqlDbType.Decimal,18),
new SqlParameter(PARM_FEE_INVOICE,SqlDbType.Decimal,18),
new SqlParameter(PARM_FEE_ORDER_AMOUNT,SqlDbType.Decimal,18),
new SqlParameter(PARM_FEE_ORDER_INVOCE,SqlDbType.Decimal,18),
new SqlParameter(PARM_FEE_AUDIT_OPERATOR,SqlDbType.VarChar,50),
new SqlParameter(PARM_FEE_ENTER_OPERATOR,SqlDbType.VarChar,50),
new SqlParameter(PARM_FEE_ENTER_DATE,SqlDbType.DateTime),
new SqlParameter(PARM_FEE_DEBITNO,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_ISDEBIT,SqlDbType.Bit),
new SqlParameter(PARM_FEE_ISOPEN,SqlDbType.Bit),
new SqlParameter(PARM_FEE_ISADVANCEPAY,SqlDbType.Bit),
new SqlParameter(PARM_FEE_SORT,SqlDbType.Int),
new SqlParameter(PARM_FEE_ISINVOICE,SqlDbType.Bit),
new SqlParameter(PARM_FEE_STATUS,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_FRT,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_IS_CRM_ORDER_FEE,SqlDbType.Bit)
};
foreach (CrmOrderFeeEntity crmOrderFeeEntity in tempCrmOrderFeeEntities)
{
inserFeeParms[0].Value = crmOrderFeeEntity.GID;
inserFeeParms[1].Value = crmOrderFeeEntity.BSNO == null ? "" : crmOrderFeeEntity.BSNO;
inserFeeParms[2].Value = crmOrderFeeEntity.FeeType;
inserFeeParms[3].Value = crmOrderFeeEntity.FeeName == null ? "" : crmOrderFeeEntity.FeeName;
inserFeeParms[4].Value = crmOrderFeeEntity.FeeDescription == null ? "" : crmOrderFeeEntity.FeeDescription;
inserFeeParms[5].Value = crmOrderFeeEntity.CustomerType == null ? "" : crmOrderFeeEntity.CustomerType;
inserFeeParms[6].Value = crmOrderFeeEntity.CustomerName == null ? "" : crmOrderFeeEntity.CustomerName;
inserFeeParms[7].Value = crmOrderFeeEntity.Unit == null ? "" : crmOrderFeeEntity.Unit;
inserFeeParms[8].Value = crmOrderFeeEntity.UnitPrice;
inserFeeParms[9].Value = crmOrderFeeEntity.Quantity;
inserFeeParms[10].Value = crmOrderFeeEntity.Amount;
inserFeeParms[11].Value = crmOrderFeeEntity.Currency == null ? "" : crmOrderFeeEntity.Currency;
inserFeeParms[12].Value = crmOrderFeeEntity.ExchangeRate;
inserFeeParms[13].Value = crmOrderFeeEntity.Reason == null ? "" : crmOrderFeeEntity.Reason;
inserFeeParms[14].Value = crmOrderFeeEntity.Remark == null ? "" : crmOrderFeeEntity.Remark;
inserFeeParms[15].Value = crmOrderFeeEntity.CommissionRate;
inserFeeParms[16].Value = crmOrderFeeEntity.Settlement;
inserFeeParms[17].Value = crmOrderFeeEntity.Invoice;
inserFeeParms[18].Value = crmOrderFeeEntity.OrderAmount;
inserFeeParms[19].Value = crmOrderFeeEntity.OrderInvoice;
inserFeeParms[20].Value = crmOrderFeeEntity.AuditOperator == null ? "" : crmOrderFeeEntity.AuditOperator;
inserFeeParms[21].Value = crmOrderFeeEntity.EnterOperator == null ? "" : crmOrderFeeEntity.EnterOperator;
inserFeeParms[22].Value = crmOrderFeeEntity.EnterDate;
inserFeeParms[23].Value = crmOrderFeeEntity.DebitNO == null ? "" : crmOrderFeeEntity.DebitNO;
inserFeeParms[24].Value = crmOrderFeeEntity.IsDebit;
inserFeeParms[25].Value = crmOrderFeeEntity.IsOpen;
inserFeeParms[26].Value = crmOrderFeeEntity.IsAdvancePay;
inserFeeParms[27].Value = crmOrderFeeEntity.Sort;
inserFeeParms[28].Value = crmOrderFeeEntity.IsInvoice;
inserFeeParms[29].Value = crmOrderFeeEntity.FeeStatus;
inserFeeParms[30].Value = crmOrderFeeEntity.FeeFrt == null ? "" : crmOrderFeeEntity.FeeFrt;
inserFeeParms[31].Value = 1;
iResult = -4;//插入订舱的费用
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, SQL_INSERT_FEE, inserFeeParms);
//更新订舱费用ISSUBMIT2FEE字段 标识订舱费用已经成功插入到委托费用表ch_fee
SqlParameter[] updateOrderFeeParms = new SqlParameter[] {
new SqlParameter(PARM_CRM_ORDER_FEE_GID,SqlDbType.VarChar,36)
};
updateOrderFeeParms[0].Value = crmOrderFeeEntity.GID;
iResult = -5;//更新订舱费用ISSUBMIT2FEE字段出错
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, SQL_UPDATE_ORDER_FEE_IS_SUBMIT, updateOrderFeeParms);
}
//集装箱插入
string sCNTRTOTAL="";
string sCNTRNO = "";
DataSet ds = GetFieldAllCTN(" and ORDNO='" + infoEntity.BSNO.Trim() + "'");
if (ds != null)
{
if (ds.Tables[0].Rows.Count > 0)
{
foreach (DataTable myTable in ds.Tables)
{
foreach (DataRow myRow in myTable.Rows)//遍历表
{
/// 返回所有 集装箱插入
string strBSNO=infoEntity.BSNO.Trim();
//string strUserID=infoEntity.INPUTBY.Trim();
string hdcomboCTNCODE=myRow["CTNALL"].ToString().Trim();
int inum=int.Parse(myRow["CTNNUM"].ToString().Trim());
string strCTNID= myRow["CTN_ID"].ToString().Trim();
string strREMARK=myRow["REMARK"].ToString().Trim();
string strCNTRNO="";
string strSEALNO = "";
//
sCNTRTOTAL += hdcomboCTNCODE.Trim() + "*" + inum.ToString().Trim() + " / ";
sCNTRNO += strCNTRNO.Trim() + "/" + strSEALNO.Trim() + "/" + hdcomboCTNCODE.Trim() + "\r\n";//"/" + myRow["PKGS"].ToString().Trim() + "PKGS/" + myRow["KGS"].ToString().Trim() + "KGS/" + myRow["CBM"].ToString().Trim() + "CBM
//
int iTEU = 0;
if (int.Parse(hdcomboCTNCODE.Trim().Substring(0, 2)) < 40)//.Equals("20"))
{
iTEU = 1 * inum;
}
else
{
iTEU = 2 * inum;
}
string strCORPID = GetCORPID(strUserID);//分公司代码
string str = "select * from code_ctn_disp";// where CORPID = '" + strCORPID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
if (DS == null)
{
str = "update op_seae set OTCNTR=OTCNTR+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
}
else
{
int j = 0;
for (int i = 1; i < 11; i++)
{
if (DS.Tables[0].Rows[0][i].ToString().Trim().Equals(hdcomboCTNCODE.Trim()))
{
str = "update op_seae set CNTR" + i + "=CNTR" + i + "+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
j = i;
break;
}
}
if(j==0)
{
str = "update op_seae set OTCNTR=OTCNTR+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
}
}
iResult = -6;//更新委托的集装箱大写和TEU出错
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
//
str = "select * from op_ctn where CTN_ID = '" + strCTNID + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
if (DS != null)
{
str = "update op_ctn set BSNO='" + strBSNO + "',[SIZE]='" + hdcomboCTNCODE.Trim().Substring(0, 2) + "',CTN='" + hdcomboCTNCODE.Trim().Substring(2, 2) + "',CTNNUM=" + inum + ",TEU=" + iTEU + ",CTNALL='" + hdcomboCTNCODE.Trim() + "',REMARK='" + strREMARK + "', CNTRNO='" + strCNTRNO + "', SEALNO='" + strSEALNO + "',PKGS=" + inum + " where CTN_ID='" + strCTNID + "'";
}
else
{
if (strCTNID.Trim().Equals(""))
{
str = "insert into op_ctn(BSNO,[SIZE],CTN,CTNNUM,TEU,CTNALL,REMARK,CNTRNO,SEALNO,PKGS) values('" + strBSNO + "','" + hdcomboCTNCODE.Trim().Substring(0, 2) + "','" + hdcomboCTNCODE.Trim().Substring(2, 2) + "'," + inum + "," + iTEU + ",'" + hdcomboCTNCODE.Trim() + "','" + strREMARK + "','" + strCNTRNO + "','" + strSEALNO + "',"+inum+")";
}
else
{
str = "insert into op_ctn(CTN_ID,BSNO,[SIZE],CTN,CTNNUM,TEU,CTNALL,REMARK,CNTRNO,SEALNO,PKGS) values('" + strCTNID + "','" + strBSNO + "','" + hdcomboCTNCODE.Trim().Substring(0, 2) + "','" + hdcomboCTNCODE.Trim().Substring(2, 2) + "'," + inum + "," + iTEU + ",'" + hdcomboCTNCODE.Trim() + "','" + strREMARK + "','" + strCNTRNO + "','" + strSEALNO + "',"+inum+")";
}
}
iResult = -7;//插入集装箱明细出错
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
}
}
//
iResult = -9;//集装箱大写和箱封号
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, "update op_seae set CNTRTOTAL=CNTRTOTAL+'" + sCNTRTOTAL + "',CNTRSEALNO=CNTRSEALNO+'" + sCNTRNO + "' where BSNO='" + infoEntity.BSNO.Trim() + "'", null);
}
}
//
iResult = -8;//更改销售订舱状态、订舱审核人、审核时间
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, "update crm_seaeorder set ORREASON='',ORSTATUS='0',AUDITOPERATOR='" + strUserID.Trim() + "',AUDITDATE=getdate() where ORDNO='" + infoEntity.BSNO.Trim() + "'", null);
//事务提交
sqlTran.Commit();
iResult = 1;//状态为1表示插入成功
}
catch (Exception execError)
{
iResult = -1;//有异常,插入失败
sqlTran.Rollback();
iResult = -2;//插入异常,事务已回滚成功
throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
/*
iResult = -3;//订舱信息写入委托表出错
iResult = -4;//插入订舱的费用
iResult = -5;//更新订舱费用ISSUBMIT2FEE字段出错
iResult = -6;//更新委托的集装箱大写和TEU出错
iResult = -7;//插入集装箱明细出错
iResult = -8;//更改销售订舱状态
iResult = -9;//插入销售订舱审核人、审核时间
*/
return iResult;
}
#region 根据SQL语句查询海运出口数据集
/// <summary>
/// 返回 某字段
/// </summary>
/// <returns></returns>
public DataSet GetFieldAllCTN(string strSQL)
{
DataSet DS = new DataSet();
try
{
string str = "select * from crm_seaeorderctn where 1=1 " + strSQL + "";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
int ii = DS.Tables[0].Rows.Count;
}
catch
{
DS = null;
}
return DS;
}
#endregion
/// <summary>
/// 返回所有 分公司代码
/// </summary>
/// <param name="strUserID">用户GID</param>
/// <returns></returns>
public String GetCORPID(string strUserID)
{
string str = "select COMPANYID from user_company where USERID='" + strUserID + "' and COMPANYID in (select GID from [company] where ISDELETED=0 and ISDISABLE=0)";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["COMPANYID"].ToString();
}
else
{
str = "";
}
return str;
}
#region 获取销售订舱费用总数
/// <summary>
/// 获取销售订舱费用总数
/// </summary>
/// <param name="tempOrderNO">销售订舱ORDNO</param>
/// <returns>返回总数</returns>
public int GetCrmOrderFeeCountByOrderNO(string tempOrderNO)
{
int iResult = 0;
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
SqlParameter parm = new SqlParameter(PARM_CRM_SEAEORDER_ORD_NO, SqlDbType.VarChar, 36);
parm.Value = tempOrderNO;
iResult = (int)SqlHelper.ExecuteScalar(conn, CommandType.Text, SQL_SELECT_CRM_ORDER_FEE_COUNT_BY_ORDNO, parm);
}
catch (Exception error)
{
throw error;
}
}
return iResult;
}
#endregion
#region 获取销售订舱费用总数
/// <summary>
/// 获取销售订舱费用总数
/// </summary>
/// <param name="tempBSNO">销售订舱BSNO</param>
/// <returns>返回总数</returns>
public int GetCrmOrderFeeCountByBSNO(string tempBSNO)
{
int iResult = 0;
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
SqlParameter parm = new SqlParameter(PARM_CRM_ORDER_FEE_BSNO, SqlDbType.VarChar, 100);
parm.Value = tempBSNO;
iResult = (int)SqlHelper.ExecuteScalar(conn, CommandType.Text, SQL_SELECT_CRM_ORDER_FEE_COUNT_BY_BSNO, parm);
}
catch (Exception error)
{
throw error;
}
}
return iResult;
}
#endregion
}
}