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.
495 lines
28 KiB
C#
495 lines
28 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
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 DSWeb.Models;
|
|
using System.Collections.Generic;
|
|
using JsonHelper;
|
|
using DSWeb.EntityDA;
|
|
using DSWeb.Log;
|
|
|
|
|
|
namespace DSWeb.Shipping
|
|
{
|
|
public partial class SeaExportInfoHS : System.Web.UI.Page
|
|
{
|
|
private string recvJSON;
|
|
private string strSeaBSNO;
|
|
RangeDA RangeDA = new RangeDA();
|
|
public string strUserID;//用户GID
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (Session["USERID"] != null)
|
|
{
|
|
strUserID = Session["USERID"].ToString().Trim();
|
|
}
|
|
else
|
|
{
|
|
Server.Transfer("~/Error/FriendError.aspx");
|
|
return;
|
|
//strUserID = "";
|
|
}
|
|
//
|
|
recvJSON = "";
|
|
recvJSON = this.recvContainer.Value.Trim();
|
|
|
|
if (Request.QueryString["id"] != null)
|
|
{
|
|
strSeaBSNO = Request.QueryString["id"].ToString().Trim();
|
|
this.dvOrderNumVal.Value = Request.QueryString["id"].ToString().Trim();
|
|
|
|
//权限可视范围
|
|
this.hdRangeV.Value = RangeDA.GetVISIBLERANGE(strUserID.Trim(), "modOrderManagement");
|
|
this.hdRangeO.Value = RangeDA.GetOPERATERANGE(strUserID.Trim(), "modOrderManagement");
|
|
//页面是否只读
|
|
if (Request.QueryString["hdenabled"] != null)
|
|
{
|
|
if (Request.QueryString["hdenabled"].ToString() == "false")
|
|
{
|
|
this.hdRangeO.Value = "4";
|
|
}
|
|
}
|
|
//
|
|
string alt = "";
|
|
if (this.hdRangeV.Value.Trim() != this.hdRangeO.Value.Trim())
|
|
{
|
|
if (this.hdRangeO.Value.Trim().Equals("0"))//全部
|
|
{
|
|
}
|
|
else if (this.hdRangeO.Value.Trim().Equals("1"))//分公司
|
|
{
|
|
alt = RangeDA.GetOrderManagementCompany(strUserID.Trim(), strSeaBSNO);
|
|
if (alt == "")
|
|
{
|
|
divadd.Disabled = true;
|
|
divsave.Disabled = true;
|
|
divdel.Disabled = true;
|
|
divrollback.Disabled = true;
|
|
mygrid_container_recv.Disabled = true;
|
|
}
|
|
}
|
|
else if (this.hdRangeO.Value.Trim().Equals("2"))//部门
|
|
{
|
|
alt = RangeDA.GetOrderManagementDEPT(strUserID.Trim(), strSeaBSNO);
|
|
if (alt == "")
|
|
{
|
|
divadd.Disabled = true;
|
|
divsave.Disabled = true;
|
|
divdel.Disabled = true;
|
|
divrollback.Disabled = true;
|
|
mygrid_container_recv.Disabled = true;
|
|
}
|
|
}
|
|
else if (this.hdRangeO.Value.Trim().Equals("3"))//个人
|
|
{
|
|
alt = RangeDA.GetOrderManagementPerson(strUserID.Trim(), strSeaBSNO);
|
|
if (alt == "")
|
|
{
|
|
divadd.Disabled = true;
|
|
divsave.Disabled = true;
|
|
divdel.Disabled = true;
|
|
divrollback.Disabled = true;
|
|
mygrid_container_recv.Disabled = true;
|
|
}
|
|
}
|
|
else if (this.hdRangeO.Value.Trim().Equals("4"))//无
|
|
{
|
|
divadd.Disabled = true;
|
|
divsave.Disabled = true;
|
|
divdel.Disabled = true;
|
|
divrollback.Disabled = true;
|
|
mygrid_container_recv.Disabled = true;
|
|
}
|
|
}
|
|
|
|
//
|
|
if (!recvJSON.Trim().Equals(""))
|
|
{
|
|
//应收账户保存
|
|
JsonOpSeaeHSGroupEntity OpSeaeHSGroupRecvEntity = GetPostEntity(recvJSON);
|
|
List<JsonOpSeaeHSEntity> OpSeaeHSRecvEntities = new List<JsonOpSeaeHSEntity>();
|
|
|
|
OpSeaeHSRecvEntities = OpSeaeHSGroupRecvEntity.JsonOpSeaeHSEntities;
|
|
|
|
SaveRecvOpSeaeHS(OpSeaeHSGroupRecvEntity);
|
|
//更新完初始化
|
|
recvJSON = "";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Response.Write("-1");
|
|
Response.End();
|
|
}
|
|
}
|
|
|
|
#region 保存应收账户列表更改结果
|
|
/// <summary>
|
|
/// 保存应收账户列表更改结果
|
|
/// </summary>
|
|
/// <param name="tempGroupEntity"></param>
|
|
private void SaveRecvOpSeaeHS(JsonOpSeaeHSGroupEntity tempGroupEntity)
|
|
{
|
|
if (tempGroupEntity != null)
|
|
{
|
|
List<JsonOpSeaeHSEntity> OpSeaeHSEntities = new List<JsonOpSeaeHSEntity>();
|
|
OpSeaeHSEntities = tempGroupEntity.JsonOpSeaeHSEntities;
|
|
OpSeaeHSDA OpSeaeHSDA = new OpSeaeHSDA();
|
|
|
|
DataTable OpSeaeHSTable = new DataTable();
|
|
|
|
string strInitSql = "";
|
|
if (tempGroupEntity.JsonOpSeaeHSEntities.Count > 0)
|
|
{
|
|
string BSNO = tempGroupEntity.JsonOpSeaeHSEntities[0].OpSeaeHS20.Trim();
|
|
strInitSql = " SELECT GID,BSNO,CNTRNO,CARGOCODE,CARGOID,PKGS1,KINDPKGS1,NOPKGS1,CARGOGROSSWT1,CARGOMEASUREMENT1,PKGS2,KINDPKGS2,NOPKGS2,CARGOGROSSWT2,CARGOMEASUREMENT2,KGS,CBM,CONSIGNMENTNO,COUNTRYCODE,REMARK FROM op_seae_hs WHERE 1=1 AND BSNO = '" + BSNO + "'";
|
|
}
|
|
else
|
|
{
|
|
return;
|
|
}
|
|
|
|
OpSeaeHSTable = OpSeaeHSDA.GetExcuteSql(strInitSql).Tables[0];
|
|
|
|
//更新操作SQL语句
|
|
ArrayList sqlList = new ArrayList();
|
|
//日志操作SQL语句
|
|
ArrayList logList = new ArrayList();
|
|
//日志记录
|
|
Logger log = Logger.Instance;
|
|
|
|
for (int i = 0; i < OpSeaeHSTable.Rows.Count; i++)
|
|
{
|
|
foreach (JsonOpSeaeHSEntity OpSeaeHS in OpSeaeHSEntities)
|
|
{
|
|
if (OpSeaeHSTable.Rows[i]["GID"].ToString().Trim().Equals(OpSeaeHS.OpSeaeHS1.Trim()))//惟一编号
|
|
{
|
|
string strSql = "";
|
|
string LogContent = "";
|
|
string ls="";
|
|
LogEntity logEntity = new LogEntity();
|
|
|
|
#region 更改前后信息对比
|
|
//CNTRNO 箱号
|
|
ls = OpSeaeHS.OpSeaeHS2.Trim().ToLower().Equals("null") ? "" : OpSeaeHS.OpSeaeHS2.Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["CNTRNO"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(" CNTRNO = '{0}'", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "箱号", OpSeaeHSTable.Rows[i]["CNTRNO"].ToString().Trim(), ls);
|
|
}
|
|
//CARGOCODE 海关HS码
|
|
ls = OpSeaeHS.OpSeaeHS3.Trim().ToLower().Equals("null") ? "" : OpSeaeHS.OpSeaeHS3.Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["CARGOCODE"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",CARGOCODE = '{0}'", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "海关HS码", OpSeaeHSTable.Rows[i]["CARGOCODE"].ToString().Trim(), ls);
|
|
}
|
|
//CARGOID 货物标识
|
|
ls = OpSeaeHS.OpSeaeHS4.Trim().ToLower().Equals("null") ? "" : OpSeaeHS.OpSeaeHS4.Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["CARGOID"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",CARGOID = '{0}'", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "货物标识", OpSeaeHSTable.Rows[i]["CARGOID"].ToString().Trim(), ls);
|
|
}
|
|
//PKGS1 第一层包装件数
|
|
ls = OpSeaeHS.OpSeaeHS5.ToString().Trim().ToLower().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS5.ToString().Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["PKGS1"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",PKGS1 = {0}", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "第一层包装件数", OpSeaeHSTable.Rows[i]["PKGS1"].ToString().Trim(), ls);
|
|
}
|
|
//KINDPKGS1 第一层包装类型
|
|
ls = OpSeaeHS.OpSeaeHS6.Trim().ToLower().Equals("null") ? "" : OpSeaeHS.OpSeaeHS6.Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["KINDPKGS1"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",KINDPKGS1 = '{0}'", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "第一层包装类型", OpSeaeHSTable.Rows[i]["KINDPKGS1"].ToString().Trim(), ls);
|
|
}
|
|
//NOPKGS1 第一层包装说明
|
|
ls = OpSeaeHS.OpSeaeHS7.Trim().ToLower().Equals("null") ? "" : OpSeaeHS.OpSeaeHS7.Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["NOPKGS1"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",NOPKGS1 = '{0}'", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "第一层包装说明", OpSeaeHSTable.Rows[i]["NOPKGS1"].ToString().Trim(), ls);
|
|
}
|
|
//CARGOGROSSWT1 第一层包装皮重
|
|
ls = OpSeaeHS.OpSeaeHS8.ToString().Trim().ToLower().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS8.ToString().Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["CARGOGROSSWT1"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",CARGOGROSSWT1 = {0}", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "第一层包装皮重", OpSeaeHSTable.Rows[i]["CARGOGROSSWT1"].ToString().Trim(), ls);
|
|
}
|
|
//CARGOMEASUREMENT1 第一层包装尺码
|
|
ls = OpSeaeHS.OpSeaeHS9.ToString().Trim().ToLower().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS9.ToString().Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["CARGOMEASUREMENT1"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",CARGOMEASUREMENT1 = {0}", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "第一层包装尺码", OpSeaeHSTable.Rows[i]["CARGOMEASUREMENT1"].ToString().Trim(), ls);
|
|
}
|
|
//PKGS2 第二层包装件数
|
|
ls = OpSeaeHS.OpSeaeHS10.ToString().Trim().ToLower().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS10.ToString().Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["PKGS2"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",PKGS2 = {0}", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "第二层包装件数", OpSeaeHSTable.Rows[i]["PKGS2"].ToString().Trim(), ls);
|
|
}
|
|
//KINDPKGS2 第二层包装类型
|
|
ls = OpSeaeHS.OpSeaeHS11.Trim().ToLower().Equals("null") ? "" : OpSeaeHS.OpSeaeHS11.Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["KINDPKGS2"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",KINDPKGS2 = '{0}'", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "第二层包装类型", OpSeaeHSTable.Rows[i]["KINDPKGS2"].ToString().Trim(), ls);
|
|
}
|
|
//NOPKGS2 第二层包装说明
|
|
ls = OpSeaeHS.OpSeaeHS12.Trim().ToLower().Equals("null") ? "" : OpSeaeHS.OpSeaeHS12.Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["NOPKGS2"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",NOPKGS2 = '{0}'", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "第二层包装说明", OpSeaeHSTable.Rows[i]["NOPKGS2"].ToString().Trim(), ls);
|
|
}
|
|
//CARGOGROSSWT2 第二层包装皮重
|
|
ls = OpSeaeHS.OpSeaeHS13.ToString().Trim().ToLower().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS13.ToString().Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["CARGOGROSSWT2"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",CARGOGROSSWT2 = {0}", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "第二层包装皮重", OpSeaeHSTable.Rows[i]["CARGOGROSSWT2"].ToString().Trim(), ls);
|
|
}
|
|
//CARGOMEASUREMENT2 第二层包装尺码
|
|
ls = OpSeaeHS.OpSeaeHS14.ToString().Trim().ToLower().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS14.ToString().Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["CARGOMEASUREMENT2"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",CARGOMEASUREMENT2 = {0}", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "第二层包装尺码", OpSeaeHSTable.Rows[i]["CARGOMEASUREMENT2"].ToString().Trim(), ls);
|
|
}
|
|
//KGS 货净重
|
|
ls = OpSeaeHS.OpSeaeHS15.ToString().Trim().ToLower().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS15.ToString().Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["KGS"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",KGS = {0}", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "货净重", OpSeaeHSTable.Rows[i]["KGS"].ToString().Trim(), ls);
|
|
}
|
|
//CBM 货物体积
|
|
ls = OpSeaeHS.OpSeaeHS16.ToString().Trim().ToLower().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS16.ToString().Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["CBM"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",CBM = {0}", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "货物体积", OpSeaeHSTable.Rows[i]["CBM"].ToString().Trim(), ls);
|
|
}
|
|
//CONSIGNMENTNO 托运编号
|
|
ls = OpSeaeHS.OpSeaeHS17.Trim().ToLower().Equals("null") ? "" : OpSeaeHS.OpSeaeHS17.Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["CONSIGNMENTNO"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",CONSIGNMENTNO = '{0}'", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "托运编号", OpSeaeHSTable.Rows[i]["CONSIGNMENTNO"].ToString().Trim(), ls);
|
|
}
|
|
//COUNTRYCODE 货物原产国代码
|
|
ls = OpSeaeHS.OpSeaeHS18.Trim().ToLower().Equals("null") ? "" : OpSeaeHS.OpSeaeHS18.Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["COUNTRYCODE"].ToString().Trim().Equals(ls))
|
|
{
|
|
strSql += String.Format(",COUNTRYCODE = '{0}'", ls);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "货物原产国代码", OpSeaeHSTable.Rows[i]["COUNTRYCODE"].ToString().Trim(), ls);
|
|
}
|
|
//REMARK 备注
|
|
string strREMARK = OpSeaeHS.OpSeaeHS19.Trim().ToLower().Equals("null") ? "" : OpSeaeHS.OpSeaeHS19.Trim();
|
|
if (!OpSeaeHSTable.Rows[i]["REMARK"].ToString().Trim().Equals(strREMARK))
|
|
{
|
|
strSql += String.Format(",REMARK = '{0}'", strREMARK);
|
|
LogContent += String.Format(log.GetLogContentTemplate(Logger.LogTypes.UPDATE), "备注", OpSeaeHSTable.Rows[i]["REMARK"].ToString().Trim(), strREMARK);
|
|
}
|
|
#endregion
|
|
|
|
//如果有字段内容更新则执行更新操作
|
|
if (LogContent.Trim().Length > 1)
|
|
{
|
|
if (strSql.Trim().StartsWith(","))
|
|
{
|
|
strSql = strSql.Trim().Substring(1);
|
|
}
|
|
string strUpdateSql = String.Format("UPDATE {0} SET {1} WHERE GID = '{2}'", "op_seae_hs", strSql, OpSeaeHS.OpSeaeHS1.Trim());
|
|
sqlList.Add(strUpdateSql);
|
|
logList.Add(String.Format("更新账户标识 {0} {1}", OpSeaeHS.OpSeaeHS1.Trim(), LogContent));
|
|
}
|
|
OpSeaeHSEntities.Remove(OpSeaeHS);
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
if (sqlList.Count > 0)
|
|
{
|
|
int iResult = OpSeaeHSDA.UpdateOpSeaeHSFromGrid(sqlList);
|
|
//为1表示更新成功
|
|
//为-1有异常,更新失败
|
|
//为-2更新异常,事务已回滚成功
|
|
//更新完成后,记录日志
|
|
if (iResult == 1)
|
|
{
|
|
#region 日志记录操作
|
|
// INSERT-"INSERT INTO {0} ({1}) VALUES ({2})" @{0}-所要插入记录的表;{1}记录字段值;{2}-记录新值@
|
|
//if (logList.Count > 0)
|
|
//{
|
|
// for (int i = 0; i < logList.Count; i++)
|
|
// {
|
|
// LogEntity logEntity = new LogEntity();
|
|
// logEntity.GID = Guid.NewGuid().ToString();
|
|
// logEntity.Name = "更新账户信息列表";
|
|
// logEntity.LogType = "UPDATE 更新操作";
|
|
// logEntity.CreateUserID = strUserID.Trim();//测试使用数据,正式发布请删除
|
|
// logEntity.LogContent = logList[i].ToString();
|
|
// log.WriteLog(logEntity);
|
|
// }
|
|
//}
|
|
#endregion
|
|
}
|
|
}
|
|
//如果遍历完所有费用表数据,没有相对应的费用信息,则将剩余的费用信息插入到费用表中
|
|
if (OpSeaeHSEntities.Count > 0)
|
|
{
|
|
//插入新的应收费用信息
|
|
InsertOpSeaeHS(OpSeaeHSEntities, 1);
|
|
}
|
|
recvJSON = "";
|
|
this.recvContainer.Value = "";
|
|
}
|
|
else
|
|
{
|
|
recvJSON = "";
|
|
this.recvContainer.Value = "";
|
|
return;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 插入账户信息记录
|
|
/// <summary>
|
|
/// 插入账户信息记录
|
|
/// </summary>
|
|
/// <param name="OpSeaeHSEntities">需要插入账户表的账户实体类</param>
|
|
/// <param name="iType">如果iType值为1则记录账户类型为收/否则记录为付</param>
|
|
public void InsertOpSeaeHS(List<JsonOpSeaeHSEntity> OpSeaeHSEntities, int iType)
|
|
{
|
|
ArrayList sqlInsertList = new ArrayList();
|
|
OpSeaeHSDA OpSeaeHSDA = new OpSeaeHSDA();
|
|
|
|
foreach (JsonOpSeaeHSEntity OpSeaeHS in OpSeaeHSEntities)
|
|
{
|
|
string strItemSql = "";
|
|
string strValueSql = "";
|
|
string strInsertSql = "";
|
|
//GID
|
|
strItemSql += "GID";
|
|
strValueSql += String.Format("'{0}'", OpSeaeHS.OpSeaeHS1.Trim().Equals("null") ? "" : OpSeaeHS.OpSeaeHS1.Trim());
|
|
//箱号
|
|
strItemSql += ",CNTRNO";
|
|
strValueSql += String.Format(",'{0}'", OpSeaeHS.OpSeaeHS2.Trim().Equals("null") ? "" : OpSeaeHS.OpSeaeHS2.Trim());
|
|
//海关HS码
|
|
strItemSql += ",CARGOCODE";
|
|
strValueSql += String.Format(",'{0}'", OpSeaeHS.OpSeaeHS3.Trim().Equals("null") ? "" : OpSeaeHS.OpSeaeHS3.Trim());
|
|
//货物标识
|
|
strItemSql += ",CARGOID";
|
|
strValueSql += String.Format(",'{0}'", OpSeaeHS.OpSeaeHS4.Trim().Equals("null") ? "" : OpSeaeHS.OpSeaeHS4.Trim());
|
|
//PKGS1 第一层包装件数
|
|
strItemSql += ",PKGS1";
|
|
strValueSql += String.Format(",{0}", OpSeaeHS.OpSeaeHS5.ToString().Trim().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS5.ToString().Trim());
|
|
//KINDPKGS1 第一层包装类型
|
|
strItemSql += ",KINDPKGS1";
|
|
strValueSql += String.Format(",'{0}'", OpSeaeHS.OpSeaeHS6.Trim().Equals("null") ? "" : OpSeaeHS.OpSeaeHS6.Trim());
|
|
//NOPKGS1 第一层包装说明
|
|
strItemSql += ",NOPKGS1";
|
|
strValueSql += String.Format(",'{0}'", OpSeaeHS.OpSeaeHS7.Trim().Equals("null") ? "" : OpSeaeHS.OpSeaeHS7.Trim());
|
|
//CARGOGROSSWT1 第一层包装皮重
|
|
strItemSql += ",CARGOGROSSWT1";
|
|
strValueSql += String.Format(",{0}", OpSeaeHS.OpSeaeHS8.ToString().Trim().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS8.ToString().Trim());
|
|
//CARGOMEASUREMENT1 第一层包装尺码
|
|
strItemSql += ",CARGOMEASUREMENT1";
|
|
strValueSql += String.Format(",{0}", OpSeaeHS.OpSeaeHS9.ToString().Trim().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS9.ToString().Trim());
|
|
//PKGS2 第二层包装件数
|
|
strItemSql += ",PKGS2";
|
|
strValueSql += String.Format(",{0}", OpSeaeHS.OpSeaeHS10.ToString().Trim().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS10.ToString().Trim());
|
|
//KINDPKGS2 第二层包装类型
|
|
strItemSql += ",KINDPKGS2";
|
|
strValueSql += String.Format(",'{0}'", OpSeaeHS.OpSeaeHS11.Trim().Equals("null") ? "" : OpSeaeHS.OpSeaeHS11.Trim());
|
|
//NOPKGS2 第二层包装说明
|
|
strItemSql += ",NOPKGS2";
|
|
strValueSql += String.Format(",'{0}'", OpSeaeHS.OpSeaeHS12.Trim().Equals("null") ? "" : OpSeaeHS.OpSeaeHS12.Trim());
|
|
//CARGOGROSSWT2 第二层包装皮重
|
|
strItemSql += ",CARGOGROSSWT2";
|
|
strValueSql += String.Format(",{0}", OpSeaeHS.OpSeaeHS13.ToString().Trim().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS13.ToString().Trim());
|
|
//CARGOMEASUREMENT2 第二层包装尺码
|
|
strItemSql += ",CARGOMEASUREMENT2";
|
|
strValueSql += String.Format(",{0}", OpSeaeHS.OpSeaeHS14.ToString().Trim().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS14.ToString().Trim());
|
|
//KGS 货净重
|
|
strItemSql += ",KGS";
|
|
strValueSql += String.Format(",{0}", OpSeaeHS.OpSeaeHS15.ToString().Trim().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS15.ToString().Trim());
|
|
//CBM 货物体积
|
|
strItemSql += ",CBM";
|
|
strValueSql += String.Format(",{0}", OpSeaeHS.OpSeaeHS16.ToString().Trim().Equals("null") ? "0" : OpSeaeHS.OpSeaeHS16.ToString().Trim());
|
|
//CONSIGNMENTNO 托运编号
|
|
strItemSql += ",CONSIGNMENTNO";
|
|
strValueSql += String.Format(",'{0}'", OpSeaeHS.OpSeaeHS17.Trim().Equals("null") ? "" : OpSeaeHS.OpSeaeHS17.Trim());
|
|
//COUNTRYCODE 货物原产国代码
|
|
strItemSql += ",COUNTRYCODE";
|
|
strValueSql += String.Format(",'{0}'", OpSeaeHS.OpSeaeHS18.Trim().Equals("null") ? "" : OpSeaeHS.OpSeaeHS18.Trim());
|
|
//备注
|
|
strItemSql += ",REMARK";
|
|
strValueSql += String.Format(",'{0}'", OpSeaeHS.OpSeaeHS19.Trim().Equals("null") ? "" : OpSeaeHS.OpSeaeHS19.Trim());
|
|
//业务编号
|
|
strItemSql += ",BSNO";
|
|
strValueSql += String.Format(",'{0}'", OpSeaeHS.OpSeaeHS20);
|
|
//录入人
|
|
strItemSql += ",CREATEUSER";
|
|
strValueSql += String.Format(",'{0}'", strUserID.Trim());
|
|
|
|
//
|
|
if (!strItemSql.Trim().Equals("") && !strValueSql.Trim().Equals(""))
|
|
{
|
|
if (strItemSql.Trim().StartsWith(","))
|
|
{
|
|
strItemSql = strItemSql.Trim().Substring(1);
|
|
}
|
|
if (strValueSql.Trim().StartsWith(","))
|
|
{
|
|
strValueSql = strValueSql.Trim().Substring(1);
|
|
}
|
|
strInsertSql = String.Format("INSERT INTO {0} ({1}) VALUES({2})", "op_seae_hs", strItemSql, strValueSql);
|
|
sqlInsertList.Add(strInsertSql);
|
|
}
|
|
}
|
|
if (sqlInsertList.Count > 0)
|
|
{
|
|
int iResult = OpSeaeHSDA.InsertOpSeaeHSFromGrid(sqlInsertList);
|
|
//为1表示更新成功
|
|
//为-1有异常,更新失败
|
|
//为-2更新异常,事务已回滚成功
|
|
//更新完成后,记录日志
|
|
//if (iResult == 1)
|
|
//{
|
|
//}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取账户客户保存的账户信息
|
|
/// <summary>
|
|
/// 获取账户客户保存的账户信息
|
|
/// </summary>
|
|
/// <param name="tempValue"></param>
|
|
/// <returns></returns>
|
|
public JsonOpSeaeHSGroupEntity GetPostEntity(string tempValue)
|
|
{
|
|
JsonOpSeaeHSGroupEntity OpSeaeHSGroupEntity = (JsonOpSeaeHSGroupEntity)JSON.Instance.ToObject(tempValue);
|
|
return OpSeaeHSGroupEntity;
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
}
|