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.

580 lines
40 KiB
C#

11 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 TopSeaeBillmanageDA
{
private const string PARM_MODULE_GID = "@AS_ID";
private const string PARM_OP_SEAE_BILLMANAGE_BSNO = "@bsno";
private const string SQL_SELECT_INFO = "select * from op_seae_billmanage where [AS_ID]=@AS_ID";
private string strSql = "insert into op_seae_billmanage([AS_ID],BSNO,MBLNO,HBLNO,TEMPLATE,BILLTYPE,SHIPPERID,CONSIGNEEID,NOTIFYPARTYID,SHIPPER,CONSIGNEE,"
+ " NOTIFYPARTY,AGENTID,AGENT,YARD,VESSEL,VOYNO,{0}{2}{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,CNTRTOTAL,INPUTBY) "
+ " values(@AS_ID,@BSNO,@MBLNO,@HBLNO,@TEMPLATE,@BILLTYPE,@SHIPPERID,@CONSIGNEEID,@NOTIFYPARTYID,@SHIPPER,@CONSIGNEE,@NOTIFYPARTY,"
+ " @AGENTID,@AGENT,@YARD,@VESSEL,@VOYNO,{1}{3}{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,@CNTRTOTAL,@INPUTBY)";
private string strSqlUpdateInfo = "update op_seae_billmanage set BSNO=@BSNO,MBLNO=@MBLNO,HBLNO=@HBLNO,TEMPLATE=@TEMPLATE,BILLTYPE=@BILLTYPE,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,CNTRTOTAL=@CNTRTOTAL,INPUTBY=@INPUTBY where [AS_ID]=@AS_ID";
private const string SQL_SELECT_OP_SEAE_BILLMANAGE_BY_BSNO = " SELECT AS_ID, BSNO, MBLNO, HBLNO, TEMPLATE, BILLTYPE, 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, CNTRTOTAL, INPUTBY FROM op_seae_billmanage WHERE BSNO = @bsno ";
public TopSeaeBillmanageDA()
{
}
#region 根据委托业务BSNO获取所有提单签发信息
/// <summary>
/// 根据委托业务BSNO获取所有提单签发信息
/// </summary>
/// <param name="strBSNO">委托业务BSNO</param>
/// <returns>返回所有关联的提单签发信息实体类组</returns>
public IList<TopSeaeBillmanageEntity> GetSeaeBillManageByBSNO(string strBSNO)
{
//初始化返回变量
IList<TopSeaeBillmanageEntity> topSeaeBillmanageEntities = new List<TopSeaeBillmanageEntity>();
//初始化参数并赋值
SqlParameter parm = new SqlParameter(PARM_OP_SEAE_BILLMANAGE_BSNO, SqlDbType.VarChar, 100);
parm.Value = strBSNO;
using (SqlDataReader sqlRead = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_SELECT_INFO, parm))
{
try
{
//读取字段值
while (sqlRead.Read())
{
TopSeaeBillmanageEntity topSeaeBillManageEntity = new TopSeaeBillmanageEntity();
if (!sqlRead.IsDBNull(0)) { topSeaeBillManageEntity.AS_ID = sqlRead.GetString(0); } //编号
if (!sqlRead.IsDBNull(1)) { topSeaeBillManageEntity.BSNO = sqlRead.GetString(1); } //业务编号
if (!sqlRead.IsDBNull(2)) { topSeaeBillManageEntity.MBLNO = sqlRead.GetString(2); } //主提单号
if (!sqlRead.IsDBNull(3)) { topSeaeBillManageEntity.HBLNO = sqlRead.GetString(3); } //分提单号
if (!sqlRead.IsDBNull(4)) { topSeaeBillManageEntity.TEMPLATE = sqlRead.GetString(4); } //模板名称
if (!sqlRead.IsDBNull(5)) { topSeaeBillManageEntity.BILLTYPE = sqlRead.GetString(5); } //提单类型
if (!sqlRead.IsDBNull(6)) { topSeaeBillManageEntity.SHIPPERID = sqlRead.GetString(6); } //发货人
if (!sqlRead.IsDBNull(7)) { topSeaeBillManageEntity.CONSIGNEEID = sqlRead.GetString(7); } //收货人
if (!sqlRead.IsDBNull(8)) { topSeaeBillManageEntity.NOTIFYPARTYID = sqlRead.GetString(8); } //通知人
if (!sqlRead.IsDBNull(9)) { topSeaeBillManageEntity.SHIPPER = sqlRead.GetString(9); } //发货人内容
if (!sqlRead.IsDBNull(10)) { topSeaeBillManageEntity.CONSIGNEE = sqlRead.GetString(10); } //收货人内容
if (!sqlRead.IsDBNull(11)) { topSeaeBillManageEntity.NOTIFYPARTY = sqlRead.GetString(11); } //通知人内容
if (!sqlRead.IsDBNull(12)) { topSeaeBillManageEntity.AGENTID = sqlRead.GetString(12); } //国外代理
if (!sqlRead.IsDBNull(13)) { topSeaeBillManageEntity.AGENT = sqlRead.GetString(13); } //国外代理内容
if (!sqlRead.IsDBNull(14)) { topSeaeBillManageEntity.YARD = sqlRead.GetString(14); } //场站
if (!sqlRead.IsDBNull(15)) { topSeaeBillManageEntity.VESSEL = sqlRead.GetString(15); } //船名
if (!sqlRead.IsDBNull(16)) { topSeaeBillManageEntity.VOYNO = sqlRead.GetString(16); } //航次
if (!sqlRead.IsDBNull(17)) { topSeaeBillManageEntity.ETD = sqlRead.GetDateTime(17); } //开船日期
if (!sqlRead.IsDBNull(18)) { topSeaeBillManageEntity.CLOSINGDATE = sqlRead.GetDateTime(18); } //截港日期
if (!sqlRead.IsDBNull(19)) { topSeaeBillManageEntity.ETA = sqlRead.GetDateTime(19); } //预抵日期
if (!sqlRead.IsDBNull(20)) { topSeaeBillManageEntity.PlACERECEIPT = sqlRead.GetString(20); } //收货地
if (!sqlRead.IsDBNull(21)) { topSeaeBillManageEntity.PORTLOADID = sqlRead.GetString(21); } //装货港代码
if (!sqlRead.IsDBNull(22)) { topSeaeBillManageEntity.PORTLOAD = sqlRead.GetString(22); } //装货港
if (!sqlRead.IsDBNull(23)) { topSeaeBillManageEntity.PORTDISCHARGEID = sqlRead.GetString(23); } //卸货港代码
if (!sqlRead.IsDBNull(24)) { topSeaeBillManageEntity.PORTDISCHARGE = sqlRead.GetString(24); } //卸货港
if (!sqlRead.IsDBNull(25)) { topSeaeBillManageEntity.PLACEDELIVERYID = sqlRead.GetString(25); } //交货地代码
if (!sqlRead.IsDBNull(26)) { topSeaeBillManageEntity.PLACEDELIVERY = sqlRead.GetString(26); } //交货地
if (!sqlRead.IsDBNull(27)) { topSeaeBillManageEntity.DESTINATIONID = sqlRead.GetString(27); } //目的地代码
if (!sqlRead.IsDBNull(28)) { topSeaeBillManageEntity.DESTINATION = sqlRead.GetString(28); } //目的地
if (!sqlRead.IsDBNull(29)) { topSeaeBillManageEntity.NOBILL = sqlRead.GetString(29); } //提单份数
if (!sqlRead.IsDBNull(30)) { topSeaeBillManageEntity.ISSUETYPE = sqlRead.GetString(30); } //签单方式
if (!sqlRead.IsDBNull(31)) { topSeaeBillManageEntity.ISSUEDATE = sqlRead.GetDateTime(31); } //签单日期
if (!sqlRead.IsDBNull(32)) { topSeaeBillManageEntity.ISSUEPLACE = sqlRead.GetString(32); } //签单地点
if (!sqlRead.IsDBNull(33)) { topSeaeBillManageEntity.BLFRT = sqlRead.GetString(33); } //付费方式
if (!sqlRead.IsDBNull(34)) { topSeaeBillManageEntity.PREPARDAT = sqlRead.GetString(34); } //预付地点
if (!sqlRead.IsDBNull(35)) { topSeaeBillManageEntity.PAYABLEAT = sqlRead.GetString(35); } //到付地点
if (!sqlRead.IsDBNull(36)) { topSeaeBillManageEntity.SERVICE = sqlRead.GetString(36); } //运输条款
if (!sqlRead.IsDBNull(37)) { topSeaeBillManageEntity.MARKS = sqlRead.GetString(37); } //唛头
if (!sqlRead.IsDBNull(38)) { topSeaeBillManageEntity.CNTRSEALNO = sqlRead.GetString(38); } //箱号封号
if (!sqlRead.IsDBNull(39)) { topSeaeBillManageEntity.NOPKGS = sqlRead.GetString(39); } //件数包装
if (!sqlRead.IsDBNull(40)) { topSeaeBillManageEntity.DESCRIPTION = sqlRead.GetString(40); } //货物描述
if (!sqlRead.IsDBNull(41)) { topSeaeBillManageEntity.GOODSNAME = sqlRead.GetString(41); } //品名
if (!sqlRead.IsDBNull(42)) { topSeaeBillManageEntity.GROSSWEIGHT = sqlRead.GetString(42); } //货物毛重
if (!sqlRead.IsDBNull(43)) { topSeaeBillManageEntity.MEASUREMENT = sqlRead.GetString(43); } //货物尺码
if (!sqlRead.IsDBNull(44)) { topSeaeBillManageEntity.PKGS = sqlRead.GetInt32(44); } //件数
if (!sqlRead.IsDBNull(45)) { topSeaeBillManageEntity.KINDPKGS = sqlRead.GetString(45); } //包装
if (!sqlRead.IsDBNull(46)) { topSeaeBillManageEntity.KGS = sqlRead.GetDecimal(46); } //毛重
if (!sqlRead.IsDBNull(47)) { topSeaeBillManageEntity.CBM = sqlRead.GetDecimal(47); } //尺码
if (!sqlRead.IsDBNull(48)) { topSeaeBillManageEntity.TOTALNO = sqlRead.GetString(48); } //件数大写
if (!sqlRead.IsDBNull(49)) { topSeaeBillManageEntity.CNTRNO = sqlRead.GetString(49); } //集装箱大写
if (!sqlRead.IsDBNull(50)) { topSeaeBillManageEntity.CNTRTOTAL = sqlRead.GetString(50); } //集装箱
if (!sqlRead.IsDBNull(51)) { topSeaeBillManageEntity.INPUTBY = sqlRead.GetString(51); } //录入人
topSeaeBillmanageEntities.Add(topSeaeBillManageEntity);
}
}
catch (Exception exceError)
{
//抛出异常
throw exceError;
}
}
return topSeaeBillmanageEntities;
}
#endregion
#region 根据GID获取信息
/// <summary>
/// 根据GID获取信息
/// </summary>
/// <param name="strRoleGID"></param>
/// <returns></returns>
public TopSeaeBillmanageEntity GetID(string strGID)
{
//初始化返回变量
TopSeaeBillmanageEntity TopSeaeBillmanageEntity = 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
{
TopSeaeBillmanageEntity = new TopSeaeBillmanageEntity();
//读取字段值
while (sqlRead.Read())
{
if (!sqlRead.IsDBNull(0)) { TopSeaeBillmanageEntity.AS_ID = sqlRead.GetString(0); } //编号
if (!sqlRead.IsDBNull(1)) { TopSeaeBillmanageEntity.BSNO = sqlRead.GetString(1); } //业务编号
if (!sqlRead.IsDBNull(2)) { TopSeaeBillmanageEntity.MBLNO = sqlRead.GetString(2); } //主提单号
if (!sqlRead.IsDBNull(3)) { TopSeaeBillmanageEntity.HBLNO = sqlRead.GetString(3); } //分提单号
if (!sqlRead.IsDBNull(4)) { TopSeaeBillmanageEntity.TEMPLATE = sqlRead.GetString(4); } //模板名称
if (!sqlRead.IsDBNull(5)) { TopSeaeBillmanageEntity.BILLTYPE = sqlRead.GetString(5); } //提单类型
if (!sqlRead.IsDBNull(6)) { TopSeaeBillmanageEntity.SHIPPERID = sqlRead.GetString(6); } //发货人
if (!sqlRead.IsDBNull(7)) { TopSeaeBillmanageEntity.CONSIGNEEID = sqlRead.GetString(7); } //收货人
if (!sqlRead.IsDBNull(8)) { TopSeaeBillmanageEntity.NOTIFYPARTYID = sqlRead.GetString(8); } //通知人
if (!sqlRead.IsDBNull(9)) { TopSeaeBillmanageEntity.SHIPPER = sqlRead.GetString(9); } //发货人内容
if (!sqlRead.IsDBNull(10)) { TopSeaeBillmanageEntity.CONSIGNEE = sqlRead.GetString(10); } //收货人内容
if (!sqlRead.IsDBNull(11)) { TopSeaeBillmanageEntity.NOTIFYPARTY = sqlRead.GetString(11); } //通知人内容
if (!sqlRead.IsDBNull(12)) { TopSeaeBillmanageEntity.AGENTID = sqlRead.GetString(12); } //国外代理
if (!sqlRead.IsDBNull(13)) { TopSeaeBillmanageEntity.AGENT = sqlRead.GetString(13); } //国外代理内容
if (!sqlRead.IsDBNull(14)) { TopSeaeBillmanageEntity.YARD = sqlRead.GetString(14); } //场站
if (!sqlRead.IsDBNull(15)) { TopSeaeBillmanageEntity.VESSEL = sqlRead.GetString(15); } //船名
if (!sqlRead.IsDBNull(16)) { TopSeaeBillmanageEntity.VOYNO = sqlRead.GetString(16); } //航次
if (!sqlRead.IsDBNull(17)) { TopSeaeBillmanageEntity.ETD = sqlRead.GetDateTime(17); } //开船日期
if (!sqlRead.IsDBNull(18)) { TopSeaeBillmanageEntity.CLOSINGDATE = sqlRead.GetDateTime(18); } //截港日期
if (!sqlRead.IsDBNull(19)) { TopSeaeBillmanageEntity.ETA = sqlRead.GetDateTime(19); } //预抵日期
if (!sqlRead.IsDBNull(20)) { TopSeaeBillmanageEntity.PlACERECEIPT = sqlRead.GetString(20); } //收货地
if (!sqlRead.IsDBNull(21)) { TopSeaeBillmanageEntity.PORTLOADID = sqlRead.GetString(21); } //装货港代码
if (!sqlRead.IsDBNull(22)) { TopSeaeBillmanageEntity.PORTLOAD = sqlRead.GetString(22); } //装货港
if (!sqlRead.IsDBNull(23)) { TopSeaeBillmanageEntity.PORTDISCHARGEID = sqlRead.GetString(23); } //卸货港代码
if (!sqlRead.IsDBNull(24)) { TopSeaeBillmanageEntity.PORTDISCHARGE = sqlRead.GetString(24); } //卸货港
if (!sqlRead.IsDBNull(25)) { TopSeaeBillmanageEntity.PLACEDELIVERYID = sqlRead.GetString(25); } //交货地代码
if (!sqlRead.IsDBNull(26)) { TopSeaeBillmanageEntity.PLACEDELIVERY = sqlRead.GetString(26); } //交货地
if (!sqlRead.IsDBNull(27)) { TopSeaeBillmanageEntity.DESTINATIONID = sqlRead.GetString(27); } //目的地代码
if (!sqlRead.IsDBNull(28)) { TopSeaeBillmanageEntity.DESTINATION = sqlRead.GetString(28); } //目的地
if (!sqlRead.IsDBNull(29)) { TopSeaeBillmanageEntity.NOBILL = sqlRead.GetString(29); } //提单份数
if (!sqlRead.IsDBNull(30)) { TopSeaeBillmanageEntity.ISSUETYPE = sqlRead.GetString(30); } //签单方式
if (!sqlRead.IsDBNull(31)) { TopSeaeBillmanageEntity.ISSUEDATE = sqlRead.GetDateTime(31); } //签单日期
if (!sqlRead.IsDBNull(32)) { TopSeaeBillmanageEntity.ISSUEPLACE = sqlRead.GetString(32); } //签单地点
if (!sqlRead.IsDBNull(33)) { TopSeaeBillmanageEntity.BLFRT = sqlRead.GetString(33); } //付费方式
if (!sqlRead.IsDBNull(34)) { TopSeaeBillmanageEntity.PREPARDAT = sqlRead.GetString(34); } //预付地点
if (!sqlRead.IsDBNull(35)) { TopSeaeBillmanageEntity.PAYABLEAT = sqlRead.GetString(35); } //到付地点
if (!sqlRead.IsDBNull(36)) { TopSeaeBillmanageEntity.SERVICE = sqlRead.GetString(36); } //运输条款
if (!sqlRead.IsDBNull(37)) { TopSeaeBillmanageEntity.MARKS = sqlRead.GetString(37); } //唛头
if (!sqlRead.IsDBNull(38)) { TopSeaeBillmanageEntity.CNTRSEALNO = sqlRead.GetString(38); } //箱号封号
if (!sqlRead.IsDBNull(39)) { TopSeaeBillmanageEntity.NOPKGS = sqlRead.GetString(39); } //件数包装
if (!sqlRead.IsDBNull(40)) { TopSeaeBillmanageEntity.DESCRIPTION = sqlRead.GetString(40); } //货物描述
if (!sqlRead.IsDBNull(41)) { TopSeaeBillmanageEntity.GOODSNAME = sqlRead.GetString(41); } //品名
if (!sqlRead.IsDBNull(42)) { TopSeaeBillmanageEntity.GROSSWEIGHT = sqlRead.GetString(42); } //货物毛重
if (!sqlRead.IsDBNull(43)) { TopSeaeBillmanageEntity.MEASUREMENT = sqlRead.GetString(43); } //货物尺码
if (!sqlRead.IsDBNull(44)) { TopSeaeBillmanageEntity.PKGS = sqlRead.GetInt32(44); } //件数
if (!sqlRead.IsDBNull(45)) { TopSeaeBillmanageEntity.KINDPKGS = sqlRead.GetString(45); } //包装
if (!sqlRead.IsDBNull(46)) { TopSeaeBillmanageEntity.KGS = sqlRead.GetDecimal(46); } //毛重
if (!sqlRead.IsDBNull(47)) { TopSeaeBillmanageEntity.CBM = sqlRead.GetDecimal(47); } //尺码
if (!sqlRead.IsDBNull(48)) { TopSeaeBillmanageEntity.TOTALNO = sqlRead.GetString(48); } //件数大写
if (!sqlRead.IsDBNull(49)) { TopSeaeBillmanageEntity.CNTRNO = sqlRead.GetString(49); } //集装箱大写
if (!sqlRead.IsDBNull(50)) { TopSeaeBillmanageEntity.CNTRTOTAL = sqlRead.GetString(50); } //集装箱
if (!sqlRead.IsDBNull(51)) { TopSeaeBillmanageEntity.INPUTBY = sqlRead.GetString(51); } //录入人
}
}
catch (Exception exceError)
{
//抛出异常
throw exceError;
}
}
return TopSeaeBillmanageEntity;
}
#endregion
/// <summary>
/// 插入信息
/// </summary>
/// <param name="TopSeaeBillmanageEntity">实体类</param>
/// <returns>值为1插入数据正常,-1操作异常</returns>
public int InserInfo(TopSeaeBillmanageEntity infoEntity)
{
int iResult = 0;
//获取参数
SqlParameter[] parms = GetInsertParms();
parms[0].Value = infoEntity.BSNO;//业务编号
parms[1].Value = infoEntity.MBLNO;//主提单号
parms[2].Value = infoEntity.HBLNO;//分提单号
parms[3].Value = infoEntity.TEMPLATE;//模板名称
parms[4].Value = infoEntity.BILLTYPE;//提单类型
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.AGENTID;//国外代理
parms[12].Value = infoEntity.AGENT;//国外代理内容
parms[13].Value = infoEntity.YARD;//场站
parms[14].Value = infoEntity.VESSEL;//船名
parms[15].Value = infoEntity.VOYNO;//航次
parms[16].Value = infoEntity.PlACERECEIPT;//收货地
parms[17].Value = infoEntity.PORTLOADID;//装货港代码
parms[18].Value = infoEntity.PORTLOAD;//装货港
parms[19].Value = infoEntity.PORTDISCHARGEID;//卸货港代码
parms[20].Value = infoEntity.PORTDISCHARGE;//卸货港
parms[21].Value = infoEntity.PLACEDELIVERYID;//交货地代码
parms[22].Value = infoEntity.PLACEDELIVERY;//交货地
parms[23].Value = infoEntity.DESTINATIONID;//目的地代码
parms[24].Value = infoEntity.DESTINATION;//目的地
parms[25].Value = infoEntity.NOBILL;//提单份数
parms[26].Value = infoEntity.ISSUETYPE;//签单方式
parms[27].Value = infoEntity.ISSUEPLACE;//签单地点
parms[28].Value = infoEntity.BLFRT;//付费方式
parms[29].Value = infoEntity.PREPARDAT;//预付地点
parms[30].Value = infoEntity.PAYABLEAT;//到付地点
parms[31].Value = infoEntity.SERVICE;//运输条款
parms[32].Value = infoEntity.MARKS;//唛头
parms[33].Value = infoEntity.CNTRSEALNO;//箱号封号
parms[34].Value = infoEntity.NOPKGS;//件数包装
parms[35].Value = infoEntity.DESCRIPTION;//货物描述
parms[36].Value = infoEntity.GOODSNAME;//品名
parms[37].Value = infoEntity.GROSSWEIGHT;//货物毛重
parms[38].Value = infoEntity.MEASUREMENT;//货物尺码
parms[39].Value = infoEntity.PKGS;//件数
parms[40].Value = infoEntity.KINDPKGS;//包装
parms[41].Value = infoEntity.KGS;//毛重
parms[42].Value = infoEntity.CBM;//尺码
parms[43].Value = infoEntity.TOTALNO;//件数大写
parms[44].Value = infoEntity.CNTRNO;//集装箱大写
parms[45].Value = infoEntity.CNTRTOTAL;//集装箱
parms[46].Value = infoEntity.INPUTBY;//录入人
parms[47].Value = infoEntity.AS_ID;//编号
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,";
strSql = String.Format(strSql, strETA_name, strETA, strETD_name, strETD, strCLOSINGDATE_name, strCLOSINGDATE, strISSUEDATE_name, strISSUEDATE);
//
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海运业务信息表','插入操作','AS_ID=" + infoEntity.AS_ID + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
else
{
iResult = -1;//执行异常
}
}
return iResult;
}
/// <summary>
/// 更新信息
/// </summary>
/// <param name="TopSeaeBillmanageEntity">实体类</param>
/// <returns>值为1更新数据正常,-1操作异常</returns>
public int UpdateInfo(TopSeaeBillmanageEntity infoEntity)
{
int iResult = 0;
//获取参数
SqlParameter[] parms = GetUpdateParms();
parms[0].Value = infoEntity.AS_ID;//编号
parms[1].Value = infoEntity.BSNO;//业务编号
parms[2].Value = infoEntity.MBLNO;//主提单号
parms[3].Value = infoEntity.HBLNO;//分提单号
parms[4].Value = infoEntity.TEMPLATE;//模板名称
parms[5].Value = infoEntity.BILLTYPE;//提单类型
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.CNTRTOTAL;//集装箱
parms[47].Value = infoEntity.INPUTBY;//录入人
//
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=";
strSqlUpdateInfo = String.Format(strSqlUpdateInfo, strETA_name, strETA, strETD_name, strETD, strCLOSINGDATE_name, strCLOSINGDATE, strISSUEDATE_name, strISSUEDATE);
//
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海运业务信息表','更新操作','AS_ID=" + infoEntity.AS_ID + "','" + 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("@MBLNO",SqlDbType.VarChar,30),//主提单号
new SqlParameter("@HBLNO",SqlDbType.VarChar,30),//分提单号
new SqlParameter("@TEMPLATE",SqlDbType.VarChar,20),//模板名称
new SqlParameter("@BILLTYPE",SqlDbType.VarChar,6),//提单类型
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("@CNTRTOTAL",SqlDbType.VarChar,4000),//集装箱
new SqlParameter("@INPUTBY",SqlDbType.VarChar,10),//录入人
new SqlParameter("@AS_ID",SqlDbType.VarChar,100)//编号
};
return parms;
}
#endregion
#region 生成更新语句参数
/// <summary>
/// 生成更新语句参数
/// </summary>
/// <returns>返回SqlParameter数组</returns>
private SqlParameter[] GetUpdateParms()
{
SqlParameter[] parms = new SqlParameter[]{
new SqlParameter("@AS_ID",SqlDbType.VarChar,100),//业务编号
new SqlParameter("@BSNO",SqlDbType.VarChar,100),//业务编号
new SqlParameter("@MBLNO",SqlDbType.VarChar,30),//主提单号
new SqlParameter("@HBLNO",SqlDbType.VarChar,30),//分提单号
new SqlParameter("@TEMPLATE",SqlDbType.VarChar,20),//模板名称
new SqlParameter("@BILLTYPE",SqlDbType.VarChar,6),//提单类型
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("@CNTRTOTAL",SqlDbType.VarChar,4000),//集装箱
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 GetSeaExportListByCondition(string strSql)
{
DataSet userSet = new DataSet();
userSet = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSql);
return userSet;
}
#endregion
/// <summary>
/// 返回所有 提单信息删除
/// </summary>
/// <returns></returns>
public String GetTopSeaeBillmanageDel(string asid)
{
string str = "delete from op_seae_billmanage where 1<0 " + asid;
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "提单信息删除op_seae_billmanage操作出错";
return alt;
}
return alt;
}
}
}