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.
DS7/DSWeb/Shipping/SeaExportInfo.aspx.cs

4071 lines
216 KiB
C#

2 years ago
using System;
using System.Collections;
using System.Collections.Generic;
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 System.Text;
using DSWeb.DataAccess;
using System.Data.SqlClient;
using DSWeb.Models;
using DSWeb.EntityDA;
using System.Web.Script.Serialization;
using System.ComponentModel;
using System.Drawing;
using System.Web.SessionState;
using System.Web.Mail;
using System.IO;
using System.Data.OleDb;
using JsonHelper;
using DSWeb.Log;
using DSWeb.Attributes;
namespace DSWeb.Shipping
{
public partial class SeaExportInfo : System.Web.UI.Page
{
public string strHandleType = String.Empty;
public string sSQL = String.Empty;
public string gvid = String.Empty;
T_ALL_DA T_ALL_DA = new T_ALL_DA();
MoneyConvert MoneyConvert = new MoneyConvert();
TopSeaeEntity TopSeaeEntity = new TopSeaeEntity();
SeaExportInfoDA SeaExportInfoDA = new SeaExportInfoDA();
CrmSeaeorderEntity CrmSeaeorderEntity = new CrmSeaeorderEntity();
CrmSeaeorderDA CrmSeaeorderDA = new CrmSeaeorderDA();
TopCtnDA TopCtnDA = new TopCtnDA();
TempOpSeaeEdiEntity TempOpSeaeEdiEntity = new TempOpSeaeEdiEntity();
TempOpSeaeEdiDA TempOpSeaeEdiDA = new TempOpSeaeEdiDA();
TopCtnEntity TopCtnEntity = new TopCtnEntity();
RangeDA RangeDA = new RangeDA();
private string recvJSON;
private string strSeaBSNO;
public string strdate;
public string strUserID;//登录用户GID
public string strCompanyID;//公司GID
public string strShowName;//用户显示名
public string strDeptName;//部门名称
protected void Page_Load(object sender, EventArgs e)
{
if (Session["USERID"] != null)
{
strUserID = Session["USERID"].ToString();
this.hdUserID.Value = strUserID;
}
else
{
Server.Transfer("~/Error/FriendError.aspx");
return;
//strUserID = "";
//hdUserID.Value = "";
}
if (Session["SHOWNAME"] != null)
{
strShowName = Session["SHOWNAME"].ToString();
}
if (Session["COMPANYID"] != null)
{
strCompanyID = Session["COMPANYID"].ToString();
}
if (Session["DEPTNAME"] != null)
{
strDeptName = Session["DEPTNAME"].ToString();
}
//
strdate = T_ALL_DA.GetStrSQL("strdate", "select getdate() as strdate");
//页面是否只读
if (Request.QueryString["hdenabled"] != null)
{
if (Request.QueryString["hdenabled"].ToString() == "false")
{
this.hdEnabled.Value = Request.QueryString["hdenabled"].ToString();
getEnabled();
}
else
{
this.hdEnabled.Value = "true";
getEnabledTrue();
}
}
else
{
this.hdEnabled.Value = "true";
getEnabledTrue();
}
//
if (!IsPostBack)
{
DataSet ds = T_ALL_DA.GetTCodeFrt();
if (ds != null)
{
foreach (DataRow dr in ds.Tables[0].Rows)
{
if (dr["FRT"].ToString().Trim() != "")
{
ddlBLFRT.Items.Add(new ListItem(dr["FRT"].ToString().Trim(), dr["FRT"].ToString().Trim()));
}
}
}
ddlBLFRT.Items.Add(new ListItem("", ""));
//
ds = T_ALL_DA.GetTCodeService();
if (ds != null)
{
foreach (DataRow dr in ds.Tables[0].Rows)
{
if (dr["SERVICE"].ToString().Trim() != "")
{
ddlSERVICE.Items.Add(new ListItem(dr["SERVICE"].ToString().Trim(), dr["SERVICE"].ToString().Trim()));
}
}
}
ddlSERVICE.Items.Add(new ListItem("",""));
//
if (Request.QueryString["handle"] != null) //if (Request.QueryString["handle"] != null)
{
////Session["USERID"] = "04eaeac5-f271-45d1-b17b-ad4ccbab63d0";
//if (Session["USERID"] == null)
//{
// //Response.Write("<script>window.open('login.aspx','登陆窗口', 'height=768, width=1024');window.close();</script>");
// //Response.Write("<script>window.close();</script>");
// //return;
//}
//hdUserID.Value = strUserID.Trim();
ViewState["strHandleType"] = Request.QueryString["handle"].ToString();//"edit";
strHandleType = ViewState["strHandleType"].ToString().Trim();
this.hdHandle.Value=ViewState["strHandleType"].ToString().Trim();
//
if (Request.QueryString["id"] != null)//if (Request.QueryString["id"] != null)
{
ViewState["GID"] = Request.QueryString["id"].ToString();//"topseaeusername129481962859531250";
this.hdGid.Value = ViewState["GID"].ToString().Trim();
}
else
{
ViewState["GID"] = "topseaee6a7d3ebfc694ab8a1357ec1a929a6df";
this.hdGid.Value = ViewState["GID"].ToString().Trim();
}
//分公司代码
ds = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, "select COMPANYID from user_company where USERID='" + this.hdUserID.Value.Trim() + "'");
if (ds != null)
{
if (ds.Tables[0].Rows.Count > 0)
{
this.hdCOMPANYID.Value = ds.Tables[0].Rows[0]["COMPANYID"].ToString().Trim();
}
else
{
this.hdCOMPANYID.Value = "";
}
}
else
{
this.hdCOMPANYID.Value = "";
}
/*
if (Request.QueryString["handle"] == null) //if (Request.QueryString["handle"] != null)
{
//Session["USERID"] = "04eaeac5-f271-45d1-b17b-ad4ccbab63d0";
hdUserID.Value = strUserID.Trim();
ViewState["strHandleType"] = "edit";//Request.QueryString["handle"].ToString();
strHandleType = ViewState["strHandleType"].ToString().Trim();
this.hdHandle.Value=ViewState["strHandleType"].ToString().Trim();
//
if (Request.QueryString["id"] == null)//if (Request.QueryString["id"] != null)
{
ViewState["GID"] = "topseaeusername129481962859531250";//Request.QueryString["id"].ToString();
this.hdGid.Value = ViewState["GID"].ToString().Trim();
}
*/
//tbNOPKGS.Attributes["OnKeyPress"] = "javascript:fun()";//限制键盘输入
switch (strHandleType)
{
case "add"://新增
ViewState["GID"] = getBSNO();
this.hdGid.Value = ViewState["GID"].ToString().Trim();
lbBSSTATUS.Text = "未锁定"; //"接受委托";
lbFEESTATUS.Text = "未锁定";
//tbACCDATE.Enabled = true;
//ddlBLTYPE.Enabled = true;
//
tbACCDATE.Text = DateTime.Parse(strdate).Year.ToString().Trim() + "-" + DateTime.Parse(strdate).Month.ToString().Trim();
tbETD.Text="";
tbCLOSINGDATE.Text="";
tbETA.Text="";
tbISSUEDATE.Text="";
tbCLOSEDOCDATE.Text="";
tbINTOPORTDATE.Text = "";
//
tbPKGS.Text = "0";
tbKGS.Text = "0";
tbCBM.Text = "0";
tbINAMOUT.Text = "0";
this.hd_comboBSSOURCE.Value = "自揽货";
this.hd_comboOP.Value = T_ALL_DA.GetStrSQL("SHOWNAME", "select SHOWNAME from [user] where GID='" + this.hdUserID.Value.Trim() + "'");
this.hd_comboDOC.Value = T_ALL_DA.GetStrSQL("SHOWNAME", "select SHOWNAME from [user] where GID='" + this.hdUserID.Value.Trim() + "'");
this.hd_comboKINDPKGS.Value = "PKGS";
//gvCNTRBind();
gvMidwayBind();
//
tbMBLNO.Text = "";
tbHBLNO.Text = "";//调用编码规则
tbCUSTNO.Text = "";//调用编码规则
//tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
//tbCUSTNO.Text = getCodeRule("委托编号", "CUSTNO");//调用编码规则
//
this.hd_comboCUSTOMERNAME.Value = "";
this.hd_comboSHIPPERID.Value = "";
this.hd_comboCONSIGNEEID.Value = "";
this.hd_comboNOTIFYPARTYID.Value = "";
tbSHIPPER.Text = "";
tbCONSIGNEE.Text = "";
tbNOTIFYPARTY.Text = "";
this.hd_comboAGENTID.Value = "";
tbAGENT.Text = "";
this.hd_comboYARD.Value = "";
this.hd_comboTRUCKER.Value = "";
this.hd_comboVESSEL.Value = "";
this.hd_comboVOYNO.Value = "";
tbPORTLOADID.Text = T_ALL_DA.GetStrSQL("PORTLOADID", "select PORTLOADID from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
this.hd_comboPORTLOAD.Value = T_ALL_DA.GetStrSQL("PORTLOAD", "select PORTLOAD from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
tbPORTDISCHARGEID.Text = "";
this.hd_comboPORTDISCHARGE.Value = "";
tbPLACEDELIVERYID.Text = "";
this.hd_comboPLACEDELIVERY.Value = "";
tbDESTINATIONID.Text = "";
this.hd_comboDESTINATION.Value = "";
tbISSUEPLACE.Text = "";
tbBLFRT.Text = "";
tbMARKS.Text = "N/M";
//tbCNTRSEALNO.Text = "";
tbNOPKGS.Text = "";
tbDESCRIPTION.Text = "";
this.hd_comboGOODSNAME.Value = "";
tbGROSSWEIGHT.Text = "";
tbMEASUREMENT.Text = "";
tbTOTALNO.Text = "";
this.hd_comboCUSTSERVICE.Value = "";
this.hd_comboLANE.Value = "";
this.hd_comboSALE.Value = "";
this.hd_comboCARRIER.Value = "";
this.hd_comboFORWARDER.Value = "";
this.hd_comboCUSTOMSER.Value = "";
tbINVNO.Text = "";
tbDCLASS.Text = "";
tbDUNNO.Text = "";
tbREEFERF.Text = "";
//
rblTEMPID.SelectedValue = "C";
cbISCONTAINERSOC.Checked = false;
rblSOURCECODE.SelectedValue = "1";
tbDPAGE.Text = "";
tbDLABEL.Text = "";
tbLINKMAN.Text = "";
tbVESSELID.Text = "";
tbISSUEPLACEID.Text = "";
//
tbTEMPSET.Text = "";
this.hd_comboBSSOURCEDETAIL.Value = "";
tbCONTRACTNO.Text = "";
tbORDERNO.Text = "";
tbINSURANCEER.Text = "";
tbINSURANCENO.Text = "";
//服务项目名读取
ISFUMIGATION.Checked=false;//熏蒸
ISSTORAGE.Checked=false;//仓储
ISLAND.Checked=false;//陆运
ISCUSTOMS.Checked=false;//报关
ISBOOKING.Checked=false;//订舱
ISINSPECTION.Checked=false;//报检
ISAGENT.Checked=false;//使用代理
ISHBLNO.Checked = false;//分单签单
/*
//服务项目名读取
sSQL = "select * from code_service_disp where CORPID=(select COMPANYID from user_company where USERID='" + strUserID.Trim() + "')";
DataSet ds1 = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, sSQL);
if (ds1.Tables[0].Rows.Count > 0)
{
cblSERVICE.Items.Clear();
if (ds1.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim() != "" && ds1.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds1.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim());
}
if (ds1.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim() != "" && ds1.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds1.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim());
}
if (ds1.Tables[0].Rows[0]["ISLAND"].ToString().Trim() != "" && ds1.Tables[0].Rows[0]["ISLAND"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds1.Tables[0].Rows[0]["ISLAND"].ToString().Trim());
}
if (ds1.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim() != "" && ds1.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds1.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim());
}
if (ds1.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != "" && ds1.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds1.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim());
}
if (ds1.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim() != "" && ds1.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds1.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim());
}
if (ds1.Tables[0].Rows[0]["ISAGENT"].ToString().Trim() != "" && ds1.Tables[0].Rows[0]["ISAGENT"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds1.Tables[0].Rows[0]["ISAGENT"].ToString().Trim());
}
if (ds1.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim() != "" && ds1.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds1.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim());
}
if (ds1.Tables[0].Rows[0]["SERVICE9"].ToString().Trim() != "" && ds1.Tables[0].Rows[0]["SERVICE9"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds1.Tables[0].Rows[0]["SERVICE9"].ToString().Trim());
}
if (ds1.Tables[0].Rows[0]["SERVICE10"].ToString().Trim() != "" && ds1.Tables[0].Rows[0]["SERVICE10"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds1.Tables[0].Rows[0]["SERVICE10"].ToString().Trim());
}
}
*/
//
this.hd_comboPACKINGTYPE.Value = "";
this.hd_comboWAREHOUSE.Value = "";
this.hd_comboSALEDEPT.Value = "";
//
this.hd_comboBLTYPE.Value = "整箱";
ddlISSUETYPE.SelectedValue = "正本";
ddlNOBILL.SelectedValue = "3";
ddlCARGOID.SelectedValue = "S";
//结算方式
ddlSTLNAME.Text = "";
tbSTLDATE.Text = "";
this.hdSTLNAME.Value = "";
this.hdSTLDATE.Value = "";
//
this.hd_comboOPERATOR.Value = "";
tbOPERATORTEL.Text = "";
tbOPERATORFAX.Text = "";
tbOPERATOREMAIL.Text = "";
this.hd_comboFINANCIALSTAFF.Value = "";
tbFINANCIALSTAFFTEL.Text = "";
tbFINANCIALSTAFFFAX.Text = "";
tbFINANCIALSTAFFEMAIL.Text = "";
this.hd_comboOPERATORCODE.Value = "";
this.hd_comboFINANCIALSTAFFCODE.Value = "";
tbREMARK.Text = "";
//
//this.hd_comboBLFRT.Value = "FREIGHT PREPAID";
//this.hd_comboBLFRT.Value = T_ALL_DA.GetStrSQL("BLFRT", "select BLFRT from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
//this.hd_comboSERVICE.Value = T_ALL_DA.GetStrSQL("SERVICE", "select SERVICE from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
ddlBLFRT.Text = T_ALL_DA.GetStrSQL("BLFRT", "select BLFRT from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
ddlSERVICE.Text = T_ALL_DA.GetStrSQL("SERVICE", "select SERVICE from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
//
if (ddlBLFRT.Text.Trim() == "FREIGHT PREPAID")//PP
{
tbBLFRT.Text = this.hd_comboPORTLOAD.Value; //POL
}
else if (ddlBLFRT.Text.Trim() == "FREIGHT COLLECT")//CC
{
tbBLFRT.Text = this.hd_comboPORTDISCHARGE.Value; //POD
}
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
break;
case "addfull"://新增
lbBSSTATUS.Text = "未锁定"; //"接受委托";
lbFEESTATUS.Text = "未锁定";
//tbACCDATE.Enabled = true;
//ddlBLTYPE.Enabled = true;
//
ISFUMIGATION.Checked=false;//熏蒸
ISSTORAGE.Checked=false;//仓储
ISLAND.Checked=false;//陆运
ISCUSTOMS.Checked=false;//报关
ISBOOKING.Checked=false;//订舱
ISINSPECTION.Checked=false;//报检
ISAGENT.Checked=false;//使用代理
ISHBLNO.Checked = false;//分单签单
//
TopSeaeEntity = SeaExportInfoDA.GetID(ViewState["GID"].ToString().Trim());
if (TopSeaeEntity.BSNO != null)
{
//服务项目名读取
if (TopSeaeEntity.ISFUMIGATION.ToString().Trim() == "True")
{
ISFUMIGATION.Checked=true;//熏蒸
}
if (TopSeaeEntity.ISSTORAGE.ToString().Trim() == "True")
{
ISSTORAGE.Checked=true;//仓储
}
if (TopSeaeEntity.ISLAND.ToString().Trim() == "True")
{
ISLAND.Checked=true;//陆运
}
if (TopSeaeEntity.ISCUSTOMS.ToString().Trim() == "True")
{
ISCUSTOMS.Checked=true;//报关
}
if (TopSeaeEntity.ISINSPECTION.ToString().Trim() == "True")
{
ISINSPECTION.Checked=true;//报检
}
if (TopSeaeEntity.ISBOOKING.ToString().Trim() == "True")
{
ISBOOKING.Checked=true;//订舱
}
if (TopSeaeEntity.ISAGENT.ToString().Trim() == "True")
{
ISAGENT.Checked=true;//使用代理
}
if (TopSeaeEntity.ISHBLNO.ToString().Trim() == "True")
{
ISHBLNO.Checked=true;//分单签单
}
/*
//服务项目名读取
sSQL = "select * from code_service_disp where CORPID=(select COMPANYID from user_company where USERID='" + strUserID.Trim() + "')";
DataSet ds = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, sSQL);
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim());
}
}
//服务项目名读取
if (cblSERVICE.Items.Count > 0)
{
if (TopSeaeEntity.ISFUMIGATION.ToString().Trim() != null && TopSeaeEntity.ISFUMIGATION.ToString().Trim() != "False")
{
cblSERVICE.Items[0].Selected = true;
}
if (TopSeaeEntity.ISSTORAGE.ToString().Trim() != null && TopSeaeEntity.ISSTORAGE.ToString().Trim() != "False")
{
cblSERVICE.Items[1].Selected = true;
}
if (TopSeaeEntity.ISLAND.ToString().Trim() != null && TopSeaeEntity.ISLAND.ToString().Trim() != "False")
{
cblSERVICE.Items[2].Selected = true;
}
if (TopSeaeEntity.ISCUSTOMS.ToString().Trim() != null && TopSeaeEntity.ISCUSTOMS.ToString().Trim() != "False")
{
cblSERVICE.Items[3].Selected = true;
}
if (TopSeaeEntity.ISINSPECTION.ToString().Trim() != null && TopSeaeEntity.ISINSPECTION.ToString().Trim() != "False")
{
cblSERVICE.Items[4].Selected = true;
}
if (TopSeaeEntity.ISBOOKING.ToString().Trim() != null && TopSeaeEntity.ISBOOKING.ToString().Trim() != "False")
{
cblSERVICE.Items[5].Selected = true;
}
if (TopSeaeEntity.ISAGENT.ToString().Trim() != null && TopSeaeEntity.ISAGENT.ToString().Trim() != "False")
{
cblSERVICE.Items[6].Selected = true;
}
if (TopSeaeEntity.ISHBLNO.ToString().Trim() != null && TopSeaeEntity.ISHBLNO.ToString().Trim() != "False")
{
cblSERVICE.Items[7].Selected = true;
}
if (TopSeaeEntity.SERVICE9.ToString().Trim() != null && TopSeaeEntity.SERVICE9.ToString().Trim() != "False")
{
cblSERVICE.Items[8].Selected = true;
}
if (TopSeaeEntity.SERVICE10.ToString().Trim() != null && TopSeaeEntity.SERVICE10.ToString().Trim() != "False")
{
cblSERVICE.Items[9].Selected = true;
}
}
*/
//
if (TopSeaeEntity.BSSTATUS.ToString().Trim() == "False")
{
lbBSSTATUS.Text = "未锁定";//"接受委托";
}
else
{
lbBSSTATUS.Text = "锁定";//业务封帐
}
if (TopSeaeEntity.FEESTATUS.ToString().Trim() == "False")
{
lbFEESTATUS.Text = "未锁定";
}
else
{
lbFEESTATUS.Text = "锁定";
}
tbACCDATE.Text = DateTime.Parse(strdate).Year.ToString().Trim() + "-" + DateTime.Parse(strdate).Month.ToString().Trim();
tbMBLNO.Text = TopSeaeEntity.MBLNO.ToString().Trim();
tbHBLNO.Text = TopSeaeEntity.HBLNO.ToString().Trim();
tbCUSTNO.Text = TopSeaeEntity.CUSTNO.ToString().Trim();
//"" = TopSeaeEntity.TRANSNO.ToString().Trim();
this.hd_comboCUSTOMERNAME.Value = TopSeaeEntity.CUSTOMERNAME.ToString().Trim();
//ddlBLTYPE.Text = TopSeaeEntity.BLTYPE.ToString().Trim();
this.hd_comboBLTYPE.Value = TopSeaeEntity.BLTYPE.ToString().Trim();
this.hd_comboSHIPPERID.Value = TopSeaeEntity.SHIPPERID.ToString().Trim();
this.hd_comboCONSIGNEEID.Value = TopSeaeEntity.CONSIGNEEID.ToString().Trim();
this.hd_comboNOTIFYPARTYID.Value = TopSeaeEntity.NOTIFYPARTYID.ToString().Trim();
tbSHIPPER.Text = TopSeaeEntity.SHIPPER.ToString().Trim();
tbCONSIGNEE.Text = TopSeaeEntity.CONSIGNEE.ToString().Trim();
tbNOTIFYPARTY.Text = TopSeaeEntity.NOTIFYPARTY.ToString().Trim();
this.hd_comboAGENTID.Value = TopSeaeEntity.AGENTID.ToString().Trim();
tbAGENT.Text = TopSeaeEntity.AGENT.ToString().Trim();
this.hd_comboYARD.Value = TopSeaeEntity.YARD.ToString().Trim();
this.hd_comboTRUCKER.Value = TopSeaeEntity.TRUCKER.ToString().Trim();
this.hd_comboVESSEL.Value = TopSeaeEntity.VESSEL.ToString().Trim();
this.hd_comboVOYNO.Value = TopSeaeEntity.VOYNO.ToString().Trim();
//
if (TopSeaeEntity.ETD.ToString().Trim().IndexOf("0001")>-1)
{
tbETD.Text = "";
}
else
{
tbETD.Text = TopSeaeEntity.ETD.ToString("yyyy-MM-dd").Trim();//.Substring(0,10);
}
if (TopSeaeEntity.CLOSINGDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbCLOSINGDATE.Text = "";
}
else
{
tbCLOSINGDATE.Text = TopSeaeEntity.CLOSINGDATE.ToString("yyyy-MM-dd hh:mm").Trim();
}
if (TopSeaeEntity.ETA.ToString().Trim().IndexOf("0001")>-1)
{
tbETA.Text = "";
}
else
{
tbETA.Text = TopSeaeEntity.ETA.ToString("yyyy-MM-dd").Trim();
}
if (TopSeaeEntity.ISSUEDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbISSUEDATE.Text = "";
}
else
{
tbISSUEDATE.Text = TopSeaeEntity.ISSUEDATE.ToString("yyyy-MM-dd").Trim();
}
if (TopSeaeEntity.CLOSEDOCDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbCLOSEDOCDATE.Text = "";
}
else
{
tbCLOSEDOCDATE.Text = TopSeaeEntity.CLOSEDOCDATE.ToString("yyyy-MM-dd hh:mm").Trim();
}
if (TopSeaeEntity.INTOPORTDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbINTOPORTDATE.Text = "";
}
else
{
tbINTOPORTDATE.Text = TopSeaeEntity.INTOPORTDATE.ToString("yyyy-MM-dd hh:mm").Trim();
}
//
tbPLAID.Text = TopSeaeEntity.PlACERECEIPTID.ToString().Trim();
this.hd_comboPLA.Value = TopSeaeEntity.PlACERECEIPT.ToString().Trim();
tbPORTLOADID.Text = TopSeaeEntity.PORTLOADID.ToString().Trim();
this.hd_comboPORTLOAD.Value = TopSeaeEntity.PORTLOAD.ToString().Trim();
tbPORTDISCHARGEID.Text = TopSeaeEntity.PORTDISCHARGEID.ToString().Trim();
this.hd_comboPORTDISCHARGE.Value = TopSeaeEntity.PORTDISCHARGE.ToString().Trim();
tbPLACEDELIVERYID.Text = TopSeaeEntity.PLACEDELIVERYID.ToString().Trim();
this.hd_comboPLACEDELIVERY.Value = TopSeaeEntity.PLACEDELIVERY.ToString().Trim();
tbDESTINATIONID.Text = TopSeaeEntity.DESTINATIONID.ToString().Trim();
this.hd_comboDESTINATION.Value = TopSeaeEntity.DESTINATION.ToString().Trim();
ddlNOBILL.Text = TopSeaeEntity.NOBILL.ToString().Trim();
ddlISSUETYPE.Text = TopSeaeEntity.ISSUETYPE.ToString().Trim();
tbISSUEPLACE.Text = TopSeaeEntity.ISSUEPLACE.ToString().Trim();
tbMARKS.Text = TopSeaeEntity.MARKS.ToString().Trim();
//tbCNTRSEALNO.Text = TopSeaeEntity.CNTRSEALNO.ToString().Trim();
tbNOPKGS.Text = TopSeaeEntity.NOPKGS.ToString().Trim();
tbDESCRIPTION.Text = TopSeaeEntity.DESCRIPTION.ToString().Trim();
this.hd_comboGOODSNAME.Value = TopSeaeEntity.GOODSNAME.ToString().Trim();
tbGROSSWEIGHT.Text = TopSeaeEntity.GROSSWEIGHT.ToString().Trim();
tbMEASUREMENT.Text = TopSeaeEntity.MEASUREMENT.ToString().Trim();
tbPKGS.Text = TopSeaeEntity.PKGS.ToString().Trim();
this.hd_comboKINDPKGS.Value = TopSeaeEntity.KINDPKGS.ToString().Trim();
tbKGS.Text = TopSeaeEntity.KGS.ToString("F2").Trim();
tbCBM.Text = TopSeaeEntity.CBM.ToString("F2").Trim();
tbTOTALNO.Text = TopSeaeEntity.TOTALNO.ToString().Trim();
//"" = TopSeaeEntity.CNTRNO.ToString().Trim();
//集装箱信息
//gvCNTRBind();
//this.wucCTNCODE1.gvCNTRBind(ViewState["GID"].ToString().Trim());
//0 = TopSeaeEntity.TEU.ToString().Trim();
//"" = TopSeaeEntity.CNTRTOTAL.ToString().Trim();
//"" = TopSeaeEntity.INPUTBY.ToString().Trim();
//
this.hd_comboOP.Value = TopSeaeEntity.OP.ToString().Trim();
this.hd_comboCUSTSERVICE.Value = TopSeaeEntity.CUSTSERVICE.ToString().Trim();
this.hd_comboLANE.Value = TopSeaeEntity.LANE.ToString().Trim();
this.hd_comboSALE.Value = TopSeaeEntity.SALE.ToString().Trim();
this.hd_comboCARRIER.Value = TopSeaeEntity.CARRIER.ToString().Trim();
this.hd_comboFORWARDER.Value = TopSeaeEntity.FORWARDER.ToString().Trim();
this.hd_comboCUSTOMSER.Value = TopSeaeEntity.CUSTOMSER.ToString().Trim();
//"" = TopSeaeEntity.TRUCKER.ToString().Trim();
tbINVNO.Text = TopSeaeEntity.INVNO.ToString().Trim();
ddlCARGOID.SelectedValue = TopSeaeEntity.CARGOID.ToString().Trim();
tbDCLASS.Text = TopSeaeEntity.DCLASS.ToString().Trim();
tbDUNNO.Text = TopSeaeEntity.DUNNO.ToString().Trim();
tbREEFERF.Text = TopSeaeEntity.REEFERF.ToString().Trim();
//
rblTEMPID.SelectedValue = TopSeaeEntity.TEMPID.ToString().Trim();
cbISCONTAINERSOC.Checked = TopSeaeEntity.ISCONTAINERSOC;
rblSOURCECODE.SelectedValue = TopSeaeEntity.SOURCECODE.ToString().Trim();
tbDPAGE.Text = TopSeaeEntity.DPAGE.ToString().Trim();
tbDLABEL.Text = TopSeaeEntity.DLABEL.ToString().Trim();
tbLINKMAN.Text = TopSeaeEntity.LINKMAN.ToString().Trim();
tbVESSELID.Text = TopSeaeEntity.VESSELID.ToString().Trim();
tbISSUEPLACEID.Text = TopSeaeEntity.ISSUEPLACEID.ToString().Trim();
//
tbTEMPSET.Text = TopSeaeEntity.TEMPSET.ToString().Trim();
//"" = TopSeaeEntity.TEMPMAX.ToString().Trim();
//"" = TopSeaeEntity.TEMPMIN.ToString().Trim();
this.hd_comboBSSOURCE.Value = TopSeaeEntity.BSSOURCE.ToString().Trim();
this.hd_comboBSSOURCEDETAIL.Value = TopSeaeEntity.BSSOURCEDETAIL.ToString().Trim();
//0 = TopSeaeEntity.CUSTOMSNUM.ToString().Trim();
tbCONTRACTNO.Text = TopSeaeEntity.CONTRACTNO.ToString().Trim();
//"" = TopSeaeEntity.ORDTYPE.ToString().Trim();
tbORDERNO.Text = TopSeaeEntity.ORDERNO.ToString().Trim();
tbINSURANCEER.Text = TopSeaeEntity.INSURANCEER.ToString().Trim();
tbINSURANCENO.Text = TopSeaeEntity.INSURANCENO.ToString().Trim();
tbINAMOUT.Text = TopSeaeEntity.INAMOUT.ToString().Trim();
//FALSE = TopSeaeEntity.ISVOU.ToString().Trim();
//"" = TopSeaeEntity.VOUNO.ToString().Trim();
tbREMARK.Text = TopSeaeEntity.REMARK.ToString().Trim();
//FALSE = TopSeaeEntity.STATUS1.ToString().Trim();
//FALSE = TopSeaeEntity.STATUS2.ToString().Trim();
//FALSE = TopSeaeEntity.STATUS3.ToString().Trim();
//FALSE = TopSeaeEntity.STATUS4.ToString().Trim();
//FALSE = TopSeaeEntity.STATUS5.ToString().Trim();
//
//
this.hd_comboDOC.Value = TopSeaeEntity.DOC.ToString().Trim();
this.hd_comboPACKINGTYPE.Value = TopSeaeEntity.PACKINGTYPE.ToString().Trim();
this.hd_comboWAREHOUSE.Value = TopSeaeEntity.WAREHOUSE.ToString().Trim();
//"" = TopSeaeEntity.CORPID.ToString().Trim();
this.hd_comboSALEDEPT.Value = TopSeaeEntity.SALEDEPT.ToString().Trim();
//"" = TopSeaeEntity.MBLFRT.ToString().Trim();
//结算方式
ddlSTLNAME.Text = TopSeaeEntity.STLNAME.ToString().Trim();
this.hdSTLNAME.Value = TopSeaeEntity.STLNAME.ToString().Trim();
if (TopSeaeEntity.STLDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbSTLDATE.Text = "";
this.hdSTLDATE.Value = "";
}
else
{
tbSTLDATE.Text = TopSeaeEntity.STLDATE.ToString("yyyy-MM-dd").Trim();
this.hdSTLDATE.Value = TopSeaeEntity.STLDATE.ToString("yyyy-MM-dd").Trim();
}
//ddlSTLNAME.Text = T_ALL_DA.GetStrSQL("STLNAME", "select STLNAME from info_client where SHORTNAME='" + TopSeaeEntity.CUSTOMERNAME.ToString().Trim() + "'"); ;
//tbSTLDATE.Text = T_ALL_DA.GetStrSQL("STLDATE", "select STLDATE from info_client where SHORTNAME='" + TopSeaeEntity.CUSTOMERNAME.ToString().Trim() + "'"); ;
//
this.hd_comboOPERATOR.Value = TopSeaeEntity.OPERATOR.ToString().Trim();
tbOPERATORTEL.Text = TopSeaeEntity.OPERATORTEL.ToString().Trim();
tbOPERATORFAX.Text = TopSeaeEntity.OPERATORFAX.ToString().Trim();
tbOPERATOREMAIL.Text = TopSeaeEntity.OPERATOREMAIL.ToString().Trim();
this.hd_comboFINANCIALSTAFF.Value = TopSeaeEntity.FINANCIALSTAFF.ToString().Trim();
tbFINANCIALSTAFFTEL.Text = TopSeaeEntity.FINANCIALSTAFFTEL.ToString().Trim();
tbFINANCIALSTAFFFAX.Text = TopSeaeEntity.FINANCIALSTAFFFAX.ToString().Trim();
tbFINANCIALSTAFFEMAIL.Text = TopSeaeEntity.FINANCIALSTAFFEMAIL.ToString().Trim();
this.hd_comboOPERATORCODE.Value = TopSeaeEntity.OPERATORCODE.ToString().Trim();
this.hd_comboFINANCIALSTAFFCODE.Value = TopSeaeEntity.FINANCIALSTAFFCODE.ToString().Trim();
this.hdCOMPANYID.Value = TopSeaeEntity.CORPID.ToString().Trim();
//付费方式地点
//this.hd_comboBLFRT.Value = TopSeaeEntity.BLFRT.ToString().Trim();
ddlBLFRT.Text = TopSeaeEntity.BLFRT.ToString().Trim();
if (TopSeaeEntity.BLFRT.ToString().Trim().Equals("FREIGHT PAYABLE BY CARGO PARTNER AG AT VIENNA (CONTACT NO.R)") || TopSeaeEntity.BLFRT.ToString().Trim().Equals("FREIGHT COLLECT"))
{
tbBLFRT.Text = TopSeaeEntity.PAYABLEAT.ToString().Trim();
}
else
{
tbBLFRT.Text = TopSeaeEntity.PREPARDAT.ToString().Trim();
}
//
//this.hd_comboSERVICE.Value = TopSeaeEntity.SERVICE.ToString().Trim();
ddlSERVICE.Text = TopSeaeEntity.SERVICE.ToString().Trim();
//
if (ddlBLFRT.Text.Trim() == "FREIGHT PREPAID")//PP
{
tbBLFRT.Text = this.hd_comboPORTLOAD.Value; //POL
}
else if (ddlBLFRT.Text.Trim() == "FREIGHT COLLECT")//CC
{
tbBLFRT.Text = this.hd_comboPORTDISCHARGE.Value; //POD
}
//
tbHBLNO.Text = "";//调用编码规则
tbCUSTNO.Text = "";//调用编码规则
//tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
//tbCUSTNO.Text = getCodeRule("委托编号", "CUSTNO");//调用编码规则
//
gvMidwayBind();
//
ViewState["GID"] = getBSNO();
this.hdGid.Value = ViewState["GID"].ToString().Trim();
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
}
break;
case "edit"://录入
//tbACCDATE.Enabled = false;
//ddlBLTYPE.Enabled = false;
//服务项目名读取
ISFUMIGATION.Checked=false;//熏蒸
ISSTORAGE.Checked=false;//仓储
ISLAND.Checked=false;//陆运
ISCUSTOMS.Checked=false;//报关
ISINSPECTION.Checked=false;//报检
ISBOOKING.Checked=false;//订舱
ISAGENT.Checked=false;//使用代理
ISHBLNO.Checked = false;//分单签单
//
TopSeaeEntity = SeaExportInfoDA.GetID(ViewState["GID"].ToString().Trim());
if (TopSeaeEntity.BSNO != null)
{
//
//服务项目名读取
if (TopSeaeEntity.ISFUMIGATION.ToString().Trim() == "True")
{
ISFUMIGATION.Checked=true;//熏蒸
}
if (TopSeaeEntity.ISSTORAGE.ToString().Trim() == "True")
{
ISSTORAGE.Checked=true;//仓储
}
if (TopSeaeEntity.ISLAND.ToString().Trim() == "True")
{
ISLAND.Checked=true;//陆运
}
if (TopSeaeEntity.ISCUSTOMS.ToString().Trim() == "True")
{
ISCUSTOMS.Checked=true;//报关
}
if (TopSeaeEntity.ISINSPECTION.ToString().Trim() == "True")
{
ISINSPECTION.Checked=true;//报检
}
if (TopSeaeEntity.ISBOOKING.ToString().Trim() == "True")
{
ISBOOKING.Checked=true;//订舱
}
if (TopSeaeEntity.ISAGENT.ToString().Trim() == "True")
{
ISAGENT.Checked=true;//使用代理
}
if (TopSeaeEntity.ISHBLNO.ToString().Trim() == "True")
{
ISHBLNO.Checked=true;//分单签单
}
/*
//服务项目名读取
sSQL = "select * from code_service_disp where CORPID=(select COMPANYID from user_company where USERID='" + strUserID.Trim() + "')";
DataSet ds = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, sSQL);
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim());
}
}
//
if (cblSERVICE.Items.Count > 0)
{
if (TopSeaeEntity.ISFUMIGATION.ToString().Trim() != null && TopSeaeEntity.ISFUMIGATION.ToString().Trim() != "False")
{
cblSERVICE.Items[0].Selected = true;
}
if (TopSeaeEntity.ISSTORAGE.ToString().Trim() != null && TopSeaeEntity.ISSTORAGE.ToString().Trim() != "False")
{
cblSERVICE.Items[1].Selected = true;
}
if (TopSeaeEntity.ISLAND.ToString().Trim() != null && TopSeaeEntity.ISLAND.ToString().Trim() != "False")
{
cblSERVICE.Items[2].Selected = true;
}
if (TopSeaeEntity.ISCUSTOMS.ToString().Trim() != null && TopSeaeEntity.ISCUSTOMS.ToString().Trim() != "False")
{
cblSERVICE.Items[3].Selected = true;
}
if (TopSeaeEntity.ISINSPECTION.ToString().Trim() != null && TopSeaeEntity.ISINSPECTION.ToString().Trim() != "False")
{
cblSERVICE.Items[4].Selected = true;
}
if (TopSeaeEntity.ISBOOKING.ToString().Trim() != null && TopSeaeEntity.ISBOOKING.ToString().Trim() != "False")
{
cblSERVICE.Items[5].Selected = true;
}
if (TopSeaeEntity.ISAGENT.ToString().Trim() != null && TopSeaeEntity.ISAGENT.ToString().Trim() != "False")
{
cblSERVICE.Items[6].Selected = true;
}
if (TopSeaeEntity.ISHBLNO.ToString().Trim() != null && TopSeaeEntity.ISHBLNO.ToString().Trim() != "False")
{
cblSERVICE.Items[7].Selected = true;
}
if (TopSeaeEntity.SERVICE9.ToString().Trim() != null && TopSeaeEntity.SERVICE9.ToString().Trim() != "False")
{
cblSERVICE.Items[8].Selected = true;
}
if (TopSeaeEntity.SERVICE10.ToString().Trim() != null && TopSeaeEntity.SERVICE10.ToString().Trim() != "False")
{
cblSERVICE.Items[9].Selected = true;
}
}
*/
//
if (TopSeaeEntity.BSSTATUS.ToString().Trim() == "False")
{
lbBSSTATUS.Text = "未锁定";//"接受委托";
}
else
{
lbBSSTATUS.Text = "锁定";//"业务封帐";
}
if (TopSeaeEntity.FEESTATUS.ToString().Trim() == "False")
{
lbFEESTATUS.Text = "未锁定";
}
else
{
lbFEESTATUS.Text = "锁定";
}
tbACCDATE.Text = TopSeaeEntity.ACCDATE.ToString().Trim();
tbMBLNO.Text = TopSeaeEntity.MBLNO.ToString().Trim();
//
tbHBLNO.Text = TopSeaeEntity.HBLNO.ToString().Trim();
getCodeRuleEnabled("分提单号", "HBLNO");
tbCUSTNO.Text = TopSeaeEntity.CUSTNO.ToString().Trim();
getCodeRuleEnabled("委托编号", "CUSTNO");
if (this.hdEnabled.Value == "false")
{
tbHBLNO.Enabled = false;
tbCUSTNO.Enabled = false;
}
//
//"" = TopSeaeEntity.TRANSNO.ToString().Trim();
this.hd_comboCUSTOMERNAME.Value = TopSeaeEntity.CUSTOMERNAME.ToString().Trim();
//ddlBLTYPE.Text = TopSeaeEntity.BLTYPE.ToString().Trim();
this.hd_comboBLTYPE.Value = TopSeaeEntity.BLTYPE.ToString().Trim();
this.hd_comboSHIPPERID.Value = TopSeaeEntity.SHIPPERID.ToString().Trim();
this.hd_comboCONSIGNEEID.Value = TopSeaeEntity.CONSIGNEEID.ToString().Trim();
this.hd_comboNOTIFYPARTYID.Value = TopSeaeEntity.NOTIFYPARTYID.ToString().Trim();
tbSHIPPER.Text = TopSeaeEntity.SHIPPER.ToString().Trim();
tbCONSIGNEE.Text = TopSeaeEntity.CONSIGNEE.ToString().Trim();
tbNOTIFYPARTY.Text = TopSeaeEntity.NOTIFYPARTY.ToString().Trim();
this.hd_comboAGENTID.Value = TopSeaeEntity.AGENTID.ToString().Trim();
tbAGENT.Text = TopSeaeEntity.AGENT.ToString().Trim();
this.hd_comboYARD.Value = TopSeaeEntity.YARD.ToString().Trim();
this.hd_comboTRUCKER.Value = TopSeaeEntity.TRUCKER.ToString().Trim();
this.hd_comboVESSEL.Value = TopSeaeEntity.VESSEL.ToString().Trim();
this.hd_comboVOYNO.Value = TopSeaeEntity.VOYNO.ToString().Trim();
//
if (TopSeaeEntity.ETD.ToString().Trim().IndexOf("0001")>-1)
{
tbETD.Text = "";
}
else
{
tbETD.Text = TopSeaeEntity.ETD.ToString("yyyy-MM-dd").Trim();
}
if (TopSeaeEntity.CLOSINGDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbCLOSINGDATE.Text = "";
}
else
{
tbCLOSINGDATE.Text = TopSeaeEntity.CLOSINGDATE.ToString("yyyy-MM-dd hh:mm").Trim();
}
if (TopSeaeEntity.ETA.ToString().Trim().IndexOf("0001")>-1)
{
tbETA.Text = "";
}
else
{
tbETA.Text = TopSeaeEntity.ETA.ToString("yyyy-MM-dd").Trim();
}
if (TopSeaeEntity.ISSUEDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbISSUEDATE.Text = "";
}
else
{
tbISSUEDATE.Text = TopSeaeEntity.ISSUEDATE.ToString("yyyy-MM-dd").Trim();
}
if (TopSeaeEntity.CLOSEDOCDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbCLOSEDOCDATE.Text = "";
}
else
{
tbCLOSEDOCDATE.Text = TopSeaeEntity.CLOSEDOCDATE.ToString("yyyy-MM-dd hh:mm").Trim();
}
if (TopSeaeEntity.INTOPORTDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbINTOPORTDATE.Text = "";
}
else
{
tbINTOPORTDATE.Text = TopSeaeEntity.INTOPORTDATE.ToString("yyyy-MM-dd hh:mm").Trim();
}
//
tbPLAID.Text = TopSeaeEntity.PlACERECEIPTID.ToString().Trim();
this.hd_comboPLA.Value = TopSeaeEntity.PlACERECEIPT.ToString().Trim();
tbPORTLOADID.Text = TopSeaeEntity.PORTLOADID.ToString().Trim();
this.hd_comboPORTLOAD.Value = TopSeaeEntity.PORTLOAD.ToString().Trim();
tbPORTDISCHARGEID.Text = TopSeaeEntity.PORTDISCHARGEID.ToString().Trim();
this.hd_comboPORTDISCHARGE.Value = TopSeaeEntity.PORTDISCHARGE.ToString().Trim();
tbPLACEDELIVERYID.Text = TopSeaeEntity.PLACEDELIVERYID.ToString().Trim();
this.hd_comboPLACEDELIVERY.Value = TopSeaeEntity.PLACEDELIVERY.ToString().Trim();
tbDESTINATIONID.Text = TopSeaeEntity.DESTINATIONID.ToString().Trim();
this.hd_comboDESTINATION.Value = TopSeaeEntity.DESTINATION.ToString().Trim();
ddlNOBILL.Text = TopSeaeEntity.NOBILL.ToString().Trim();
ddlISSUETYPE.Text = TopSeaeEntity.ISSUETYPE.ToString().Trim();
tbISSUEPLACE.Text = TopSeaeEntity.ISSUEPLACE.ToString().Trim();
//付费方式地点
//this.hd_comboBLFRT.Value = TopSeaeEntity.BLFRT.ToString().Trim();
ddlBLFRT.Text = TopSeaeEntity.BLFRT.ToString().Trim();
if(TopSeaeEntity.BLFRT.ToString().Trim().Equals("FREIGHT PAYABLE BY CARGO PARTNER AG AT VIENNA (CONTACT NO.R)") || TopSeaeEntity.BLFRT.ToString().Trim().Equals("FREIGHT COLLECT"))
{
tbBLFRT.Text=TopSeaeEntity.PAYABLEAT.ToString().Trim();
}
else
{
tbBLFRT.Text=TopSeaeEntity.PREPARDAT.ToString().Trim();
}
//
//this.hd_comboSERVICE.Value = TopSeaeEntity.SERVICE.ToString().Trim();
ddlSERVICE.Text = TopSeaeEntity.SERVICE.ToString().Trim();
//
tbMARKS.Text = TopSeaeEntity.MARKS.ToString().Trim();
//tbCNTRSEALNO.Text = TopSeaeEntity.CNTRSEALNO.ToString().Trim();
tbNOPKGS.Text = TopSeaeEntity.NOPKGS.ToString().Trim();
tbDESCRIPTION.Text = TopSeaeEntity.DESCRIPTION.ToString().Trim();
this.hd_comboGOODSNAME.Value = TopSeaeEntity.GOODSNAME.ToString().Trim();
tbGROSSWEIGHT.Text = TopSeaeEntity.GROSSWEIGHT.ToString().Trim();
tbMEASUREMENT.Text = TopSeaeEntity.MEASUREMENT.ToString().Trim();
tbPKGS.Text = TopSeaeEntity.PKGS.ToString().Trim();
this.hd_comboKINDPKGS.Value = TopSeaeEntity.KINDPKGS.ToString().Trim();
tbKGS.Text = TopSeaeEntity.KGS.ToString("F2").Trim();
tbCBM.Text = TopSeaeEntity.CBM.ToString("F2").Trim();
tbTOTALNO.Text = TopSeaeEntity.TOTALNO.ToString().Trim();
//"" = TopSeaeEntity.CNTRNO.ToString().Trim();
//集装箱信息
//gvCNTRBind();
//this.wucCTNCODE1.gvCNTRBind(ViewState["GID"].ToString().Trim());
//0 = TopSeaeEntity.TEU.ToString().Trim();
//"" = TopSeaeEntity.CNTRTOTAL.ToString().Trim();
//"" = TopSeaeEntity.INPUTBY.ToString().Trim();
//
this.hd_comboOP.Value = TopSeaeEntity.OP.ToString().Trim();
this.hd_comboCUSTSERVICE.Value = TopSeaeEntity.CUSTSERVICE.ToString().Trim();
this.hd_comboLANE.Value = TopSeaeEntity.LANE.ToString().Trim();
this.hd_comboSALE.Value = TopSeaeEntity.SALE.ToString().Trim();
this.hd_comboCARRIER.Value = TopSeaeEntity.CARRIER.ToString().Trim();
this.hd_comboFORWARDER.Value = TopSeaeEntity.FORWARDER.ToString().Trim();
this.hd_comboCUSTOMSER.Value = TopSeaeEntity.CUSTOMSER.ToString().Trim();
//"" = TopSeaeEntity.TRUCKER.ToString().Trim();
tbINVNO.Text = TopSeaeEntity.INVNO.ToString().Trim();
ddlCARGOID.SelectedValue = TopSeaeEntity.CARGOID.ToString().Trim();
tbDCLASS.Text = TopSeaeEntity.DCLASS.ToString().Trim();
tbDUNNO.Text = TopSeaeEntity.DUNNO.ToString().Trim();
tbREEFERF.Text = TopSeaeEntity.REEFERF.ToString().Trim();
//
rblTEMPID.SelectedValue = TopSeaeEntity.TEMPID.ToString().Trim();
cbISCONTAINERSOC.Checked = TopSeaeEntity.ISCONTAINERSOC;
rblSOURCECODE.SelectedValue = TopSeaeEntity.SOURCECODE.ToString().Trim();
tbDPAGE.Text = TopSeaeEntity.DPAGE.ToString().Trim();
tbDLABEL.Text = TopSeaeEntity.DLABEL.ToString().Trim();
tbLINKMAN.Text = TopSeaeEntity.LINKMAN.ToString().Trim();
tbVESSELID.Text = TopSeaeEntity.VESSELID.ToString().Trim();
tbISSUEPLACEID.Text = TopSeaeEntity.ISSUEPLACEID.ToString().Trim();
//
tbTEMPSET.Text = TopSeaeEntity.TEMPSET.ToString().Trim();
//"" = TopSeaeEntity.TEMPMAX.ToString().Trim();
//"" = TopSeaeEntity.TEMPMIN.ToString().Trim();
this.hd_comboBSSOURCE.Value = TopSeaeEntity.BSSOURCE.ToString().Trim();
this.hd_comboBSSOURCEDETAIL.Value = TopSeaeEntity.BSSOURCEDETAIL.ToString().Trim();
//0 = TopSeaeEntity.CUSTOMSNUM.ToString().Trim();
tbCONTRACTNO.Text = TopSeaeEntity.CONTRACTNO.ToString().Trim();
//"" = TopSeaeEntity.ORDTYPE.ToString().Trim();
tbORDERNO.Text = TopSeaeEntity.ORDERNO.ToString().Trim();
tbINSURANCEER.Text = TopSeaeEntity.INSURANCEER.ToString().Trim();
tbINSURANCENO.Text = TopSeaeEntity.INSURANCENO.ToString().Trim();
tbINAMOUT.Text = TopSeaeEntity.INAMOUT.ToString().Trim();
//FALSE = TopSeaeEntity.ISVOU.ToString().Trim();
//"" = TopSeaeEntity.VOUNO.ToString().Trim();
tbREMARK.Text = TopSeaeEntity.REMARK.ToString().Trim();
//FALSE = TopSeaeEntity.STATUS1.ToString().Trim();
//FALSE = TopSeaeEntity.STATUS2.ToString().Trim();
//FALSE = TopSeaeEntity.STATUS3.ToString().Trim();
//FALSE = TopSeaeEntity.STATUS4.ToString().Trim();
//FALSE = TopSeaeEntity.STATUS5.ToString().Trim();
//
this.hd_comboDOC.Value = TopSeaeEntity.DOC.ToString().Trim();
this.hd_comboPACKINGTYPE.Value = TopSeaeEntity.PACKINGTYPE.ToString().Trim();
this.hd_comboWAREHOUSE.Value = TopSeaeEntity.WAREHOUSE.ToString().Trim();
//"" = TopSeaeEntity.CORPID.ToString().Trim();
this.hd_comboSALEDEPT.Value = TopSeaeEntity.SALEDEPT.ToString().Trim();
//"" = TopSeaeEntity.MBLFRT.ToString().Trim();
//结算方式
ddlSTLNAME.Text = TopSeaeEntity.STLNAME.ToString().Trim();
this.hdSTLNAME.Value = TopSeaeEntity.STLNAME.ToString().Trim();
if (TopSeaeEntity.STLDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbSTLDATE.Text = "";
this.hdSTLDATE.Value = "";
}
else
{
tbSTLDATE.Text = TopSeaeEntity.STLDATE.ToString("yyyy-MM-dd").Trim();
this.hdSTLDATE.Value = TopSeaeEntity.STLDATE.ToString("yyyy-MM-dd").Trim();
}
//ddlSTLNAME.Text = T_ALL_DA.GetStrSQL("STLNAME", "select STLNAME from info_client where SHORTNAME='" + TopSeaeEntity.CUSTOMERNAME.ToString().Trim() + "'");
//tbSTLDATE.Text = T_ALL_DA.GetStrSQL("STLDATE", "select STLDATE from info_client where SHORTNAME='" + TopSeaeEntity.CUSTOMERNAME.ToString().Trim() + "'");
//
this.hd_comboOPERATOR.Value = TopSeaeEntity.OPERATOR.ToString().Trim();
tbOPERATORTEL.Text = TopSeaeEntity.OPERATORTEL.ToString().Trim();
tbOPERATORFAX.Text = TopSeaeEntity.OPERATORFAX.ToString().Trim();
tbOPERATOREMAIL.Text = TopSeaeEntity.OPERATOREMAIL.ToString().Trim();
this.hd_comboFINANCIALSTAFF.Value = TopSeaeEntity.FINANCIALSTAFF.ToString().Trim();
tbFINANCIALSTAFFTEL.Text = TopSeaeEntity.FINANCIALSTAFFTEL.ToString().Trim();
tbFINANCIALSTAFFFAX.Text = TopSeaeEntity.FINANCIALSTAFFFAX.ToString().Trim();
tbFINANCIALSTAFFEMAIL.Text = TopSeaeEntity.FINANCIALSTAFFEMAIL.ToString().Trim();
this.hd_comboOPERATORCODE.Value = TopSeaeEntity.OPERATORCODE.ToString().Trim();
this.hd_comboFINANCIALSTAFFCODE.Value = TopSeaeEntity.FINANCIALSTAFFCODE.ToString().Trim();
this.hdCOMPANYID.Value = TopSeaeEntity.CORPID.ToString().Trim();
//
gvMidwayBind();
//业务状态的颜色值
string str = T_ALL_DA.GetTCodeBsstatus("海运出口", TopSeaeEntity.BSSTATUS);
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int f = 0;
if (str != "" && str != null)
{
d = str.IndexOf(",");
f = str.LastIndexOf(",");
a = int.Parse(str.Substring(0, d));
b = int.Parse(str.Substring((d+1), (f-(d+1))));
c = int.Parse(str.Substring((f + 1), (str.Length-(f + 1))));
lbBSSTATUS.BackColor = System.Drawing.Color.FromArgb(a, b, c);
}
//费用状态的颜色值
str = T_ALL_DA.GetTCodeFeeColor(lbFEESTATUS.Text.Trim());
if (str != "" && str != null)
{
d = str.IndexOf(",");
f = str.LastIndexOf(",");
a = int.Parse(str.Substring(0, d));
b = int.Parse(str.Substring((d + 1), (f - (d + 1))));
c = int.Parse(str.Substring((f + 1), (str.Length - (f + 1))));
lbBSSTATUS.BackColor = System.Drawing.Color.FromArgb(a, b, c);
}
}
//
if (this.hdEnabled.Value == "true")
{
ibDel.Enabled = true;
ibAdd.Enabled = true;
ibFullAdd.Enabled = true;
}
break;
}
}
else
{
}
//
if (this.hdEnabled.Value == "true")
{
//权限可视范围
if (strHandleType.Trim() == "edit")
{
//if (TopSeaeEntity.BSSTATUS.ToString().Trim() == "False")
//{
//lbBSSTATUS.Text = "未锁定";//"接受委托";
string strV = RangeDA.GetVISIBLERANGE(this.hdUserID.Value.Trim(), "modOrderManagement");//销售订舱列表
string strO = RangeDA.GetOPERATERANGE(this.hdUserID.Value.Trim(), "modOrderManagement");//销售订舱列表
string alt = "";
if (strV.Trim() != strO.Trim())
{
if (strO.Trim().Equals("0"))//全部
{
}
else if (strO.Trim().Equals("1"))//分公司
{
alt = RangeDA.GetOrderManagementCompany(this.hdUserID.Value.Trim(), ViewState["GID"].ToString().Trim());
if (alt == "")
{
getEnabled();
}
ibAdd.Enabled = true;
ibFullAdd.Enabled = true;
}
else if (strO.Trim().Equals("2"))//部门
{
alt = RangeDA.GetOrderManagementDEPT(this.hdUserID.Value.Trim(), ViewState["GID"].ToString().Trim());
if (alt == "")
{
getEnabled();
}
ibAdd.Enabled = true;
ibFullAdd.Enabled = true;
}
else if (strO.Trim().Equals("3"))//个人
{
alt = RangeDA.GetOrderManagementPerson(this.hdUserID.Value.Trim(), ViewState["GID"].ToString().Trim());
if (alt == "")
{
getEnabled();
}
ibAdd.Enabled = true;
ibFullAdd.Enabled = true;
}
else if (strO.Trim().Equals("4"))//无
{
getEnabled();
}
}
//}
//else
//{
// //lbBSSTATUS.Text = "锁定";//"业务封帐";
// getEnabled();
//}
}
else
{
getEnabledTrue();
}
}
//
}
//集装箱
recvJSON = "";
recvJSON = this.recvContainer.Value.Trim();
if (ViewState["GID"] != null)
{
if (this.hdEnter.Value != "")
{
getEnter();
}
//
if (ViewState["GID"].ToString().Trim().Equals(""))
{
strSeaBSNO = ViewState["GID"].ToString().Trim();
this.dvOrderNumVal.Value = ViewState["GID"].ToString().Trim();
}
else
{
strSeaBSNO = ViewState["GID"].ToString().Trim();
this.dvOrderNumVal.Value = ViewState["GID"].ToString().Trim();
}
if (!recvJSON.Trim().Equals(""))
{
//应收账户保存
JsonTopCtnGroupEntity TopCtnGroupRecvEntity = GetPostEntity(recvJSON);
List<JsonTopCtnEntity> TopCtnRecvEntities = new List<JsonTopCtnEntity>();
TopCtnRecvEntities = TopCtnGroupRecvEntity.JsonTopCtnEntities;
SaveRecvTopCtn(TopCtnGroupRecvEntity);
//更新完初始化
recvJSON = "";
}
}
else
{
//Response.Write("-1");
//Response.End();
}
//加载下拉框
Page.ClientScript.RegisterStartupScript(this.GetType(), "key0", "<script>initComboOP();initComboSALE();initComboDOC();initComboCUSTSERVICE();initComboCUSTOMERNAME();initComboSHIPPERID();initComboCONSIGNEEID();initComboNOTIFYPARTYID();initComboAGENTID();initComboGOODSNAME();initComboYARD();initComboCARRIER();initComboFORWARDER();initComboCUSTOMSER();initComboWAREHOUSE();initComboLANE();initComboVESSEL();initComboPORTLOAD();initComboPORTDISCHARGE();initComboDESTINATION();initComboPLACEDELIVERY();initComboPACKINGTYPE();initComboKINDPKGS();initComboBSSOURCE();initComboOPERATOR();initComboFINANCIALSTAFF();initComboSALEDEPT();initComboTRUCKER();initcomboPLA();initComboBLTYPE();</script>");//initComboSERVICE();//运输条款initComboBLFRT();//付费方式
}
protected void getEnabled()
{
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
this.ibEnter.Disabled = true;
this.imgFresh.Disabled = true;
ibDel.Enabled = false;
this.ibPrint.Disabled = true;
//
this.hdEnabled.Value = "false";
//
tbACCDATE.Enabled = false;
//ddlBLTYPE.Disabled = true;
//ddlCUSTOMERNAME.Enabled = false;
//ddlBSSOURCE.Enabled = false;
//ddlBSSOURCEDETAIL.Enabled = false;
//ddlSALEDEPT.Enabled = false;
//ddlOP.Enabled = false;
//ddlSALE.Enabled = false;
//ddlDOC.Enabled = false;
//ddlCUSTSERVICE.Enabled = false;
ISFUMIGATION.Enabled = false;
ISSTORAGE.Enabled = false;
ISLAND.Enabled = false;
ISCUSTOMS.Enabled = false;
ISINSPECTION.Enabled = false;
ISBOOKING.Enabled = false;
ISAGENT.Enabled = false;
ISHBLNO.Enabled = false;
//ddlSTLNAME.Disabled = true;
tbSTLDATE.Enabled = false;
tbMBLNO.Enabled = false;
//
getCodeRuleEnabled("分提单号", "HBLNO");
getCodeRuleEnabled("委托编号", "CUSTNO");
tbCUSTNO.Enabled = false;
tbHBLNO.Enabled = false;
//
tbORDERNO.Enabled = false;
//ddlOPERATOR.Enabled = false;
tbOPERATORTEL.Enabled = false;
tbOPERATORFAX.Enabled = false;
tbOPERATOREMAIL.Enabled = false;
//ddlFINANCIALSTAFF.Enabled = false;
tbFINANCIALSTAFFTEL.Enabled = false;
tbFINANCIALSTAFFFAX.Enabled = false;
tbFINANCIALSTAFFEMAIL.Enabled = false;
//ddlSHIPPERID.Enabled = false;
tbSHIPPER.Enabled = false;
//ddlCONSIGNEEID.Enabled = false;
tbCONSIGNEE.Enabled = false;
//ddlNOTIFYPARTYID.Enabled = false;
tbNOTIFYPARTY.Enabled = false;
//
divadd.Disabled = true;
divsave.Disabled = true;
divdel.Disabled = true;
divrollback.Disabled = true;
divrefresh.Disabled = true;
divctn.Disabled = true;
////btCTN.Enabled = false;
mygrid_container_recv.Disabled = true;
//
//ddlYARD.Enabled = false;
//ddlCARRIER.Enabled = false;
//ddlFORWARDER.Enabled = false;
//ddlCUSTOMSER.Enabled = false;
//ddlPACKINGTYPE.Enabled = false;
//ddlWAREHOUSE.Enabled = false;
//ddlLANE.Enabled = false;
//ddlTRUCKER.Enabled = false;
//ddlAGENTID.Enabled = false;
tbAGENT.Enabled = false;
tbETD.Enabled = false;
tbETA.Enabled = false;
//ddlVESSEL.Enabled = false;
//ddlVOYNO.Enabled = false;
//ddlPORTLOAD.Enabled = false;
//ddlPORTDISCHARGE.Enabled = false;
//ddlDESTINATION.Enabled = false;
//ddlPLACEDELIVERY.Enabled = false;
//ddlPLACERECEIPT.Enabled = false;
tbCLOSINGDATE.Enabled = false;
tbCLOSEDOCDATE.Enabled = false;
tbINTOPORTDATE.Enabled = false;
tbMARKS.Enabled = false;
//ddlGOODSNAME.Enabled = false;
tbDESCRIPTION.Enabled = false;
tbNOPKGS.Enabled = false;
tbPKGS.Enabled = false;
//ddlKINDPKGS.Enabled = false;
tbGROSSWEIGHT.Enabled = false;
tbKGS.Enabled = false;
tbMEASUREMENT.Enabled = false;
tbCBM.Enabled = false;
tbTOTALNO.Enabled = false;
ddlISSUETYPE.Enabled = false;
tbISSUEDATE.Enabled = false;
tbISSUEPLACE.Enabled = false;
ddlNOBILL.Enabled = false;
ddlBLFRT.Enabled = false;
tbBLFRT.Enabled = false;
ddlSERVICE.Enabled = false;
ibMidway.Enabled = false;
gvMidway.Enabled = false;
ddlCARGOID.Enabled = false;
tbREEFERF.Enabled = false;
//
rblTEMPID.Enabled = false;
cbISCONTAINERSOC.Enabled = false;
rblSOURCECODE.Enabled = false;
tbDPAGE.Enabled = false;
tbDLABEL.Enabled = false;
tbLINKMAN.Enabled = false;
tbVESSELID.Enabled = false;
tbISSUEPLACEID.Enabled = false;
//
tbTEMPSET.Enabled = false;
tbDCLASS.Enabled = false;
tbDUNNO.Enabled = false;
tbINSURANCEER.Enabled = false;
tbINSURANCENO.Enabled = false;
tbINAMOUT.Enabled = false;
tbINVNO.Enabled = false;
tbCONTRACTNO.Enabled = false;
tbPORTLOADID.Enabled = false;
tbPORTDISCHARGEID.Enabled = false;
tbPLACEDELIVERYID.Enabled = false;
tbDESTINATIONID.Enabled = false;
tbPLAID.Enabled = false;
tbREMARK.Enabled = false;
}
protected void getEnabledTrue()
{
ibAdd.Enabled = true;
ibFullAdd.Enabled = true;
this.ibEnter.Disabled = false;
this.imgFresh.Disabled = false;
ibDel.Enabled = true;
this.ibPrint.Disabled = false;
//
this.hdEnabled.Value = "true";
//
tbACCDATE.Enabled = true;
//ddlBLTYPE.Disabled = false;
//ddlCUSTOMERNAME.Enabled = true;
//ddlBSSOURCE.Enabled = true;
//ddlBSSOURCEDETAIL.Enabled = true;
//ddlSALEDEPT.Enabled = true;
//ddlOP.Enabled = true;
//ddlSALE.Enabled = true;
//ddlDOC.Enabled = true;
//ddlCUSTSERVICE.Enabled = true;
ISFUMIGATION.Enabled = true;
ISSTORAGE.Enabled = true;
ISLAND.Enabled = true;
ISCUSTOMS.Enabled = true;
ISINSPECTION.Enabled = true;
ISBOOKING.Enabled = true;
ISAGENT.Enabled = true;
ISHBLNO.Enabled = true;
//ddlSTLNAME.Disabled = false;
//tbSTLDATE.Enabled = true;
tbMBLNO.Enabled = true;
//
tbCUSTNO.Enabled = true;
tbHBLNO.Enabled = true;
getCodeRuleEnabled("分提单号", "HBLNO");
getCodeRuleEnabled("委托编号", "CUSTNO");
//
tbORDERNO.Enabled = true;
//ddlOPERATOR.Enabled = true;
tbOPERATORTEL.Enabled = true;
tbOPERATORFAX.Enabled = true;
tbOPERATOREMAIL.Enabled = true;
//ddlFINANCIALSTAFF.Enabled = true;
tbFINANCIALSTAFFTEL.Enabled = true;
tbFINANCIALSTAFFFAX.Enabled = true;
tbFINANCIALSTAFFEMAIL.Enabled = true;
//ddlSHIPPERID.Enabled = true;
tbSHIPPER.Enabled = true;
//ddlCONSIGNEEID.Enabled = true;
tbCONSIGNEE.Enabled = true;
//ddlNOTIFYPARTYID.Enabled = true;
tbNOTIFYPARTY.Enabled = true;
//
divadd.Disabled = false;
divsave.Disabled = false;
divdel.Disabled = false;
divrollback.Disabled = false;
divrefresh.Disabled = false;
divctn.Disabled = false;
////btCTN.Enabled = true;
mygrid_container_recv.Disabled = false;
//
//ddlYARD.Enabled = true;
//ddlCARRIER.Enabled = true;
//ddlFORWARDER.Enabled = true;
//ddlCUSTOMSER.Enabled = true;
//ddlPACKINGTYPE.Enabled = true;
//ddlWAREHOUSE.Enabled = true;
//ddlLANE.Enabled = true;
//ddlTRUCKER.Enabled = true;
//ddlAGENTID.Enabled = true;
tbAGENT.Enabled = true;
tbETD.Enabled = true;
tbETA.Enabled = true;
//ddlVESSEL.Enabled = true;
//ddlVOYNO.Enabled = true;
//ddlPORTLOAD.Enabled = true;
//ddlPORTDISCHARGE.Enabled = true;
//ddlDESTINATION.Enabled = true;
//ddlPLACEDELIVERY.Enabled = true;
//ddlPLACERECEIPT.Enabled = true;
tbCLOSINGDATE.Enabled = true;
tbCLOSEDOCDATE.Enabled = true;
tbINTOPORTDATE.Enabled = true;
tbMARKS.Enabled = true;
//ddlGOODSNAME.Enabled = true;
tbDESCRIPTION.Enabled = true;
tbNOPKGS.Enabled = true;
tbPKGS.Enabled = true;
//ddlKINDPKGS.Enabled = true;
tbGROSSWEIGHT.Enabled = true;
tbKGS.Enabled = true;
tbMEASUREMENT.Enabled = true;
tbCBM.Enabled = true;
tbTOTALNO.Enabled = true;
ddlISSUETYPE.Enabled = true;
tbISSUEDATE.Enabled = true;
tbISSUEPLACE.Enabled = true;
ddlNOBILL.Enabled = true;
ddlBLFRT.Enabled = true;
tbBLFRT.Enabled = true;
ddlSERVICE.Enabled = true;
ibMidway.Enabled = true;
gvMidway.Enabled = true;
ddlCARGOID.Enabled = true;
tbREEFERF.Enabled = true;
//
rblTEMPID.Enabled = true;
cbISCONTAINERSOC.Enabled = true;
rblSOURCECODE.Enabled = true;
tbDPAGE.Enabled = true;
tbDLABEL.Enabled = true;
tbLINKMAN.Enabled = true;
tbVESSELID.Enabled = true;
tbISSUEPLACEID.Enabled = true;
//
tbTEMPSET.Enabled = true;
tbDCLASS.Enabled = true;
tbDUNNO.Enabled = true;
tbINSURANCEER.Enabled = true;
tbINSURANCENO.Enabled = true;
tbINAMOUT.Enabled = true;
tbINVNO.Enabled = true;
tbCONTRACTNO.Enabled = true;
tbPORTLOADID.Enabled = true;
tbPORTDISCHARGEID.Enabled = true;
tbPLACEDELIVERYID.Enabled = true;
tbDESTINATIONID.Enabled = true;
tbPLAID.Enabled = true;
tbREMARK.Enabled = true;
}
/// <summary>
/// 判断字段内容是否允许编辑
/// </summary>
/// <param name="strRULENAME">规则项目名称</param>
/// <param name="strfield">需要加规则的字段</param>
/// <returns></returns>
protected void getCodeRuleEnabled(string strRULENAME, string strfield)
{
//是否生成之后允许编辑
DataSet ds = T_ALL_DA.GetAllSQL("select * from code_rule where RULENAME='" + strRULENAME.Trim() + "' and RULETYPE=1");
if (ds != null)
{
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["ISSTARTUSING"].ToString().Trim().Equals("True"))
{
if (strfield == "HBLNO")
{
if (ds.Tables[0].Rows[0]["ISALLOWEDITS"].ToString().Trim().Equals("True"))
{
tbHBLNO.Enabled = true;
}
else
{
tbHBLNO.Enabled = false;
}
}
else if (strfield == "CUSTNO")
{
if (ds.Tables[0].Rows[0]["ISALLOWEDITS"].ToString().Trim().Equals("True"))
{
tbCUSTNO.Enabled = true;
}
else
{
tbCUSTNO.Enabled = false;
}
}
}
}
}
}
/// <summary>
/// 提取规则编号
/// </summary>
/// <param name="strRULENAME">规则项目名称</param>
/// <param name="strfield">需要加规则的字段名</param>
/// <returns></returns>
protected String getCodeRule(string strRULENAME, string strfield)
{
//调用编码规则
string strRULEYEAR = "";
string strRULECONTENT = "";
string strCODENAME = "";
string strDEPTNO = "";
string strRULENOLENGTH = "";
int iRULENOLENGTH = 0;
int inum = 0;
string strCONTENT = "";
DataSet ds = T_ALL_DA.GetAllSQL("select * from code_rule where RULENAME='" + strRULENAME.Trim() + "' and RULETYPE=1");
if (ds != null)
{
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["ISSTARTUSING"].ToString().Trim().Equals("True"))
{
getCodeRuleEnabled(strRULENAME,strfield);//判断字段内容是否允许编辑
//
if (ds.Tables[0].Rows[0]["RULEDATE"].ToString().Trim().Equals("业务日期"))
{
if (tbETD.Text.Trim() == "")
{
return "";
}
DateTime dETD = System.Convert.ToDateTime(tbETD.Text.Trim());
if (ds.Tables[0].Rows[0]["ISCLEAREDINEARLY"].ToString().Trim().Equals("True"))
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dETD.ToString("yyyy") + dETD.ToString("MM");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dETD.ToString("yy") + dETD.ToString("MM");
}
}
else
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dETD.ToString("yyyy");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dETD.ToString("yy");
}
}
}
else if (ds.Tables[0].Rows[0]["RULEDATE"].ToString().Trim().Equals("会计期间"))
{
if (tbACCDATE.Text.Trim() == "")
{
return "";
}
DateTime dACCDATE = System.Convert.ToDateTime(tbACCDATE.Text.Trim()+"-01");
if (ds.Tables[0].Rows[0]["ISCLEAREDINEARLY"].ToString().Trim().Equals("True"))
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dACCDATE.ToString("yyyy") + dACCDATE.ToString("MM");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dACCDATE.ToString("yy") + dACCDATE.ToString("MM");
}
}
else
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = dACCDATE.ToString("yyyy");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = dACCDATE.ToString("yy");
}
}
}
else if (ds.Tables[0].Rows[0]["RULEDATE"].ToString().Trim().Equals("自然月份"))
{
DateTime fwqdate = System.Convert.ToDateTime(T_ALL_DA.GetStrSQL("fwqdate", "select fwqdate=getdate()"));
if (ds.Tables[0].Rows[0]["ISCLEAREDINEARLY"].ToString().Trim().Equals("True"))
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = fwqdate.ToString("yyyy") + fwqdate.ToString("MM");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = fwqdate.ToString("yy") + fwqdate.ToString("MM");
}
}
else
{
if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "4")
{
strRULEYEAR = fwqdate.ToString("yyyy");
}
else if (ds.Tables[0].Rows[0]["RULEYEAR"].ToString().Trim() == "2")
{
strRULEYEAR = fwqdate.ToString("yy");
}
}
}
//
if (ds.Tables[0].Rows[0]["ISCOMPANY"].ToString().Trim().Equals("True"))
{
strCODENAME = T_ALL_DA.GetStrSQL("CODENAME", "select CODENAME from [company] where GID=(select top 1 COMPANYID from user_company where USERID='" + this.hdUserID.Value.Trim() + "')");
}
if (ds.Tables[0].Rows[0]["ISDEPT"].ToString().Trim().Equals("True"))
{
strDEPTNO = T_ALL_DA.GetStrSQL("DEPTNO", "select DEPTNO from [sys_dept] where LINKID=(select top 1 COMPANYID from user_company where USERID='" + this.hdUserID.Value.Trim() + "')");
}
strRULECONTENT = ds.Tables[0].Rows[0]["RULECONTENT"].ToString().Trim();
strRULECONTENT = strRULECONTENT.Replace("《COMPANY》", strCODENAME);
strRULECONTENT = strRULECONTENT.Replace("《DEPT》", strDEPTNO);
//
if (ds.Tables[0].Rows[0]["RULENOLENGTH"].ToString().Trim() == "")
{
iRULENOLENGTH = 0;
}
else
{
iRULENOLENGTH = int.Parse(ds.Tables[0].Rows[0]["RULENOLENGTH"].ToString().Trim());
}
strCONTENT = strRULECONTENT + strRULEYEAR;
//获取分公司的票号头字符
string tempBANKSHEAD = T_ALL_DA.GetStrSQL("BANKSHEAD", "SELECT TOP 1 BANKSHEAD FROM company WHERE GID='" + strCompanyID.Trim() + "'");
strCONTENT = tempBANKSHEAD + strCONTENT;
//
strRULENOLENGTH = T_ALL_DA.GetStrSQL(strfield, "select top 1 " + strfield + " from [op_seae] where " + strfield + " like '" + strCONTENT.Trim() + "%' order by " + strfield + " DESC");
if (strRULENOLENGTH == "")
{
strRULENOLENGTH = "1";
}
else
{
strRULENOLENGTH = strRULENOLENGTH.Replace(strCONTENT.Trim(), "");
inum = int.Parse(strRULENOLENGTH.Trim());
inum = inum + 1;
strRULENOLENGTH = inum.ToString();
}
int j = iRULENOLENGTH - strRULENOLENGTH.Length;
for (int i = 1; i <= j; i++)
{
strRULENOLENGTH = "0" + strRULENOLENGTH;
}
//
strCONTENT = strCONTENT + strRULENOLENGTH;
return strCONTENT;
}
}
}
return "";
}
protected String getBSNO()
{
string strBSNO = Guid.NewGuid().ToString();
strBSNO = strBSNO.Replace("-", "");
strBSNO = "topseae" + strBSNO;
return strBSNO;
}
protected bool getAdd()
{
TopSeaeEntity.BSNO = ViewState["GID"].ToString().Trim();
TopSeaeEntity.MASTERNO = ViewState["GID"].ToString().Trim();
if (lbBSSTATUS.Text.Trim() == "未锁定")//"接受委托")
{
TopSeaeEntity.BSSTATUS = false;
}
else
{
TopSeaeEntity.BSSTATUS = true;
}
if (lbFEESTATUS.Text.Trim() == "未锁定")
{
TopSeaeEntity.FEESTATUS = false;
}
else
{
TopSeaeEntity.FEESTATUS = true;
}
TopSeaeEntity.ORDERTYPE = "操作录入";
//TopSeaeEntity.BSDATE = DateTime.Today.Date;
TopSeaeEntity.ACCDATE = tbACCDATE.Text.Trim();
TopSeaeEntity.MBLNO = tbMBLNO.Text.Trim();
TopSeaeEntity.HBLNO = tbHBLNO.Text.Trim();
TopSeaeEntity.CUSTNO = tbCUSTNO.Text.Trim();
TopSeaeEntity.TRANSNO = "";
TopSeaeEntity.CUSTOMERNAME = this.hd_comboCUSTOMERNAME.Value.Trim();
//TopSeaeEntity.BLTYPE = ddlBLTYPE.Text.Trim();
TopSeaeEntity.BLTYPE = this.hd_comboBLTYPE.Value.Trim();
//结算方式
//TopSeaeEntity.STLNAME = ddlSTLNAME.Text;
//if (tbSTLDATE.Text.Trim() != "")
//{
// TopSeaeEntity.STLDATE = DateTime.Parse(tbSTLDATE.Text.Trim());
//}
//else
//{
// TopSeaeEntity.STLDATE = DateTime.Parse("0001-01-01 00:00:00");
//}
TopSeaeEntity.STLNAME = this.hdSTLNAME.Value.Trim();
if (this.hdSTLDATE.Value.Trim() != "")
{
TopSeaeEntity.STLDATE = DateTime.Parse(this.hdSTLDATE.Value.Trim());
}
else
{
TopSeaeEntity.STLDATE = DateTime.Parse("0001-01-01 00:00:00");
}
//
TopSeaeEntity.SHIPPERID = this.hd_comboSHIPPERID.Value.Trim();
TopSeaeEntity.CONSIGNEEID = this.hd_comboCONSIGNEEID.Value.Trim();
TopSeaeEntity.NOTIFYPARTYID = this.hd_comboNOTIFYPARTYID.Value.Trim();
TopSeaeEntity.SHIPPER = tbSHIPPER.Text.Trim();
TopSeaeEntity.CONSIGNEE = tbCONSIGNEE.Text.Trim();
TopSeaeEntity.NOTIFYPARTY = tbNOTIFYPARTY.Text.Trim();
TopSeaeEntity.AGENTID = this.hd_comboAGENTID.Value.Trim();
TopSeaeEntity.AGENT = tbAGENT.Text.Trim();
TopSeaeEntity.YARD = this.hd_comboYARD.Value.Trim();
TopSeaeEntity.TRUCKER = this.hd_comboTRUCKER.Value.Trim();
TopSeaeEntity.VESSEL = this.hd_comboVESSEL.Value.Trim();
TopSeaeEntity.VOYNO = this.hd_comboVOYNO.Value.Trim();
if (tbETD.Text.Trim() != "")
{
TopSeaeEntity.ETD = DateTime.Parse(tbETD.Text.Trim());
}
if (tbCLOSINGDATE.Text.Trim() != "")
{
TopSeaeEntity.CLOSINGDATE = DateTime.Parse(tbCLOSINGDATE.Text.Trim());
}
if (tbETA.Text.Trim() != "")
{
TopSeaeEntity.ETA = DateTime.Parse(tbETA.Text.Trim());
}
if (tbISSUEDATE.Text.Trim() != "")
{
TopSeaeEntity.ISSUEDATE = DateTime.Parse(tbISSUEDATE.Text.Trim());
}
if (tbCLOSEDOCDATE.Text.Trim() != "")
{
TopSeaeEntity.CLOSEDOCDATE = DateTime.Parse(tbCLOSEDOCDATE.Text.Trim());
}
if (tbINTOPORTDATE.Text.Trim() != "")
{
TopSeaeEntity.INTOPORTDATE = DateTime.Parse(tbINTOPORTDATE.Text.Trim());
}
TopSeaeEntity.PlACERECEIPTID = tbPLAID.Text.Trim();
TopSeaeEntity.PlACERECEIPT = this.hd_comboPLA.Value.Trim();
/*
if (tbPORTLOADID.Text.Trim() == "")
{
tbPORTLOADID.Text = T_ALL_DA.GetStrSQL("PORTLOADID", "select PORTLOADID from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
}
*/
TopSeaeEntity.PORTLOADID = tbPORTLOADID.Text.Trim();
/*
if (this.hd_comboPORTLOAD.Value.Trim() == "")
{
this.hd_comboPORTLOAD.Value = T_ALL_DA.GetStrSQL("PORTLOAD", "select PORTLOAD from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
}
*/
TopSeaeEntity.PORTLOAD = this.hd_comboPORTLOAD.Value.Trim();
TopSeaeEntity.PORTDISCHARGEID = tbPORTDISCHARGEID.Text.Trim();
TopSeaeEntity.PORTDISCHARGE = this.hd_comboPORTDISCHARGE.Value.Trim();
TopSeaeEntity.PLACEDELIVERYID = tbPLACEDELIVERYID.Text.Trim();
TopSeaeEntity.PLACEDELIVERY = this.hd_comboPLACEDELIVERY.Value.Trim();
TopSeaeEntity.DESTINATIONID = tbDESTINATIONID.Text.Trim();
TopSeaeEntity.DESTINATION = this.hd_comboDESTINATION.Value.Trim();
TopSeaeEntity.NOBILL = ddlNOBILL.Text.Trim();
TopSeaeEntity.ISSUETYPE = ddlISSUETYPE.Text.Trim();
TopSeaeEntity.ISSUEPLACE = tbISSUEPLACE.Text.Trim();
//付费方式地点
/*
if (this.hd_comboBLFRT.Value.Trim() == "")
{
this.hd_comboBLFRT.Value = T_ALL_DA.GetStrSQL("BLFRT", "select BLFRT from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
}
*/
//TopSeaeEntity.BLFRT = this.hd_comboBLFRT.Value.Trim();
TopSeaeEntity.BLFRT = ddlBLFRT.Text.Trim();
if (ddlBLFRT.Text.Trim() == "FREIGHT PAYABLE BY CARGO PARTNER AG AT VIENNA (CONTACT NO.R)" || ddlBLFRT.Text.Trim() == "FREIGHT COLLECT")
{
TopSeaeEntity.PREPARDAT = "";
TopSeaeEntity.PAYABLEAT = tbBLFRT.Text.Trim();
}
else
{
TopSeaeEntity.PREPARDAT = tbBLFRT.Text.Trim();
TopSeaeEntity.PAYABLEAT = "";
}
//
/*
if (this.hd_comboSERVICE.Value.Trim() == "")
{
this.hd_comboSERVICE.Value = T_ALL_DA.GetStrSQL("SERVICE", "select SERVICE from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
}
*/
//TopSeaeEntity.SERVICE = this.hd_comboSERVICE.Value.Trim();
TopSeaeEntity.SERVICE = ddlSERVICE.Text.Trim();
//
TopSeaeEntity.MARKS = tbMARKS.Text.Trim();
TopSeaeEntity.CNTRSEALNO = "";//tbCNTRSEALNO.Text.Trim();
TopSeaeEntity.NOPKGS = tbNOPKGS.Text.Trim();
TopSeaeEntity.DESCRIPTION = tbDESCRIPTION.Text.Trim();
TopSeaeEntity.GOODSNAME = this.hd_comboGOODSNAME.Value.Trim();
TopSeaeEntity.GROSSWEIGHT = tbGROSSWEIGHT.Text.Trim();
TopSeaeEntity.MEASUREMENT = tbMEASUREMENT.Text.Trim();
//
if (tbPKGS.Text.Trim() == "")
{
TopSeaeEntity.PKGS = 0;
}
else
{
TopSeaeEntity.PKGS = int.Parse(tbPKGS.Text.Trim());
}
//
TopSeaeEntity.KINDPKGS = this.hd_comboKINDPKGS.Value.Trim();
//
if (tbKGS.Text.Trim() == "")
{
TopSeaeEntity.KGS = 0;
}
else
{
TopSeaeEntity.KGS = Decimal.Parse(Decimal.Parse(tbKGS.Text.Trim()).ToString("F2"));
}
//
if (tbCBM.Text.Trim() == "")
{
TopSeaeEntity.CBM = 0;
}
else
{
TopSeaeEntity.CBM = Decimal.Parse(Decimal.Parse(tbCBM.Text.Trim()).ToString("F2"));
}
//
TopSeaeEntity.TOTALNO = tbTOTALNO.Text.Trim();
TopSeaeEntity.CNTRNO = "";
TopSeaeEntity.CNTR1 = 0;
TopSeaeEntity.CNTR2 = 0;
TopSeaeEntity.CNTR3 = 0;
TopSeaeEntity.CNTR4 = 0;
TopSeaeEntity.CNTR5 = 0;
TopSeaeEntity.CNTR6 = 0;
TopSeaeEntity.CNTR7 = 0;
TopSeaeEntity.CNTR8 = 0;
TopSeaeEntity.CNTR9 = 0;
TopSeaeEntity.CNTR10 = 0;
TopSeaeEntity.OTCNTR = 0;
TopSeaeEntity.TEU = 0;
TopSeaeEntity.CNTRTOTAL = "";
//
TopSeaeEntity.INPUTBY = "";
DataSet ds1 = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, "select SHOWNAME from [user] where GID ='" + this.hdUserID.Value.Trim() + "'");
if (ds1 != null)
{
if (ds1.Tables[0].Rows.Count > 0)
{
TopSeaeEntity.INPUTBY = ds1.Tables[0].Rows[0]["SHOWNAME"].ToString().Trim();
}
}
//
TopSeaeEntity.OP = this.hd_comboOP.Value.Trim();
TopSeaeEntity.CUSTSERVICE = this.hd_comboCUSTSERVICE.Value.Trim();
TopSeaeEntity.LANE = this.hd_comboLANE.Value.Trim();
TopSeaeEntity.SALE = this.hd_comboSALE.Value.Trim();
TopSeaeEntity.CARRIER = this.hd_comboCARRIER.Value.Trim();
TopSeaeEntity.FORWARDER = this.hd_comboFORWARDER.Value.Trim();
TopSeaeEntity.CUSTOMSER = this.hd_comboCUSTOMSER.Value.Trim();
//TopSeaeEntity.TRUCKER = "";
TopSeaeEntity.INVNO = tbINVNO.Text.Trim();
TopSeaeEntity.CARGOID = ddlCARGOID.SelectedValue.Trim();
TopSeaeEntity.DCLASS = tbDCLASS.Text.Trim();
TopSeaeEntity.DUNNO = tbDUNNO.Text.Trim();
TopSeaeEntity.REEFERF = tbREEFERF.Text.Trim();
//
TopSeaeEntity.TEMPID = rblTEMPID.SelectedValue.ToString().Trim();
TopSeaeEntity.ISCONTAINERSOC = cbISCONTAINERSOC.Checked;
TopSeaeEntity.SOURCECODE = rblSOURCECODE.SelectedValue.ToString().Trim();
TopSeaeEntity.DPAGE = tbDPAGE.Text.ToString().Trim();
TopSeaeEntity.DLABEL = tbDLABEL.Text.ToString().Trim();
TopSeaeEntity.LINKMAN = tbLINKMAN.Text.ToString().Trim();
TopSeaeEntity.VESSELID = tbVESSELID.Text.ToString().Trim();
TopSeaeEntity.ISSUEPLACEID = tbISSUEPLACEID.Text.ToString().Trim();
//
TopSeaeEntity.TEMPSET = tbTEMPSET.Text.Trim();
TopSeaeEntity.TEMPMAX = "";
TopSeaeEntity.TEMPMIN = "";
TopSeaeEntity.BSSOURCE = this.hd_comboBSSOURCE.Value.Trim();
TopSeaeEntity.BSSOURCEDETAIL = this.hd_comboBSSOURCEDETAIL.Value.Trim();
TopSeaeEntity.CUSTOMSNUM = 0;
TopSeaeEntity.CONTRACTNO = tbCONTRACTNO.Text.Trim();
TopSeaeEntity.ORDTYPE = "";
TopSeaeEntity.ORDERNO = tbORDERNO.Text.Trim();
TopSeaeEntity.INSURANCEER = tbINSURANCEER.Text.Trim();
TopSeaeEntity.INSURANCENO = tbINSURANCENO.Text.Trim();
TopSeaeEntity.INAMOUT = Decimal.Parse(tbINAMOUT.Text.Trim());
TopSeaeEntity.ISVOU = false;
TopSeaeEntity.VOUNO = "";
TopSeaeEntity.REMARK = tbREMARK.Text.Trim();
TopSeaeEntity.STATUS1 = false;
TopSeaeEntity.STATUS2 = false;
TopSeaeEntity.STATUS3 = false;
TopSeaeEntity.STATUS4 = false;
TopSeaeEntity.STATUS5 = false;
//
TopSeaeEntity.ISFUMIGATION = false;
TopSeaeEntity.ISSTORAGE = false;
TopSeaeEntity.ISLAND = false;
TopSeaeEntity.ISCUSTOMS = false;
TopSeaeEntity.ISINSPECTION = false;
TopSeaeEntity.ISBOOKING = false;
TopSeaeEntity.ISAGENT = false;
TopSeaeEntity.ISHBLNO = false;
TopSeaeEntity.SERVICE9 = false;
TopSeaeEntity.SERVICE10 = false;
//服务项目名读取
TopSeaeEntity.ISFUMIGATION=ISFUMIGATION.Checked;//熏蒸
TopSeaeEntity.ISSTORAGE=ISSTORAGE.Checked;//仓储
TopSeaeEntity.ISLAND = ISLAND.Checked;//陆运
TopSeaeEntity.ISCUSTOMS = ISCUSTOMS.Checked;//报关
TopSeaeEntity.ISINSPECTION = ISINSPECTION.Checked;//报检
TopSeaeEntity.ISBOOKING = ISBOOKING.Checked;//订舱
TopSeaeEntity.ISAGENT = ISAGENT.Checked;//使用代理
TopSeaeEntity.ISHBLNO = ISHBLNO.Checked;//分单签单
/*
for (int i = 0; i < cblSERVICE.Items.Count; i++)
{
if (i == 0 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISFUMIGATION = true;
}
else if (i == 1 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISSTORAGE = true;
}
else if (i == 2 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISLAND = true;
}
else if (i == 3 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISCUSTOMS = true;
}
else if (i == 4 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISINSPECTION = true;
}
else if (i == 5 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISBOOKING = true;
}
else if (i == 6 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISAGENT = true;
}
else if (i == 7 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISHBLNO = true;
}
else if (i == 8 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.SERVICE9 = true;
}
else if (i == 9 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.SERVICE10 = true;
}
}
*/
//
TopSeaeEntity.DOC = this.hd_comboDOC.Value.Trim();
TopSeaeEntity.PACKINGTYPE = this.hd_comboPACKINGTYPE.Value.Trim();
TopSeaeEntity.WAREHOUSE = this.hd_comboWAREHOUSE.Value.Trim();
TopSeaeEntity.CORPID = this.hdCOMPANYID.Value;
TopSeaeEntity.SALEDEPT = this.hd_comboSALEDEPT.Value.Trim();
TopSeaeEntity.MBLFRT = "";
//
TopSeaeEntity.OPERATOR = this.hd_comboOPERATOR.Value.Trim();
TopSeaeEntity.OPERATORTEL = tbOPERATORTEL.Text.ToString().Trim();
TopSeaeEntity.OPERATORFAX = tbOPERATORFAX.Text.ToString().Trim();
TopSeaeEntity.OPERATOREMAIL = tbOPERATOREMAIL.Text.ToString().Trim();
TopSeaeEntity.FINANCIALSTAFF = this.hd_comboFINANCIALSTAFF.Value.Trim();
TopSeaeEntity.FINANCIALSTAFFTEL = tbFINANCIALSTAFFTEL.Text.ToString().Trim();
TopSeaeEntity.FINANCIALSTAFFFAX = tbFINANCIALSTAFFFAX.Text.ToString().Trim();
TopSeaeEntity.FINANCIALSTAFFEMAIL = tbFINANCIALSTAFFEMAIL.Text.ToString().Trim();
TopSeaeEntity.OPERATORCODE = this.hd_comboOPERATORCODE.Value.Trim();
TopSeaeEntity.FINANCIALSTAFFCODE = this.hd_comboFINANCIALSTAFFCODE.Value.Trim();
//
int iResult = SeaExportInfoDA.InserInfo(TopSeaeEntity);
//int iResult = SeaExportInfoDA.InsertTopSeaesHBLNOCUSTNO(TopSeaeEntity);
if (iResult > 0)
{
//ViewState["strHandleType"] = "edit";
//this.hdHandle.Value = ViewState["strHandleType"].ToString().Trim();
return true;
}
else
{
return false;
}
}
protected bool getEdit()
{
TopSeaeEntity.BSNO = ViewState["GID"].ToString().Trim();
TopSeaeEntity.ACCDATE = tbACCDATE.Text.Trim();
TopSeaeEntity.MBLNO = tbMBLNO.Text.Trim();
TopSeaeEntity.HBLNO = tbHBLNO.Text.Trim();
TopSeaeEntity.CUSTNO = tbCUSTNO.Text.Trim();
TopSeaeEntity.TRANSNO = "";
TopSeaeEntity.CUSTOMERNAME = this.hd_comboCUSTOMERNAME.Value.Trim();
TopSeaeEntity.SHIPPERID = this.hd_comboSHIPPERID.Value.Trim();
TopSeaeEntity.CONSIGNEEID = this.hd_comboCONSIGNEEID.Value.Trim();
TopSeaeEntity.NOTIFYPARTYID = this.hd_comboNOTIFYPARTYID.Value.Trim();
TopSeaeEntity.SHIPPER = tbSHIPPER.Text.Trim();
TopSeaeEntity.CONSIGNEE = tbCONSIGNEE.Text.Trim();
TopSeaeEntity.NOTIFYPARTY = tbNOTIFYPARTY.Text.Trim();
TopSeaeEntity.AGENTID = this.hd_comboAGENTID.Value.Trim();
TopSeaeEntity.AGENT = tbAGENT.Text.Trim();
TopSeaeEntity.YARD = this.hd_comboYARD.Value.Trim();
TopSeaeEntity.TRUCKER = this.hd_comboTRUCKER.Value.Trim();
TopSeaeEntity.VESSEL = this.hd_comboVESSEL.Value.Trim();
TopSeaeEntity.VOYNO = this.hd_comboVOYNO.Value.Trim();
if (tbETD.Text.Trim() != "")
{
TopSeaeEntity.ETD = DateTime.Parse(tbETD.Text.Trim());
}
if (tbCLOSINGDATE.Text.Trim() != "")
{
TopSeaeEntity.CLOSINGDATE = DateTime.Parse(tbCLOSINGDATE.Text.Trim());
}
if (tbETA.Text.Trim() != "")
{
TopSeaeEntity.ETA = DateTime.Parse(tbETA.Text.Trim());
}
if (tbISSUEDATE.Text.Trim() != "")
{
TopSeaeEntity.ISSUEDATE = DateTime.Parse(tbISSUEDATE.Text.Trim());
}
if (tbCLOSEDOCDATE.Text.Trim() != "")
{
TopSeaeEntity.CLOSEDOCDATE = DateTime.Parse(tbCLOSEDOCDATE.Text.Trim());
}
if (tbINTOPORTDATE.Text.Trim() != "")
{
TopSeaeEntity.INTOPORTDATE = DateTime.Parse(tbINTOPORTDATE.Text.Trim());
}
TopSeaeEntity.PlACERECEIPTID = tbPLAID.Text.Trim();
TopSeaeEntity.PlACERECEIPT = this.hd_comboPLA.Value.Trim();
/*
if (tbPORTLOADID.Text.Trim() == "")
{
tbPORTLOADID.Text = T_ALL_DA.GetStrSQL("PORTLOADID", "select PORTLOADID from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
}
*/
TopSeaeEntity.PORTLOADID = tbPORTLOADID.Text.Trim();
/*
if (this.hd_comboPORTLOAD.Value.Trim() == "")
{
this.hd_comboPORTLOAD.Value = T_ALL_DA.GetStrSQL("PORTLOAD", "select PORTLOAD from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
}
*/
TopSeaeEntity.PORTLOAD = this.hd_comboPORTLOAD.Value.Trim();
TopSeaeEntity.PORTDISCHARGEID = tbPORTDISCHARGEID.Text.Trim();
TopSeaeEntity.PORTDISCHARGE = this.hd_comboPORTDISCHARGE.Value.Trim();
TopSeaeEntity.PLACEDELIVERYID = tbPLACEDELIVERYID.Text.Trim();
TopSeaeEntity.PLACEDELIVERY = this.hd_comboPLACEDELIVERY.Value.Trim();
TopSeaeEntity.DESTINATIONID = tbDESTINATIONID.Text.Trim();
TopSeaeEntity.DESTINATION = this.hd_comboDESTINATION.Value.Trim();
TopSeaeEntity.NOBILL = ddlNOBILL.Text.Trim();
TopSeaeEntity.ISSUETYPE = ddlISSUETYPE.Text.Trim();
TopSeaeEntity.ISSUEPLACE = tbISSUEPLACE.Text.Trim();
//付费方式地点
/*
if(this.hd_comboBLFRT.Value.Trim()=="")
{
this.hd_comboBLFRT.Value = T_ALL_DA.GetStrSQL("BLFRT", "select BLFRT from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
}
*/
//TopSeaeEntity.BLFRT = this.hd_comboBLFRT.Value.Trim();
TopSeaeEntity.BLFRT = ddlBLFRT.Text.Trim();
if (ddlBLFRT.Text.Trim() == "FREIGHT PAYABLE BY CARGO PARTNER AG AT VIENNA (CONTACT NO.R)" || ddlBLFRT.Text.Trim() == "FREIGHT COLLECT")
{
TopSeaeEntity.PREPARDAT = "";
TopSeaeEntity.PAYABLEAT = tbBLFRT.Text.Trim();
}
else
{
TopSeaeEntity.PREPARDAT = tbBLFRT.Text.Trim();
TopSeaeEntity.PAYABLEAT = "";
}
//
/*
if (this.hd_comboSERVICE.Value.Trim() == "")
{
this.hd_comboSERVICE.Value = T_ALL_DA.GetStrSQL("SERVICE", "select SERVICE from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
}
*/
//TopSeaeEntity.SERVICE = this.hd_comboSERVICE.Value.Trim();
TopSeaeEntity.SERVICE = ddlSERVICE.Text.Trim();
//
TopSeaeEntity.MARKS = tbMARKS.Text.Trim();
TopSeaeEntity.CNTRSEALNO = "";//tbCNTRSEALNO.Text.Trim();
TopSeaeEntity.NOPKGS = tbNOPKGS.Text.Trim();
TopSeaeEntity.DESCRIPTION = tbDESCRIPTION.Text.Trim();
TopSeaeEntity.GOODSNAME = this.hd_comboGOODSNAME.Value.Trim();
TopSeaeEntity.GROSSWEIGHT = tbGROSSWEIGHT.Text.Trim();
TopSeaeEntity.MEASUREMENT = tbMEASUREMENT.Text.Trim();
//
if (tbPKGS.Text.Trim() == "")
{
TopSeaeEntity.PKGS = 0;
}
else
{
TopSeaeEntity.PKGS = int.Parse(tbPKGS.Text.Trim());
}
//
//TopSeaeEntity.KINDPKGS = ddlKINDPKGS.Text.Trim();
TopSeaeEntity.KINDPKGS = this.hd_comboKINDPKGS.Value.Trim();
//
if (tbKGS.Text.Trim() == "")
{
TopSeaeEntity.KGS = 0;
}
else
{
TopSeaeEntity.KGS = Decimal.Parse(Decimal.Parse(tbKGS.Text.Trim()).ToString("F2"));
}
//
if (tbCBM.Text.Trim() == "")
{
TopSeaeEntity.CBM = 0;
}
else
{
TopSeaeEntity.CBM = Decimal.Parse(Decimal.Parse(tbCBM.Text.Trim()).ToString("F2"));
}
//
TopSeaeEntity.TOTALNO = tbTOTALNO.Text.Trim();
TopSeaeEntity.CNTRNO = "";
TopSeaeEntity.CNTR1 = 0;
TopSeaeEntity.CNTR2 = 0;
TopSeaeEntity.CNTR3 = 0;
TopSeaeEntity.CNTR4 = 0;
TopSeaeEntity.CNTR5 = 0;
TopSeaeEntity.CNTR6 = 0;
TopSeaeEntity.CNTR7 = 0;
TopSeaeEntity.CNTR8 = 0;
TopSeaeEntity.CNTR9 = 0;
TopSeaeEntity.CNTR10 = 0;
TopSeaeEntity.OTCNTR = 0;
TopSeaeEntity.TEU = 0;
TopSeaeEntity.CNTRTOTAL = "";
/*
TopSeaeEntity.INPUTBY = "";
DataSet ds1 = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, "select SHOWNAME from [user] where GID ='" + this.hdUserID.Value.Trim() + "'");
if (ds1 != null)
{
if (ds1.Tables[0].Rows.Count > 0)
{
TopSeaeEntity.INPUTBY = ds1.Tables[0].Rows[0]["SHOWNAME"].ToString().Trim();
}
}
*/
TopSeaeEntity.OP = this.hd_comboOP.Value.Trim();
TopSeaeEntity.CUSTSERVICE = this.hd_comboCUSTSERVICE.Value.Trim();
TopSeaeEntity.LANE = this.hd_comboLANE.Value.Trim();
TopSeaeEntity.SALE = this.hd_comboSALE.Value.Trim();
TopSeaeEntity.CARRIER = this.hd_comboCARRIER.Value.Trim();
TopSeaeEntity.FORWARDER = this.hd_comboFORWARDER.Value.Trim();
TopSeaeEntity.CUSTOMSER = this.hd_comboCUSTOMSER.Value.Trim();
//TopSeaeEntity.TRUCKER = "";
TopSeaeEntity.INVNO = tbINVNO.Text.Trim();
TopSeaeEntity.CARGOID = ddlCARGOID.SelectedValue.Trim();
TopSeaeEntity.DCLASS = tbDCLASS.Text.Trim();
TopSeaeEntity.DUNNO = tbDUNNO.Text.Trim();
TopSeaeEntity.REEFERF = tbREEFERF.Text.Trim();
//
TopSeaeEntity.TEMPID = rblTEMPID.SelectedValue.ToString().Trim();
TopSeaeEntity.ISCONTAINERSOC = cbISCONTAINERSOC.Checked;
TopSeaeEntity.SOURCECODE = rblSOURCECODE.SelectedValue.ToString().Trim();
TopSeaeEntity.DPAGE = tbDPAGE.Text.ToString().Trim();
TopSeaeEntity.DLABEL = tbDLABEL.Text.ToString().Trim();
TopSeaeEntity.LINKMAN = tbLINKMAN.Text.ToString().Trim();
TopSeaeEntity.VESSELID = tbVESSELID.Text.ToString().Trim();
TopSeaeEntity.ISSUEPLACEID = tbISSUEPLACEID.Text.ToString().Trim();
//
TopSeaeEntity.TEMPSET = tbTEMPSET.Text.Trim();
TopSeaeEntity.TEMPMAX = "";
TopSeaeEntity.TEMPMIN = "";
TopSeaeEntity.BSSOURCE = this.hd_comboBSSOURCE.Value.Trim();
TopSeaeEntity.BSSOURCEDETAIL = this.hd_comboBSSOURCEDETAIL.Value.Trim();
TopSeaeEntity.CUSTOMSNUM = 0;
TopSeaeEntity.CONTRACTNO = tbCONTRACTNO.Text.Trim();
TopSeaeEntity.ORDTYPE = "";
TopSeaeEntity.ORDERNO = tbORDERNO.Text.Trim();
TopSeaeEntity.INSURANCEER = tbINSURANCEER.Text.Trim();
TopSeaeEntity.INSURANCENO = tbINSURANCENO.Text.Trim();
TopSeaeEntity.INAMOUT = Decimal.Parse(tbINAMOUT.Text.Trim());
TopSeaeEntity.ISVOU = false;
TopSeaeEntity.VOUNO = "";
TopSeaeEntity.REMARK = tbREMARK.Text.Trim();
TopSeaeEntity.STATUS1 = false;
TopSeaeEntity.STATUS2 = false;
TopSeaeEntity.STATUS3 = false;
TopSeaeEntity.STATUS4 = false;
TopSeaeEntity.STATUS5 = false;
//
TopSeaeEntity.ISFUMIGATION = false;
TopSeaeEntity.ISSTORAGE = false;
TopSeaeEntity.ISLAND = false;
TopSeaeEntity.ISCUSTOMS = false;
TopSeaeEntity.ISINSPECTION = false;
TopSeaeEntity.ISBOOKING = false;
TopSeaeEntity.ISAGENT = false;
TopSeaeEntity.ISHBLNO = false;
TopSeaeEntity.SERVICE9 = false;
TopSeaeEntity.SERVICE10 = false;
//服务项目名读取
TopSeaeEntity.ISFUMIGATION = ISFUMIGATION.Checked;//熏蒸
TopSeaeEntity.ISSTORAGE = ISSTORAGE.Checked;//仓储
TopSeaeEntity.ISLAND = ISLAND.Checked;//陆运
TopSeaeEntity.ISCUSTOMS = ISCUSTOMS.Checked;//报关
TopSeaeEntity.ISINSPECTION = ISINSPECTION.Checked;//报检
TopSeaeEntity.ISBOOKING = ISBOOKING.Checked;//订舱
TopSeaeEntity.ISAGENT = ISAGENT.Checked;//使用代理
TopSeaeEntity.ISHBLNO = ISHBLNO.Checked;//分单签单
/*
for(int i=0; i<cblSERVICE.Items.Count;i++)
{
if (i == 0 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISFUMIGATION = true;
}
else if (i == 1 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISSTORAGE = true;
}
else if (i == 2 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISLAND = true;
}
else if (i == 3 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISCUSTOMS = true;
}
else if (i == 4 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISINSPECTION = true;
}
else if (i == 5 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISBOOKING = true;
}
else if (i == 6 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISAGENT = true;
}
else if (i == 7 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.ISHBLNO = true;
}
else if (i == 8 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.SERVICE9 = true;
}
else if (i == 9 && cblSERVICE.Items[i].Selected == true)
{
TopSeaeEntity.SERVICE10 = true;
}
}
*/
//
TopSeaeEntity.DOC = this.hd_comboDOC.Value.Trim();
TopSeaeEntity.PACKINGTYPE = this.hd_comboPACKINGTYPE.Value.Trim();
TopSeaeEntity.WAREHOUSE = this.hd_comboWAREHOUSE.Value.Trim();
TopSeaeEntity.CORPID = this.hdCOMPANYID.Value;
TopSeaeEntity.SALEDEPT = this.hd_comboSALEDEPT.Value.Trim();
TopSeaeEntity.MBLFRT = "";
//结算方式
//TopSeaeEntity.STLNAME = ddlSTLNAME.Text;
//if (tbSTLDATE.Text.Trim() != "")
//{
// TopSeaeEntity.STLDATE = DateTime.Parse(tbSTLDATE.Text.Trim());
//}
//else
//{
// TopSeaeEntity.STLDATE = DateTime.Parse("0001-01-01 00:00:00");
//}
TopSeaeEntity.STLNAME = this.hdSTLNAME.Value.Trim();
if (this.hdSTLDATE.Value.Trim() != "")
{
TopSeaeEntity.STLDATE = DateTime.Parse(this.hdSTLDATE.Value.Trim());
}
else
{
TopSeaeEntity.STLDATE = DateTime.Parse("0001-01-01 00:00:00");
}
//
TopSeaeEntity.OPERATOR = this.hd_comboOPERATOR.Value.Trim();
TopSeaeEntity.OPERATORTEL = tbOPERATORTEL.Text.ToString().Trim();
TopSeaeEntity.OPERATORFAX = tbOPERATORFAX.Text.ToString().Trim();
TopSeaeEntity.OPERATOREMAIL = tbOPERATOREMAIL.Text.ToString().Trim();
TopSeaeEntity.FINANCIALSTAFF = this.hd_comboFINANCIALSTAFF.Value.Trim();
TopSeaeEntity.FINANCIALSTAFFTEL = tbFINANCIALSTAFFTEL.Text.ToString().Trim();
TopSeaeEntity.FINANCIALSTAFFFAX = tbFINANCIALSTAFFFAX.Text.ToString().Trim();
TopSeaeEntity.FINANCIALSTAFFEMAIL = tbFINANCIALSTAFFEMAIL.Text.ToString().Trim();
TopSeaeEntity.OPERATORCODE = this.hd_comboOPERATORCODE.Value.Trim();
TopSeaeEntity.FINANCIALSTAFFCODE = this.hd_comboFINANCIALSTAFFCODE.Value.Trim();
TopSeaeEntity.BLTYPE = this.hd_comboBLTYPE.Value.Trim();
//
int iResult = SeaExportInfoDA.UpdateInfo(TopSeaeEntity);
//int iResult = SeaExportInfoDA.UpdateTopSeaesHBLNOCUSTNO(TopSeaeEntity);
if (iResult > 0)
{
//this.hdEnter.Value = "1";
//Response.Write("<script>alert('成功提交!');history.back();</script>");
if (iResult == 8)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key5", "<script>alert('分提单号重复!');</script>");
return false;
}
else if (iResult == 9)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key6", "<script>alert('委托编号重复!');</script>");
return false;
}
return true;
}
else
{
//this.hdEnter.Value = "0";
//Response.Write("<script>alert('出错,请重新填写!');history.back();</script>");
return false;
}
}
protected void getEnter()
{
bool bl = false;
string alt = "";
strHandleType = ViewState["strHandleType"].ToString();
this.hdHandle.Value = ViewState["strHandleType"].ToString().Trim();
if (strHandleType.Equals("add"))//新增
{
AttributeManage attributeManager = new AttributeManage();
//主提单号规则
if (tbMBLNO.Text.Trim() != "")
{
//先获取分公司默认主提单号是否允许重复
AttributeCompanyEntity attributeCompanyEntity = (AttributeCompanyEntity)attributeManager.FindAttributeByName("refSubCompanyMBLNO", AttributeType.COMPANYATTRIBUTE, strCompanyID) as AttributeCompanyEntity;
if (attributeCompanyEntity != null)
{
if (attributeCompanyEntity.GID != null)
{
if (attributeCompanyEntity.AttributeValue.ToString().Trim() == "false")
{
alt = T_ALL_DA.GetStrSQL("MBLNO", "select MBLNO from [op_seae] where MBLNO='" + tbMBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('主提单号不允许重复!');</script>");
return;
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("MBLNO", "select MBLNO from [op_seae] where MBLNO='" + tbMBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('主提单号不允许重复!');</script>");
return;
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("MBLNO", "select MBLNO from [op_seae] where MBLNO='" + tbMBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('主提单号不允许重复!');</script>");
return;
}
}
}
//分提单号规则
if (tbHBLNO.Text.Trim() == "")
{
tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
}
//
//先获取分公司默认分提单号是否允许重复
AttributeCompanyEntity attributeCompanyEntity_2 = (AttributeCompanyEntity)attributeManager.FindAttributeByName("refSubCompanyHBLNO", AttributeType.COMPANYATTRIBUTE, strCompanyID) as AttributeCompanyEntity;
if (attributeCompanyEntity_2 != null)
{
if (attributeCompanyEntity_2.GID != null)
{
if (attributeCompanyEntity_2.AttributeValue.ToString().Trim() == "false")
{
alt = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from [op_seae] where HBLNO='" + tbHBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
//Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('分提单号重复!');</script>");
tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from [op_seae] where HBLNO='" + tbHBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
//Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('分提单号重复!');</script>");
tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from [op_seae] where HBLNO='" + tbHBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
//Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('分提单号重复!');</script>");
tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
}
}
//委托编号规则
if (tbCUSTNO.Text.Trim() == "")
{
tbCUSTNO.Text = getCodeRule("委托编号", "CUSTNO");//调用编码规则
}
alt = T_ALL_DA.GetStrSQL("CUSTNO", "select CUSTNO from [op_seae] where CUSTNO='" + tbCUSTNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
//Page.ClientScript.RegisterStartupScript(this.GetType(), "key2", "<script>alert('委托编号重复!');</script>");
tbCUSTNO.Text = getCodeRule("委托编号", "CUSTNO");//调用编码规则
}
//
bl = getAdd();
}
else if (strHandleType.Equals("addfull"))//新增
{
AttributeManage attributeManager = new AttributeManage();
//主提单号规则
if (tbMBLNO.Text.Trim() != "")
{
//先获取分公司默认主提单号是否允许重复
AttributeCompanyEntity attributeCompanyEntity = (AttributeCompanyEntity)attributeManager.FindAttributeByName("refSubCompanyMBLNO", AttributeType.COMPANYATTRIBUTE, strCompanyID) as AttributeCompanyEntity;
if (attributeCompanyEntity != null)
{
if (attributeCompanyEntity.GID != null)
{
if (attributeCompanyEntity.AttributeValue.ToString().Trim() == "false")
{
alt = T_ALL_DA.GetStrSQL("MBLNO", "select MBLNO from [op_seae] where MBLNO='" + tbMBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('主提单号不允许重复!');</script>");
return;
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("MBLNO", "select MBLNO from [op_seae] where MBLNO='" + tbMBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('主提单号不允许重复!');</script>");
return;
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("MBLNO", "select MBLNO from [op_seae] where MBLNO='" + tbMBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('主提单号不允许重复!');</script>");
return;
}
}
}
//分提单号规则
if (tbHBLNO.Text.Trim() == "")
{
tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
}
//
//先获取分公司默认分提单号是否允许重复
AttributeCompanyEntity attributeCompanyEntity_2 = (AttributeCompanyEntity)attributeManager.FindAttributeByName("refSubCompanyHBLNO", AttributeType.COMPANYATTRIBUTE, strCompanyID) as AttributeCompanyEntity;
if (attributeCompanyEntity_2 != null)
{
if (attributeCompanyEntity_2.GID != null)
{
if (attributeCompanyEntity_2.AttributeValue.ToString().Trim() == "false")
{
alt = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from [op_seae] where HBLNO='" + tbHBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
//Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('分提单号重复!');</script>");
tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from [op_seae] where HBLNO='" + tbHBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
//Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('分提单号重复!');</script>");
tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from [op_seae] where HBLNO='" + tbHBLNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
//Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('分提单号重复!');</script>");
tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
}
}
//委托编号规则
if (tbCUSTNO.Text.Trim() == "")
{
tbCUSTNO.Text = getCodeRule("委托编号", "CUSTNO");//调用编码规则
}
alt = T_ALL_DA.GetStrSQL("CUSTNO", "select CUSTNO from [op_seae] where CUSTNO='" + tbCUSTNO.Text.Trim() + "'");
if (alt.Trim() != "")
{
//Page.ClientScript.RegisterStartupScript(this.GetType(), "key4", "<script>alert('委托编号重复!');</script>");
tbCUSTNO.Text = getCodeRule("委托编号", "CUSTNO");//调用编码规则
}
//
bl = getAdd();
}
else if (strHandleType.Equals("edit"))//录入
{
AttributeManage attributeManager = new AttributeManage();
//主提单号规则
if (tbMBLNO.Text.Trim() != "")
{
//先获取分公司默认主提单号是否允许重复
AttributeCompanyEntity attributeCompanyEntity = (AttributeCompanyEntity)attributeManager.FindAttributeByName("refSubCompanyMBLNO", AttributeType.COMPANYATTRIBUTE, strCompanyID) as AttributeCompanyEntity;
if (attributeCompanyEntity != null)
{
if (attributeCompanyEntity.GID != null)
{
if (attributeCompanyEntity.AttributeValue.ToString().Trim() == "false")
{
alt = T_ALL_DA.GetStrSQL("MBLNO", "select MBLNO from [op_seae] where MBLNO='" + tbMBLNO.Text.Trim() + "' and BSNO<>'" + ViewState["GID"].ToString().Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('主提单号不允许重复!');</script>");
return;
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("MBLNO", "select MBLNO from [op_seae] where MBLNO='" + tbMBLNO.Text.Trim() + "' and BSNO<>'" + ViewState["GID"].ToString().Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('主提单号不允许重复!');</script>");
return;
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("MBLNO", "select MBLNO from [op_seae] where MBLNO='" + tbMBLNO.Text.Trim() + "' and BSNO<>'" + ViewState["GID"].ToString().Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>alert('主提单号不允许重复!');</script>");
return;
}
}
}
//分提单号规则
if (tbHBLNO.Text.Trim() == "")
{
tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
}
//
//先获取分公司默认分提单号是否允许重复
AttributeCompanyEntity attributeCompanyEntity_2 = (AttributeCompanyEntity)attributeManager.FindAttributeByName("refSubCompanyHBLNO", AttributeType.COMPANYATTRIBUTE, strCompanyID) as AttributeCompanyEntity;
if (attributeCompanyEntity_2 != null)
{
if (attributeCompanyEntity_2.GID != null)
{
if (attributeCompanyEntity_2.AttributeValue.ToString().Trim() == "false")
{
alt = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from [op_seae] where HBLNO='" + tbHBLNO.Text.Trim() + "' and BSNO<>'" + ViewState["GID"].ToString().Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key5", "<script>alert('分提单号重复!');</script>");
return;
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from [op_seae] where HBLNO='" + tbHBLNO.Text.Trim() + "' and BSNO<>'" + ViewState["GID"].ToString().Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key5", "<script>alert('分提单号重复!');</script>");
return;
}
}
}
else
{
alt = T_ALL_DA.GetStrSQL("HBLNO", "select HBLNO from [op_seae] where HBLNO='" + tbHBLNO.Text.Trim() + "' and BSNO<>'" + ViewState["GID"].ToString().Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key5", "<script>alert('分提单号重复!');</script>");
return;
}
}
//委托编号规则
//
if (tbCUSTNO.Text.Trim() == "")
{
tbCUSTNO.Text = T_ALL_DA.GetStrSQL("CUSTNO", "select CUSTNO from [op_seae] where BSNO='" + ViewState["GID"].ToString().Trim() + "'");
if (tbCUSTNO.Text.Trim() == "")
{
tbCUSTNO.Text = getCodeRule("委托编号", "CUSTNO");//调用编码规则
}
}
else
{
alt = T_ALL_DA.GetStrSQL("CUSTNO", "select CUSTNO from [op_seae] where CUSTNO='" + tbCUSTNO.Text.Trim() + "' and BSNO<>'" + ViewState["GID"].ToString().Trim() + "'");
if (alt.Trim() != "")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key6", "<script>alert('委托编号重复!');</script>");
return;
}
}
//
bl = getEdit();
}
this.hdEnter.Value = "";
//
if (bl)
{
//
ibDel.Enabled = true;
ibAdd.Enabled = true;
ibFullAdd.Enabled = true;
//
Page.ClientScript.RegisterStartupScript(this.GetType(), "key7", "<script>reloadParent('" + ViewState["GID"].ToString().Trim() + "','" + strHandleType.Trim() + "');</script>");
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key8", "<script>alert('出错,请重新填写!');</script>");
}
}
protected void ibEnter_Click(object sender, EventArgs e)
{
bool bl = false;
strHandleType = ViewState["strHandleType"].ToString();
this.hdHandle.Value = ViewState["strHandleType"].ToString().Trim();
if(strHandleType.Equals("add"))//新增
{
bl = getAdd();
}
else if(strHandleType.Equals("addfull"))//新增
{
bl = getAdd();
}
else if (strHandleType.Equals("edit"))//录入
{
bl = getEdit();
}
//
if (bl)
{
//
ibDel.Enabled = true;
ibAdd.Enabled = true;
ibFullAdd.Enabled=true;
//
this.hdEnter.Value = "1";
//System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "unReport30", "reloadParent('" + ViewState["GID"].ToString().Trim() + "');", true);
//System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "unReport30", "alert('成功提交!');", true);
//Response.Write("<script>alert('成功提交!');history.back();</script>");
//Page.RegisterStartupScript("103", "<script>reloadParent('" + ViewState["GID"].ToString().Trim() + "');</script>");
//return;
}
else
{
this.hdEnter.Value = "0";
//Page.RegisterStartupScript("103", "<script>reloadParent('" + ViewState["GID"].ToString().Trim() + "');</script>");
//System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "unReport31", "alert('出错,请重新填写!');", true);
//Response.Write("<script>alert('出错,请重新填写!');history.back();</script>");
//return;
}
}
protected void ibFullAdd_Click(object sender, EventArgs e)
{
//Session["USERID"] = "04eaeac5-f271-45d1-b17b-ad4ccbab63d0";
ViewState["strHandleType"] = "addfull";
this.hdHandle.Value = ViewState["strHandleType"].ToString().Trim();
ViewState["GID"] = getBSNO();
//
this.dvOrderNumVal.Value = ViewState["GID"].ToString().Trim();
this.hdGid.Value = ViewState["GID"].ToString().Trim();
lbBSSTATUS.Text = "未锁定"; //"接受委托";
lbFEESTATUS.Text = "未锁定";
//tbACCDATE.Enabled = true;
//ddlBLTYPE.Enabled = true;
tbACCDATE.Text = DateTime.Parse(strdate).Year.ToString().Trim() + "-" + DateTime.Parse(strdate).Month.ToString().Trim();
//
tbHBLNO.Text = "";//调用编码规则
tbCUSTNO.Text = "";//调用编码规则
//tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
//tbCUSTNO.Text = getCodeRule("委托编号", "CUSTNO");//调用编码规则
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
}
protected void ibAdd_Click(object sender, EventArgs e)
{
//Session["USERID"] = "04eaeac5-f271-45d1-b17b-ad4ccbab63d0";
ViewState["strHandleType"] = "add";
this.hdHandle.Value = ViewState["strHandleType"].ToString().Trim();
ViewState["GID"] = getBSNO();
this.dvOrderNumVal.Value = ViewState["GID"].ToString().Trim();
this.hdGid.Value = ViewState["GID"].ToString().Trim();
lbBSSTATUS.Text = "未锁定"; //"接受委托";
lbFEESTATUS.Text = "未锁定";
//tbACCDATE.Enabled = true;
//ddlBLTYPE.Enabled = true;
//
tbACCDATE.Text = DateTime.Parse(strdate).Year.ToString().Trim() + "-" + DateTime.Parse(strdate).Month.ToString().Trim();
tbETD.Text = "";
tbCLOSINGDATE.Text = "";
tbETA.Text = "";
tbISSUEDATE.Text = "";
tbCLOSEDOCDATE.Text = "";
tbINTOPORTDATE.Text = "";
//
tbPKGS.Text = "0";
tbKGS.Text = "0";
tbCBM.Text = "0";
tbINAMOUT.Text = "0";
this.hd_comboBSSOURCE.Value = "自揽货";
this.hd_comboOP.Value = T_ALL_DA.GetStrSQL("SHOWNAME", "select SHOWNAME from [user] where GID='" + this.hdUserID.Value.Trim() + "'");
this.hd_comboDOC.Value = T_ALL_DA.GetStrSQL("SHOWNAME", "select SHOWNAME from [user] where GID='" + this.hdUserID.Value.Trim() + "'");
this.hd_comboKINDPKGS.Value = "PKGS";
//gvCNTRBind();
gvMidwayBind();
//
tbMBLNO.Text = "";
tbHBLNO.Text = "";
tbCUSTNO.Text = "";
tbHBLNO.Text = "";//调用编码规则
tbCUSTNO.Text = "";//调用编码规则
//tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
//tbCUSTNO.Text = getCodeRule("委托编号", "CUSTNO");//调用编码规则
this.hd_comboCUSTOMERNAME.Value = "";
this.hd_comboSHIPPERID.Value = "";
this.hd_comboCONSIGNEEID.Value = "";
this.hd_comboNOTIFYPARTYID.Value = "";
tbSHIPPER.Text = "";
tbCONSIGNEE.Text = "";
tbNOTIFYPARTY.Text = "";
this.hd_comboAGENTID.Value = "";
tbAGENT.Text = "";
this.hd_comboYARD.Value = "";
this.hd_comboTRUCKER.Value = "";
this.hd_comboVESSEL.Value = "";
this.hd_comboVOYNO.Value = "";
tbPLAID.Text="";
this.hd_comboPLA.Value="";
tbPORTLOADID.Text = T_ALL_DA.GetStrSQL("PORTLOADID", "select PORTLOADID from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
this.hd_comboPORTLOAD.Value = T_ALL_DA.GetStrSQL("PORTLOAD", "select PORTLOAD from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
tbPORTDISCHARGEID.Text = "";
this.hd_comboPORTDISCHARGE.Value = "";
tbPLACEDELIVERYID.Text = "";
this.hd_comboPLACEDELIVERY.Value = "";
tbDESTINATIONID.Text = "";
this.hd_comboDESTINATION.Value = "";
tbISSUEPLACE.Text = "";
tbBLFRT.Text = "";
tbMARKS.Text = "N/M";
//tbCNTRSEALNO.Text = "";
tbNOPKGS.Text = "";
tbDESCRIPTION.Text = "";
this.hd_comboGOODSNAME.Value = "";
tbGROSSWEIGHT.Text = "";
tbMEASUREMENT.Text = "";
tbTOTALNO.Text = "";
this.hd_comboCUSTSERVICE.Value = "";
this.hd_comboLANE.Value = "";
this.hd_comboSALE.Value = "";
this.hd_comboCARRIER.Value = "";
this.hd_comboFORWARDER.Value = "";
this.hd_comboCUSTOMSER.Value = "";
tbINVNO.Text = "";
tbDCLASS.Text = "";
tbDUNNO.Text = "";
tbREEFERF.Text = "";
//
rblTEMPID.SelectedValue = "C";
cbISCONTAINERSOC.Checked = false;
rblSOURCECODE.SelectedValue = "1";
tbDPAGE.Text = "";
tbDLABEL.Text = "";
tbLINKMAN.Text = "";
tbVESSELID.Text = "";
tbISSUEPLACEID.Text = "";
//
tbTEMPSET.Text = "";
this.hd_comboBSSOURCEDETAIL.Value = "";
tbCONTRACTNO.Text = "";
tbORDERNO.Text = "";
tbINSURANCEER.Text = "";
tbINSURANCENO.Text = "";
//服务项目名读取
ISFUMIGATION.Checked = false;//熏蒸
ISSTORAGE.Checked = false;//仓储
ISLAND.Checked = false;//陆运
ISCUSTOMS.Checked = false;//报关
ISBOOKING.Checked = false;//订舱
ISINSPECTION.Checked = false;//报检
ISAGENT.Checked = false;//使用代理
ISHBLNO.Checked = false;//分单签单
/*
//服务项目名读取
sSQL = "select * from code_service_disp where CORPID=(select COMPANYID from user_company where USERID='" + strUserID.Trim() + "')";
DataSet ds = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, sSQL);
if (ds.Tables[0].Rows.Count > 0)
{
cblSERVICE.Items.Clear();
if (ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim());
}
}
*/
//
this.hd_comboPACKINGTYPE.Value = "";
this.hd_comboWAREHOUSE.Value = "";
this.hd_comboSALEDEPT.Value = "";
//
//this.hd_comboBLFRT.Value = T_ALL_DA.GetStrSQL("BLFRT", "select BLFRT from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
//this.hd_comboSERVICE.Value = T_ALL_DA.GetStrSQL("SERVICE", "select SERVICE from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
ddlBLFRT.Text = T_ALL_DA.GetStrSQL("BLFRT", "select BLFRT from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
ddlSERVICE.Text = T_ALL_DA.GetStrSQL("SERVICE", "select SERVICE from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
//
if (ddlBLFRT.Text.Trim() == "FREIGHT PREPAID")//PP
{
tbBLFRT.Text = this.hd_comboPORTLOAD.Value; //POL
}
else if (ddlBLFRT.Text.Trim() == "FREIGHT COLLECT")//CC
{
tbBLFRT.Text = this.hd_comboPORTDISCHARGE.Value; //POD
}
//
//ddlBLTYPE.SelectedValue = "整箱";
this.hd_comboBLTYPE.Value="整箱";
ddlISSUETYPE.SelectedValue = "正本";
ddlNOBILL.SelectedValue = "3";
ddlCARGOID.SelectedValue = "S";
//结算方式
ddlSTLNAME.Text = "";
tbSTLDATE.Text = "";
this.hdSTLNAME.Value = "";
this.hdSTLDATE.Value = "";
//
this.hd_comboOPERATOR.Value = "";
tbOPERATORTEL.Text = "";
tbOPERATORFAX.Text = "";
tbOPERATOREMAIL.Text = "";
this.hd_comboFINANCIALSTAFF.Value = "";
tbFINANCIALSTAFFTEL.Text = "";
tbFINANCIALSTAFFFAX.Text = "";
tbFINANCIALSTAFFEMAIL.Text = "";
this.hd_comboOPERATORCODE.Value = "";
this.hd_comboFINANCIALSTAFFCODE.Value = "";
tbREMARK.Text = "";
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
}
protected void ibDel_Click(object sender, EventArgs e)
{
bool bl = false;
if (lbBSSTATUS.Text.Trim() == "未锁定")//接受委托
{
bl = false;
}
else
{
bl = true;
Page.ClientScript.RegisterStartupScript(this.GetType(), "key3", "<script>alert('当前业务为锁定状态,不允许删除此业务!');</script>");//业务封帐
return;
}
//
//if (strShowName.Trim() != this.hd_comboOP.Value.Trim())
//{
// Page.ClientScript.RegisterStartupScript(this.GetType(), "key3", "<script>alert('您不是当前业务的操作,无删除此业务的权限!');</script>");
// return;
//}
//
string alt = T_ALL_DA.GetSeaExportInfoDel(ViewState["GID"].ToString().Trim(), bl, this.hdUserID.Value.Trim());
if (alt != "")
{
//System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "unReport50", "alert('" + alt + "');", true);
Response.Write("<script>alert('" + alt + "');history.back();</script>");
return;
}
//Session["USERID"] = "04eaeac5-f271-45d1-b17b-ad4ccbab63d0";
ViewState["strHandleType"] = "add";
this.hdHandle.Value = ViewState["strHandleType"].ToString().Trim();
ViewState["GID"] = getBSNO();
this.dvOrderNumVal.Value = ViewState["GID"].ToString().Trim();
this.hdGid.Value = ViewState["GID"].ToString().Trim();
lbBSSTATUS.Text = "未锁定";//"接受委托";
lbFEESTATUS.Text = "未锁定";
//tbACCDATE.Enabled = true;
//ddlBLTYPE.Enabled = true;
//
tbACCDATE.Text = DateTime.Parse(strdate).Year.ToString().Trim() + "-" + DateTime.Parse(strdate).Month.ToString().Trim();
tbETD.Text = "";
tbCLOSINGDATE.Text = "";
tbETA.Text = "";
tbISSUEDATE.Text = "";
tbCLOSEDOCDATE.Text = "";
tbINTOPORTDATE.Text = "";
//
tbPKGS.Text = "0";
tbKGS.Text = "0";
tbCBM.Text = "0";
tbINAMOUT.Text = "0";
this.hd_comboBSSOURCE.Value = "自揽货";
this.hd_comboOP.Value = T_ALL_DA.GetStrSQL("SHOWNAME", "select SHOWNAME from [user] where GID='" + this.hdUserID.Value.Trim() + "'");
this.hd_comboDOC.Value = T_ALL_DA.GetStrSQL("SHOWNAME", "select SHOWNAME from [user] where GID='" + this.hdUserID.Value.Trim() + "'");
this.hd_comboKINDPKGS.Value = "PKGS";
//gvCNTRBind();
gvMidwayBind();
//
tbMBLNO.Text = "";
tbHBLNO.Text = "";
tbCUSTNO.Text = "";
tbHBLNO.Text = "";//调用编码规则
tbCUSTNO.Text = "";//调用编码规则
//tbHBLNO.Text = getCodeRule("分提单号", "HBLNO");//调用编码规则
//tbCUSTNO.Text = getCodeRule("委托编号", "CUSTNO");//调用编码规则
this.hd_comboCUSTOMERNAME.Value = "";
this.hd_comboSHIPPERID.Value = "";
this.hd_comboCONSIGNEEID.Value = "";
this.hd_comboNOTIFYPARTYID.Value = "";
tbSHIPPER.Text = "";
tbCONSIGNEE.Text = "";
tbNOTIFYPARTY.Text = "";
this.hd_comboAGENTID.Value = "";
tbAGENT.Text = "";
this.hd_comboYARD.Value = "";
this.hd_comboTRUCKER.Value = "";
this.hd_comboVESSEL.Value = "";
this.hd_comboVOYNO.Value = "";
tbPLAID.Text="";
this.hd_comboPLA.Value="";
tbPORTLOADID.Text = T_ALL_DA.GetStrSQL("PORTLOADID", "select PORTLOADID from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
this.hd_comboPORTLOAD.Value = T_ALL_DA.GetStrSQL("PORTLOAD", "select PORTLOAD from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
tbPORTDISCHARGEID.Text = "";
this.hd_comboPORTDISCHARGE.Value = "";
tbPLACEDELIVERYID.Text = "";
this.hd_comboPLACEDELIVERY.Value = "";
tbDESTINATIONID.Text = "";
this.hd_comboDESTINATION.Value = "";
tbISSUEPLACE.Text = "";
tbBLFRT.Text = "";
tbMARKS.Text = "N/M";
//tbCNTRSEALNO.Text = "";
tbNOPKGS.Text = "";
tbDESCRIPTION.Text = "";
this.hd_comboGOODSNAME.Value = "";
tbGROSSWEIGHT.Text = "";
tbMEASUREMENT.Text = "";
tbTOTALNO.Text = "";
this.hd_comboCUSTSERVICE.Value = "";
this.hd_comboLANE.Value = "";
this.hd_comboSALE.Value = "";
this.hd_comboCARRIER.Value = "";
this.hd_comboFORWARDER.Value = "";
this.hd_comboCUSTOMSER.Value = "";
tbINVNO.Text = "";
tbDCLASS.Text = "";
tbDUNNO.Text = "";
tbREEFERF.Text = "";
//
rblTEMPID.SelectedValue = "C";
cbISCONTAINERSOC.Checked = false;
rblSOURCECODE.SelectedValue = "1";
tbDPAGE.Text = "";
tbDLABEL.Text = "";
tbLINKMAN.Text = "";
tbVESSELID.Text = "";
tbISSUEPLACEID.Text = "";
//
tbTEMPSET.Text = "";
this.hd_comboBSSOURCEDETAIL.Value = "";
tbCONTRACTNO.Text = "";
tbORDERNO.Text = "";
tbINSURANCEER.Text = "";
tbINSURANCENO.Text = "";
//服务项目名读取
ISFUMIGATION.Checked = false;//熏蒸
ISSTORAGE.Checked = false;//仓储
ISLAND.Checked = false;//陆运
ISCUSTOMS.Checked = false;//报关
ISBOOKING.Checked = false;//订舱
ISINSPECTION.Checked = false;//报检
ISAGENT.Checked = false;//使用代理
ISHBLNO.Checked = false;//分单签单
/*
//服务项目名读取
sSQL = "select * from code_service_disp where CORPID=(select COMPANYID from user_company where USERID='" + strUserID.Trim() + "')";
DataSet ds = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, sSQL);
if (ds.Tables[0].Rows.Count > 0)
{
cblSERVICE.Items.Clear();
if (ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISFUMIGATION"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISSTORAGE"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISLAND"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISCUSTOMS"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISINSPECTION"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISBOOKING"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISAGENT"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["ISHBLNO"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["SERVICE9"].ToString().Trim());
}
if (ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim() != null)
{
cblSERVICE.Items.Add(ds.Tables[0].Rows[0]["SERVICE10"].ToString().Trim());
}
}
*/
//
this.hd_comboPACKINGTYPE.Value = "";
this.hd_comboWAREHOUSE.Value = "";
this.hd_comboSALEDEPT.Value = "";
//
//this.hd_comboBLFRT.Value = T_ALL_DA.GetStrSQL("BLFRT", "select BLFRT from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
//this.hd_comboSERVICE.Value = T_ALL_DA.GetStrSQL("SERVICE", "select SERVICE from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
ddlBLFRT.Text = T_ALL_DA.GetStrSQL("BLFRT", "select BLFRT from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
ddlSERVICE.Text = T_ALL_DA.GetStrSQL("SERVICE", "select SERVICE from subcomp_seae_def where CORPID=(select GID from company where GID='" + this.hdCOMPANYID.Value.Trim() + "' and ISDELETED=0)");
//
if (ddlBLFRT.Text.Trim() == "FREIGHT PREPAID")//PP
{
tbBLFRT.Text = this.hd_comboPORTLOAD.Value; //POL
}
else if (ddlBLFRT.Text.Trim() == "FREIGHT COLLECT")//CC
{
tbBLFRT.Text = this.hd_comboPORTDISCHARGE.Value; //POD
}
//
//ddlBLTYPE.SelectedValue = "整箱";
this.hd_comboBLTYPE.Value = "整箱";
ddlISSUETYPE.SelectedValue = "正本";
ddlNOBILL.SelectedValue = "3";
ddlCARGOID.SelectedValue = "S";
//结算方式
ddlSTLNAME.Text = "";
tbSTLDATE.Text = "";
this.hdSTLNAME.Value = "";
this.hdSTLDATE.Value = "";
//
this.hd_comboOPERATOR.Value = "";
tbOPERATORTEL.Text = "";
tbOPERATORFAX.Text = "";
tbOPERATOREMAIL.Text = "";
this.hd_comboFINANCIALSTAFF.Value = "";
tbFINANCIALSTAFFTEL.Text = "";
tbFINANCIALSTAFFFAX.Text = "";
tbFINANCIALSTAFFEMAIL.Text = "";
this.hd_comboOPERATORCODE.Value = "";
this.hd_comboFINANCIALSTAFFCODE.Value = "";
tbREMARK.Text = "";
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
}
private string TableName()
{
//创建临时表名
string sTableName = "";
sTableName = DateTime.Now.ToString("s");
string sUserCode = "";
sUserCode = Session["UserCode"].ToString().Trim();
sTableName = sUserCode + "TEMP" + sTableName.Substring(0, 4) +
sTableName.Substring(5, 2) +
sTableName.Substring(8, 2) +
sTableName.Substring(11, 2) +
sTableName.Substring(14, 2) +
sTableName.Substring(17, 2);
return sTableName;
}
protected void getNULL()
{
TempOpSeaeEdiEntity.GID = getBSNO();
//TempOpSeaeEdiEntity.DOCGID = "";
TempOpSeaeEdiEntity.ISOK = false;
TempOpSeaeEdiEntity.CAUSE = "";
//
TempOpSeaeEdiEntity.BSNO = TempOpSeaeEdiEntity.GID;
TempOpSeaeEdiEntity.MASTERNO = "";
TempOpSeaeEdiEntity.BSSTATUS = false;
TempOpSeaeEdiEntity.FEESTATUS = false;
TempOpSeaeEdiEntity.ORDERTYPE = "EDI导入";
//TempOpSeaeEdiEntity.BSDATE = DateTime.Today.Date;
TempOpSeaeEdiEntity.ACCDATE = "";
TempOpSeaeEdiEntity.MBLNO = "";
TempOpSeaeEdiEntity.HBLNO = "";
TempOpSeaeEdiEntity.CUSTNO = "";
TempOpSeaeEdiEntity.TRANSNO = "";
TempOpSeaeEdiEntity.CUSTOMERNAME = "";
TempOpSeaeEdiEntity.BLTYPE = "";
TempOpSeaeEdiEntity.STLNAME = "";
TempOpSeaeEdiEntity.SHIPPERID = "";
TempOpSeaeEdiEntity.CONSIGNEEID = "";
TempOpSeaeEdiEntity.NOTIFYPARTYID = "";
TempOpSeaeEdiEntity.SHIPPER = "";
TempOpSeaeEdiEntity.CONSIGNEE = "";
TempOpSeaeEdiEntity.NOTIFYPARTY = "";
TempOpSeaeEdiEntity.AGENTID = "";
TempOpSeaeEdiEntity.AGENT = "";
TempOpSeaeEdiEntity.YARD = "";
TempOpSeaeEdiEntity.VESSEL = "";
TempOpSeaeEdiEntity.VOYNO = "";
TempOpSeaeEdiEntity.PlACERECEIPT = "";
TempOpSeaeEdiEntity.PORTLOADID = "";
TempOpSeaeEdiEntity.PORTLOAD = "";
TempOpSeaeEdiEntity.PORTDISCHARGEID = "";
TempOpSeaeEdiEntity.PORTDISCHARGE = "";
TempOpSeaeEdiEntity.PLACEDELIVERYID = "";
TempOpSeaeEdiEntity.PLACEDELIVERY = "";
TempOpSeaeEdiEntity.DESTINATIONID = "";
TempOpSeaeEdiEntity.DESTINATION = "";
TempOpSeaeEdiEntity.NOBILL = "";
TempOpSeaeEdiEntity.ISSUETYPE = "";
TempOpSeaeEdiEntity.ISSUEPLACE = "";
TempOpSeaeEdiEntity.BLFRT = "";
TempOpSeaeEdiEntity.PREPARDAT = "";
TempOpSeaeEdiEntity.PAYABLEAT = "";
TempOpSeaeEdiEntity.SERVICE = "";
TempOpSeaeEdiEntity.MARKS = "";
TempOpSeaeEdiEntity.CNTRSEALNO = "";
TempOpSeaeEdiEntity.NOPKGS = "";
TempOpSeaeEdiEntity.DESCRIPTION = "";
TempOpSeaeEdiEntity.GOODSNAME = "";
TempOpSeaeEdiEntity.GROSSWEIGHT = "";
TempOpSeaeEdiEntity.MEASUREMENT = "";
TempOpSeaeEdiEntity.PKGS = 0;
TempOpSeaeEdiEntity.KINDPKGS = "";
TempOpSeaeEdiEntity.KGS = 0;
TempOpSeaeEdiEntity.CBM = 0;
TempOpSeaeEdiEntity.TOTALNO = "";
TempOpSeaeEdiEntity.CNTRNO = "";
TempOpSeaeEdiEntity.CNTR1 = 0;
TempOpSeaeEdiEntity.CNTR2 = 0;
TempOpSeaeEdiEntity.CNTR3 = 0;
TempOpSeaeEdiEntity.CNTR4 = 0;
TempOpSeaeEdiEntity.CNTR5 = 0;
TempOpSeaeEdiEntity.CNTR6 = 0;
TempOpSeaeEdiEntity.CNTR7 = 0;
TempOpSeaeEdiEntity.CNTR8 = 0;
TempOpSeaeEdiEntity.CNTR9 = 0;
TempOpSeaeEdiEntity.CNTR10 = 0;
TempOpSeaeEdiEntity.OTCNTR = 0;
TempOpSeaeEdiEntity.TEU = 0;
TempOpSeaeEdiEntity.CNTRTOTAL = "";
TempOpSeaeEdiEntity.INPUTBY = "";
DataSet ds1 = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, "select SHOWNAME from [user] where GID ='" + this.hdUserID.Value + "'");
if (ds1 != null)
{
if (ds1.Tables[0].Rows.Count > 0)
{
TempOpSeaeEdiEntity.INPUTBY = ds1.Tables[0].Rows[0]["SHOWNAME"].ToString().Trim();
}
}
TempOpSeaeEdiEntity.OP = "";
TempOpSeaeEdiEntity.CUSTSERVICE = "";
TempOpSeaeEdiEntity.LANE = "";
TempOpSeaeEdiEntity.SALE = "";
TempOpSeaeEdiEntity.CARRIER = "";
TempOpSeaeEdiEntity.FORWARDER = "";
TempOpSeaeEdiEntity.CUSTOMSER = "";
TempOpSeaeEdiEntity.TRUCKER = "";
TempOpSeaeEdiEntity.INVNO = "";
TempOpSeaeEdiEntity.CARGOID = "";
TempOpSeaeEdiEntity.DCLASS = "";
TempOpSeaeEdiEntity.DUNNO = "";
TempOpSeaeEdiEntity.REEFERF = "";
TempOpSeaeEdiEntity.TEMPID = "";
TempOpSeaeEdiEntity.TEMPSET = "";
TempOpSeaeEdiEntity.TEMPMAX = "";
TempOpSeaeEdiEntity.TEMPMIN = "";
TempOpSeaeEdiEntity.BSSOURCE = "";
TempOpSeaeEdiEntity.BSSOURCEDETAIL = "";
TempOpSeaeEdiEntity.CUSTOMSNUM = 0;
TempOpSeaeEdiEntity.CONTRACTNO = "";
TempOpSeaeEdiEntity.ORDTYPE = "";
TempOpSeaeEdiEntity.ORDERNO = "";
TempOpSeaeEdiEntity.INSURANCEER = "";
TempOpSeaeEdiEntity.INSURANCENO = "";
TempOpSeaeEdiEntity.INAMOUT = 0;
TempOpSeaeEdiEntity.ISVOU = false;
TempOpSeaeEdiEntity.VOUNO = "";
TempOpSeaeEdiEntity.REMARK = "";
TempOpSeaeEdiEntity.STATUS1 = false;
TempOpSeaeEdiEntity.STATUS2 = false;
TempOpSeaeEdiEntity.STATUS3 = false;
TempOpSeaeEdiEntity.STATUS4 = false;
TempOpSeaeEdiEntity.STATUS5 = false;
TempOpSeaeEdiEntity.ISFUMIGATION = false;
TempOpSeaeEdiEntity.ISSTORAGE = false;
TempOpSeaeEdiEntity.ISLAND = false;
TempOpSeaeEdiEntity.ISCUSTOMS = false;
TempOpSeaeEdiEntity.ISINSPECTION = false;
TempOpSeaeEdiEntity.ISBOOKING = false;
TempOpSeaeEdiEntity.ISAGENT = false;
TempOpSeaeEdiEntity.ISHBLNO = false;
TempOpSeaeEdiEntity.SERVICE9 = false;
TempOpSeaeEdiEntity.SERVICE10 = false;
TempOpSeaeEdiEntity.ISFUMIGATION = false;
TempOpSeaeEdiEntity.ISSTORAGE = false;
TempOpSeaeEdiEntity.ISLAND = false;
TempOpSeaeEdiEntity.ISCUSTOMS = false;
TempOpSeaeEdiEntity.ISINSPECTION = false;
TempOpSeaeEdiEntity.ISBOOKING = false;
TempOpSeaeEdiEntity.ISAGENT = false;
TempOpSeaeEdiEntity.ISHBLNO = false;
TempOpSeaeEdiEntity.DOC = "";
TempOpSeaeEdiEntity.PACKINGTYPE = "";
TempOpSeaeEdiEntity.WAREHOUSE = "";
TempOpSeaeEdiEntity.CORPID = "";
TempOpSeaeEdiEntity.SALEDEPT = "";
TempOpSeaeEdiEntity.MBLFRT = "";
TempOpSeaeEdiEntity.OPERATOR = "";
TempOpSeaeEdiEntity.OPERATORTEL = "";
TempOpSeaeEdiEntity.OPERATORFAX = "";
TempOpSeaeEdiEntity.OPERATOREMAIL = "";
TempOpSeaeEdiEntity.FINANCIALSTAFF = "";
TempOpSeaeEdiEntity.FINANCIALSTAFFTEL = "";
TempOpSeaeEdiEntity.FINANCIALSTAFFFAX = "";
TempOpSeaeEdiEntity.FINANCIALSTAFFEMAIL = "";
TempOpSeaeEdiEntity.OPERATORCODE = "";
TempOpSeaeEdiEntity.FINANCIALSTAFFCODE = "";
}
private int getPKGS(string strNOPKGS)
{
var iums = 0;
if (strNOPKGS != null && strNOPKGS != "")
{
string[] items = strNOPKGS.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);//这里是以换行符作为分界
string[] ii = new String[items.Length];
if (items != null && items.Length > 0)
{
for (var i = 0; i < items.Length; i++)
{
for (var j = 0; j < items[i].Length; j++)
{
var s = items[i].Trim().Substring(0, j + 1);
var tf = IsNumeric(s);
if (tf)
{
ii[i] = s;
}
else
{
break;
}
}
iums += int.Parse(ii[i]);
}
}
}
return iums;
//$("tbPKGS").value = iums.toString();
}
private String getKINDPKGS(string strNOPKGS)
{
var sums = "";
if (strNOPKGS != null && strNOPKGS != "")
{
string[] items = strNOPKGS.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);//这里是以换行符作为分界
string[] ss = new String[items.Length];
if (items != null && items.Length > 0)
{
for (var i = 0; i < items.Length; i++)
{
for (var j = 0; j < items[i].Length; j++)
{
var s = items[i].Trim().Substring(0, j + 1);
var tf = IsNumeric(s);
if (tf)
{
ss[i] = "";
}
else
{
ss[i] = items[i].Trim().Substring(j).ToUpper();
break;
}
}
}
}
for (var k = 0; k < ss.Length; k++)
{
if (ss.Length == 1)
{
sums = ss[k].ToString().Trim().ToUpper();
break;
}
if (ss[k] == ss[ss.Length - 1])
{
sums = ss[k].ToString().Trim().ToUpper();
}
else
{
sums = "PACKAGES";
break;
}
}
}
return sums;
//$("hd_comboKINDPKGS").value = sums;
}
protected void gvMidwayBind()
{
DataSet ds = T_ALL_DA.GetTopSeaeMidway(ViewState["GID"].ToString().Trim());
if (ds != null)
{
if (ds.Tables[0].Rows.Count > 0)
{
gvMidway.DataSource = ds;
gvMidway.DataBind();
}
}
}
protected void gvMidwayBind2(int iRow)
{
DataSet ds = T_ALL_DA.GetTopSeaeMidway(ViewState["GID"].ToString().Trim());
if (ds != null)
{
if (ds.Tables[0].Rows.Count > 0)
{
gvMidway.DataSource = ds;
gvMidway.DataBind();
ScriptManager.GetCurrent(this.Page).RegisterDataItem(this.UpdatePanel4, "initComboMidway('" + (gvMidway.Rows[iRow].Cells[0].ClientID).ToString().Trim().Substring(0, 15) + "')", true);
}
}
}
protected void gvMidway_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
int gvi = gvMidway.Rows.Count + 2;
if (gvi < 10)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key16", "<script>initComboMidwayAdd('" + (gvMidway.Rows[0].Cells[0].ClientID).ToString().Trim().Substring(0, 12) + "','0" + gvi + "');</script>");
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "key17", "<script>initComboMidwayAdd('" + (gvMidway.Rows[0].Cells[0].ClientID).ToString().Trim().Substring(0, 12) + "','" + gvi + "');</script>");
}
}
}
protected void gvMidway_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
gvMidway.ShowFooter = false;
gvMidway.EditIndex = -1;
gvMidwayBind();//绑定
}
protected void gvMidway_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string strBSNO = T_ALL_DA.GetISBSNO(ViewState["GID"].ToString().Trim());
if (strBSNO == "")
{
System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "unReport52", "alert('无数据!');", true);
return;
}
gvMidway.ShowFooter = false;
string MID = gvMidway.DataKeys[e.RowIndex].Value.ToString().Trim();
string alt = T_ALL_DA.GetTopSeaeMidwayDel(MID, this.hdUserID.Value.Trim());
if (alt != "")
{
System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "unReport41", "alert('" + alt + "');", true);
return;
}
else
{
gvMidway.EditIndex = -1;
gvMidwayBind();//绑定数据
return;
}
}
protected void gvMidway_RowEditing(object sender, GridViewEditEventArgs e)
{
string strBSNO = T_ALL_DA.GetISBSNO(ViewState["GID"].ToString().Trim());
if (strBSNO == "")
{
System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "unReport52", "alert('暂无数据行,请先添加数据!');", true);
return;
}
gvMidway.ShowFooter = false;
gvMidway.EditIndex = e.NewEditIndex;
gvMidwayBind2(e.NewEditIndex);//绑定
}
protected void gvMidway_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
gvMidway.ShowFooter = false;
string MID = gvMidway.DataKeys[e.RowIndex].Value.ToString().Trim();
String MIDNUM = ((HtmlInputHidden)gvMidway.Rows[e.RowIndex].FindControl("hd_comboMIDNUM")).Value;
String TRANTYPE = ((HtmlInputHidden)gvMidway.Rows[e.RowIndex].FindControl("hd_comboTRANTYPE")).Value;
//String VESSEL_VOYNO = ((TextBox)(gvMidway.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim();
String VESSEL_VOYNO = ((HtmlInputText)gvMidway.Rows[e.RowIndex].FindControl("hd_comboVESSEL_VOYNO")).Value;
String ETD = ((TextBox)gvMidway.Rows[e.RowIndex].FindControl("tbETD")).Text.Trim();
String PORTDISCHAGE = ((HtmlInputHidden)gvMidway.Rows[e.RowIndex].FindControl("hd_comboPORTDISCHAGE")).Value;
String alt = T_ALL_DA.GetTopSeaeMidwayUp(MID, MIDNUM, TRANTYPE, VESSEL_VOYNO, ETD, PORTDISCHAGE, this.hdUserID.Value.Trim());
if (alt != "")
{
System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "unReport42", "alert('" + alt + "');", true);
return;
}
else
{
gvMidway.EditIndex = -1;
gvMidwayBind();//绑定数据
return;
}
}
protected void ibMidway_Click(object sender, ImageClickEventArgs e)
{
gvMidway.ShowFooter = true;
gvMidwayBind();
}
protected void gvMidway_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Insert")
{
string strBSNO = T_ALL_DA.GetISBSNO(ViewState["GID"].ToString().Trim());
if (strBSNO == "")
{
getAdd();
}
gvMidway.ShowFooter = false;
String MIDNUM = ((HtmlInputHidden)gvMidway.FooterRow.FindControl("hd_comboMIDNUM")).Value;
String TRANTYPE = ((HtmlInputHidden)gvMidway.FooterRow.FindControl("hd_comboTRANTYPE")).Value;
String VESSEL_VOYNO = ((HtmlInputText)gvMidway.FooterRow.FindControl("hd_comboVESSEL_VOYNO")).Value;
String ETD = ((TextBox)gvMidway.FooterRow.FindControl("tbETD")).Text.Trim();
String PORTDISCHAGE = ((HtmlInputHidden)gvMidway.FooterRow.FindControl("hd_comboPORTDISCHAGE")).Value;
String alt = T_ALL_DA.GetTopSeaeMidwayInsert(ViewState["GID"].ToString().Trim(), MIDNUM, TRANTYPE, VESSEL_VOYNO, ETD, PORTDISCHAGE, this.hdUserID.Value.Trim());
if (alt != "")
{
System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "unReport43", "alert('" + alt + "');", true);
return;
}
else
{
gvMidway.EditIndex = -1;
gvMidwayBind();//绑定数据
return;
}
}
else if (e.CommandName == "Cancel")
{
gvMidway.ShowFooter = false;
}
}
public bool IsNumeric(string s)
{
int inum = 0;
bool bReturn = true;
try
{
inum = int.Parse(s);
}
catch
{
inum = 0;
bReturn = false;
}
return bReturn;
}
//////////集装箱/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region 保存应收账户列表更改结果
/// <summary>
/// 保存应收账户列表更改结果
/// </summary>
/// <param name="tempGroupEntity"></param>
private void SaveRecvTopCtn(JsonTopCtnGroupEntity tempGroupEntity)
{
ViewState["CNTRTOTAL"] = "";
if (tempGroupEntity != null)
{
// 0 1 2 3 4 5 6 7 8 9
// 箱型,箱量,箱号,封号,件数,包装类型,箱内货重,箱皮重,尺码,备注
List<JsonTopCtnEntity> TopCtnEntities = new List<JsonTopCtnEntity>();
TopCtnEntities = tempGroupEntity.JsonTopCtnEntities;
TopCtnDA TopCtnDA = new TopCtnDA();
DataTable TopCtnTable = new DataTable();
string strInitSql = "";
if (tempGroupEntity.JsonTopCtnEntities.Count > 0)
{
string BSNO = tempGroupEntity.JsonTopCtnEntities[0].TopCtn12.Trim();
if (BSNO == "")
{
strInitSql = " SELECT CTN_ID,CTNALL,CTNNUM,CNTRNO,SEALNO,PKGS,KGS,CBM,REMARK,KINDPKGS,TAREWEIGHT FROM op_ctn WHERE 1=1 AND BSNO = '" + ViewState["GID"].ToString().Trim() + "'";
}
else
{
strInitSql = " SELECT CTN_ID,CTNALL,CTNNUM,CNTRNO,SEALNO,PKGS,KGS,CBM,REMARK,KINDPKGS,TAREWEIGHT FROM op_ctn WHERE 1=1 AND BSNO = '" + BSNO + "'";
}
}
else
{
return;
}
TopCtnTable = TopCtnDA.GetExcuteSql(strInitSql).Tables[0];
//取出主提单号
string sMBLNO = "";
TopSeaeEntity = SeaExportInfoDA.GetID(ViewState["GID"].ToString().Trim());
if (TopSeaeEntity.MBLNO != null)
{
sMBLNO = TopSeaeEntity.MBLNO.ToString().Trim();
}
//更新操作SQL语句
ArrayList sqlList = new ArrayList();
//日志操作SQL语句
ArrayList logList = new ArrayList();
//日志记录
Logger log = Logger.Instance;
for (int i = 0; i < TopCtnTable.Rows.Count; i++)
{
foreach (JsonTopCtnEntity TopCtn in TopCtnEntities)
{
if (TopCtnTable.Rows[i]["CTN_ID"].ToString().Trim().Equals(TopCtn.TopCtn1.Trim()))
{
string strSql = "";
string LogContent = "";
LogEntity logEntity = new LogEntity();
#region 更改前后信息对比
//箱型
string strTopCtnCTNALL = TopCtn.TopCtn2.Trim().ToLower().Equals("null") ? "" : TopCtn.TopCtn2.Trim();
if (!TopCtnTable.Rows[i]["CTNALL"].ToString().Trim().Equals(strTopCtnCTNALL))
{
strSql += String.Format(" CTNALL = '{0}'", strTopCtnCTNALL);
LogContent += String.Format(Logger.Instance.GetLogContentTemplate(Logger.LogTypes.UPDATE), "箱型", TopCtnTable.Rows[i]["CTNALL"].ToString().Trim(), strTopCtnCTNALL);
}
//箱量
int strTopCtnCTNNUM = TopCtn.TopCtn3.Equals("null") ? 0 : TopCtn.TopCtn3;
if (!TopCtnTable.Rows[i]["CTNNUM"].ToString().Trim().Equals(strTopCtnCTNNUM))
{
strSql += String.Format(",CTNNUM = '{0}'", strTopCtnCTNNUM);
LogContent += String.Format(Logger.Instance.GetLogContentTemplate(Logger.LogTypes.UPDATE), "箱量", TopCtnTable.Rows[i]["CTNNUM"].ToString().Trim(), strTopCtnCTNNUM);
}
//箱号
string strTopCtnCNTRNO = TopCtn.TopCtn4.Trim().ToLower().Equals("null") ? "" : TopCtn.TopCtn4.Trim();
if (!TopCtnTable.Rows[i]["CNTRNO"].ToString().Trim().Equals(strTopCtnCNTRNO))
{
strSql += String.Format(",CNTRNO = '{0}'", strTopCtnCNTRNO);
LogContent += String.Format(Logger.Instance.GetLogContentTemplate(Logger.LogTypes.UPDATE), "箱号", TopCtnTable.Rows[i]["CNTRNO"].ToString().Trim(), strTopCtnCNTRNO);
}
//封号
string strTopCtnSEALNO = TopCtn.TopCtn5.Trim().ToLower().Equals("null") ? "" : TopCtn.TopCtn5.Trim();
if (!TopCtnTable.Rows[i]["SEALNO"].ToString().Trim().Equals(strTopCtnSEALNO))
{
strSql += String.Format(",SEALNO = '{0}'", strTopCtnSEALNO);
LogContent += String.Format(Logger.Instance.GetLogContentTemplate(Logger.LogTypes.UPDATE), "封号", TopCtnTable.Rows[i]["SEALNO"].ToString().Trim(), strTopCtnSEALNO);
}
//件数
string strTopCtnPKGS = TopCtn.TopCtn6.ToString().Trim().ToLower().Equals("null") ? "" : TopCtn.TopCtn6.ToString().Trim();
if (!TopCtnTable.Rows[i]["PKGS"].ToString().Trim().Equals(strTopCtnPKGS))
{
strSql += String.Format(",PKGS = '{0}'", strTopCtnPKGS);
LogContent += String.Format(Logger.Instance.GetLogContentTemplate(Logger.LogTypes.UPDATE), "件数", TopCtnTable.Rows[i]["PKGS"].ToString().Trim(), strTopCtnPKGS);
}
//包装类型
string strTopCtnKINDPKGS = TopCtn.TopCtn7.Trim().ToLower().Equals("null") ? "" : TopCtn.TopCtn7.Trim();
if (!TopCtnTable.Rows[i]["KINDPKGS"].ToString().Trim().Equals(strTopCtnKINDPKGS))
{
strSql += String.Format(",KINDPKGS = '{0}'", strTopCtnKINDPKGS);
LogContent += String.Format(Logger.Instance.GetLogContentTemplate(Logger.LogTypes.UPDATE), "包装类型", TopCtnTable.Rows[i]["KINDPKGS"].ToString().Trim(), strTopCtnKINDPKGS);
}
//箱内货重
string strTopCtnKGS = TopCtn.TopCtn8.ToString().Trim().ToLower().Equals("null") ? "" : TopCtn.TopCtn8.ToString().Trim();
if (!TopCtnTable.Rows[i]["KGS"].ToString().Trim().Equals(strTopCtnKGS))
{
strSql += String.Format(",KGS = '{0}'", strTopCtnKGS);
LogContent += String.Format(Logger.Instance.GetLogContentTemplate(Logger.LogTypes.UPDATE), "箱内货重", TopCtnTable.Rows[i]["KGS"].ToString().Trim(), strTopCtnKGS);
}
//箱皮重
string strTopCtnTAREWEIGHT = TopCtn.TopCtn9.ToString().Trim().ToLower().Equals("null") ? "" : TopCtn.TopCtn9.ToString().Trim();
if (!TopCtnTable.Rows[i]["TAREWEIGHT"].ToString().Trim().Equals(strTopCtnTAREWEIGHT))
{
strSql += String.Format(",TAREWEIGHT = '{0}'", strTopCtnTAREWEIGHT);
LogContent += String.Format(Logger.Instance.GetLogContentTemplate(Logger.LogTypes.UPDATE), "箱皮重", TopCtnTable.Rows[i]["TAREWEIGHT"].ToString().Trim(), strTopCtnTAREWEIGHT);
}
//尺码
string strTopCtnCBM = TopCtn.TopCtn10.ToString().Trim().ToLower().Equals("null") ? "" : TopCtn.TopCtn10.ToString().Trim();
if (!TopCtnTable.Rows[i]["CBM"].ToString().Trim().Equals(strTopCtnCBM))
{
strSql += String.Format(",CBM = '{0}'", strTopCtnCBM);
LogContent += String.Format(Logger.Instance.GetLogContentTemplate(Logger.LogTypes.UPDATE), "尺码", TopCtnTable.Rows[i]["CBM"].ToString().Trim(), strTopCtnCBM);
}
//备注
string strTopCtnREMARK = TopCtn.TopCtn11.Trim().ToLower().Equals("null") ? "" : TopCtn.TopCtn11.Trim();
if (!TopCtnTable.Rows[i]["REMARK"].ToString().Trim().Equals(strTopCtnREMARK))
{
strSql += String.Format(",REMARK = '{0}'", strTopCtnREMARK);
LogContent += String.Format(Logger.Instance.GetLogContentTemplate(Logger.LogTypes.UPDATE), "备注", TopCtnTable.Rows[i]["REMARK"].ToString().Trim(), strTopCtnREMARK);
}
#endregion
//如果有字段内容更新则执行更新操作
if (LogContent.Trim().Length > 1)
{
if (strSql.Trim().StartsWith(","))
{
strSql = strSql.Trim().Substring(1);
}
string strUpdateSql = String.Format("UPDATE {0} SET {1} WHERE CTN_ID = '{2}'", "op_ctn", strSql, TopCtn.TopCtn1.Trim());
sqlList.Add(strUpdateSql);
logList.Add(String.Format("{0} {1} {2} ", strShowName, "修改主提单号为:“" + sMBLNO.Trim() + "”箱型为:“" + TopCtnTable.Rows[i]["CTNALL"].ToString().Trim() + "”的集装箱内容", LogContent));
}
TopCtnEntities.Remove(TopCtn);
break;
}
}
}
if (sqlList.Count > 0)
{
int iResult = TopCtnDA.UpdateTopCtnFromGrid(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 = this.hdUserID.Value.Trim();//测试使用数据,正式发布请删除
logEntity.LogContent = logList[i].ToString();
log.WriteLog(logEntity);
}
}
#endregion
}
}
//如果遍历完所有费用表数据,没有相对应的费用信息,则将剩余的费用信息插入到费用表中
if (TopCtnEntities.Count > 0)
{
//插入新的应收费用信息
InsertTopCtn(TopCtnEntities, 1);
}
//
getCNTRTOTAL();
setCNT();
recvJSON = "";
this.recvContainer.Value = "";
}
else
{
recvJSON = "";
this.recvContainer.Value = "";
return;
}
}
#endregion
#region 插入账户信息记录
/// <summary>
/// 插入账户信息记录
/// </summary>
/// <param name="TopCtnEntities">需要插入账户表的账户实体类</param>
/// <param name="iType">如果iType值为1则记录账户类型为收/否则记录为付</param>
public void InsertTopCtn(List<JsonTopCtnEntity> TopCtnEntities, int iType)
{
ViewState["CNTRTOTAL"] = "";
ArrayList sqlInsertList = new ArrayList();
TopCtnDA TopCtnDA = new TopCtnDA();
foreach (JsonTopCtnEntity TopCtn in TopCtnEntities)
{
string strItemSql = "";
string strValueSql = "";
string strInsertSql = "";
//编号
strItemSql += "CTN_ID";
strValueSql += String.Format("'{0}'", TopCtn.TopCtn1.Trim().Equals("null") ? "" : TopCtn.TopCtn1.Trim());
//订舱编号
strItemSql += ",BSNO";
if (TopCtn.TopCtn12.Trim().Equals(""))
{
strValueSql += String.Format(",'{0}'", ViewState["GID"].ToString().Trim());
}
else
{
strValueSql += String.Format(",'{0}'", TopCtn.TopCtn12.Trim().Equals("null") ? ViewState["GID"].ToString().Trim() : TopCtn.TopCtn12.Trim());
}
//箱型
strItemSql += ",CTNALL";
strValueSql += String.Format(",'{0}'", TopCtn.TopCtn2.Trim().Equals("null") ? "" : TopCtn.TopCtn2.Trim());
//箱量
strItemSql += ",CTNNUM";
strValueSql += String.Format(",'{0}'", TopCtn.TopCtn3.Equals("null") ? 0 : TopCtn.TopCtn3);
//箱号
strItemSql += ",CNTRNO";
strValueSql += String.Format(",'{0}'", TopCtn.TopCtn4.Trim().Equals("null") ? "" : TopCtn.TopCtn4.Trim());
//封号
strItemSql += ",SEALNO";
strValueSql += String.Format(",'{0}'", TopCtn.TopCtn5.Trim().Equals("null") ? "" : TopCtn.TopCtn5.Trim());
//件数
strItemSql += ",PKGS";
strValueSql += String.Format(",'{0}'", TopCtn.TopCtn6.Equals("null") ? 0 : TopCtn.TopCtn6);
//包装类型
strItemSql += ",KINDPKGS";
strValueSql += String.Format(",'{0}'", TopCtn.TopCtn7.Trim().Equals("null") ? "" : TopCtn.TopCtn7.Trim());
//箱内货重
strItemSql += ",KGS";
strValueSql += String.Format(",'{0}'", TopCtn.TopCtn8.Equals("null") ? 0 : TopCtn.TopCtn8);
//箱皮重
strItemSql += ",TAREWEIGHT";
strValueSql += String.Format(",'{0}'", TopCtn.TopCtn9.Equals("null") ? 0 : TopCtn.TopCtn9);
//尺码
strItemSql += ",CBM";
strValueSql += String.Format(",'{0}'", TopCtn.TopCtn10.Equals("null") ? 0 : TopCtn.TopCtn10);
//备注
strItemSql += ",REMARK";
strValueSql += String.Format(",'{0}'", TopCtn.TopCtn11.Trim().Equals("null") ? "" : TopCtn.TopCtn11.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_ctn", strItemSql, strValueSql);
sqlInsertList.Add(strInsertSql);
}
}
if (sqlInsertList.Count > 0)
{
int iResult = TopCtnDA.InsertTopCtnFromGrid(sqlInsertList);
//为1表示更新成功
//为-1有异常,更新失败
//为-2更新异常,事务已回滚成功
//更新完成后,记录日志
if (iResult == 1)
{
//getCNTRTOTAL();
//setCNT();
}
}
}
#endregion
protected void setCNT()
{
DataSet ds = TopCtnDA.GetFieldAll(" and BSNO='" + ViewState["GID"].ToString().Trim() + "'");
if (ds != null)
{
if (ds.Tables[0].Rows.Count > 0)
{
foreach (DataTable myTable in ds.Tables)
{
foreach (DataRow myRow in myTable.Rows)//遍历表
{
string alt = T_ALL_DA.GetCTNCODEInsert("op_seae", ViewState["GID"].ToString().Trim(), this.hdUserID.Value.Trim(), myRow["CTNALL"].ToString().Trim(), int.Parse(myRow["CTNNUM"].ToString().Trim()), myRow["CTN_ID"].ToString().Trim(), myRow["REMARK"].ToString().Trim(), myRow["CNTRNO"].ToString().Trim(), myRow["SEALNO"].ToString().Trim(), myRow["PKGS"].ToString().Trim(), myRow["KGS"].ToString().Trim(), myRow["CBM"].ToString().Trim());
if (alt != "")
{
Response.Write("<script>alert('" + alt + "');history.back();</script>");
return;
}
}
}
}
}
}
protected void getCNTRTOTAL()
{
DataSet ds = TopCtnDA.GetFieldAll(" and BSNO='" + ViewState["GID"].ToString().Trim() + "'");
if (ds != null)
{
if (ds.Tables[0].Rows.Count <= 0)
{
getAdd();
Response.Write("<script>window.opener.location.reload();history.back();</script>");
return;
}
else
{
string strCNTRTOTAL = "";
string strCNTRNO = "";
foreach (DataTable myTable in ds.Tables)
{
foreach (DataRow myRow in myTable.Rows)//遍历表
{
strCNTRTOTAL += myRow["CTNALL"].ToString().Trim() + "*" + myRow["CTNNUM"].ToString().Trim() + " / ";
strCNTRNO += myRow["CNTRNO"].ToString().Trim() + "/" + myRow["SEALNO"].ToString().Trim() + "/" + myRow["CTNALL"].ToString().Trim() + "\r\n";//"/" + myRow["PKGS"].ToString().Trim() + "PKGS/" + myRow["KGS"].ToString().Trim() + "KGS/" + myRow["CBM"].ToString().Trim() + "CBM
}
}
strCNTRTOTAL = strCNTRTOTAL.Trim().Substring(0, strCNTRTOTAL.Trim().Length - 1);
int iii = CrmSeaeorderDA.UpdateInfoCNTRTOTAL("update op_seae set CNTRTOTAL='" + strCNTRTOTAL + "',CNTRSEALNO='" + strCNTRNO + "' where BSNO='" + ViewState["GID"].ToString().Trim() + "'", this.hdUserID.Value.Trim());
}
}
}
#region 获取账户客户保存的账户信息
/// <summary>
/// 获取账户客户保存的账户信息
/// </summary>
/// <param name="tempValue"></param>
/// <returns></returns>
public JsonTopCtnGroupEntity GetPostEntity(string tempValue)
{
JsonTopCtnGroupEntity TopCtnGroupEntity = (JsonTopCtnGroupEntity)JSON.Instance.ToObject(tempValue);
return TopCtnGroupEntity;
}
#endregion
//
}
}