varct=MsOpSeaeDAL.GetRdCount("MASTERNO<>'"+bsno+"' AND MBLNO='"+mblno+"' and CORPID='"+Convert.ToString(Session["COMPANYID"])+"' and SALEDEPT='"+dept+"'");
varheadList=MsOpSeaeDAL.GetDataList("BSNO IN ('"+bsnos+"')",CookieConfig.GetCookie_UserId(Request),Convert.ToString(Session["SHOWNAME"]),Convert.ToString(Session["COMPANYID"]));
varheadList=MsOpSeaeDAL.GetDataAllList("BSNO IN ('"+bsnos+"')");
varheadList=MsOpSeaeDAL.GetDataList("BSNO IN ('"+bsnos+"')",CookieConfig.GetCookie_UserId(Request),Convert.ToString(Session["SHOWNAME"]),Convert.ToString(Session["COMPANYID"]));
varheadList=MsOpSeaeDAL.GetDataAllList("BSNO IN ('"+bsnos+"')");
varblUpSQL=" if (select CID from Op_SeaCover where bsno='"+bill.BSNO+"' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'"+bill.BSNO+"','发送SO','','"+Session["SHOWNAME"]+"','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"','1')";
varblUpSQL=" if (select CID from Op_SeaCover where bsno='"+headdata.BSNO+"' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'"+headdata.BSNO+"','发送SO','','"+Session["SHOWNAME"]+"','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"','1')";
boolbl=T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
else
{
varblUpSQL=" if (select CID from Op_SeaCover where bsno='"+bill.BSNO+"' AND COVERTITLE='发送SI') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'"+bill.BSNO+"','发送SI','','"+Session["SHOWNAME"]+"','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"','1')";
varblUpSQL=" if (select CID from Op_SeaCover where bsno='"+headdata.BSNO+"' AND COVERTITLE='发送SI') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'"+headdata.BSNO+"','发送SI','','"+Session["SHOWNAME"]+"','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"','1')";
varblUpSQL=" if (select CID from Op_SeaCover where bsno='"+bill.BSNO+"' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'"+bill.BSNO+"','发送SO','','"+Session["SHOWNAME"]+"','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"','1')";
varblUpSQL=" if (select CID from Op_SeaCover where bsno='"+headdata.BSNO+"' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'"+headdata.BSNO+"','发送SO','','"+Session["SHOWNAME"]+"','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"','1')";
boolbl=T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
else
{
varblUpSQL=" if (select CID from Op_SeaCover where bsno='"+bill.BSNO+"' AND COVERTITLE='发送SI') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'"+bill.BSNO+"','发送SI','','"+Session["SHOWNAME"]+"','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"','1')";
varblUpSQL=" if (select CID from Op_SeaCover where bsno='"+headdata.BSNO+"' AND COVERTITLE='发送SI') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'"+headdata.BSNO+"','发送SI','','"+Session["SHOWNAME"]+"','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"','1')";
varheadList=MsOpSeaeDAL.GetDataList("BSNO IN ('"+bsnos+"')",CookieConfig.GetCookie_UserId(Request),Convert.ToString(Session["SHOWNAME"]),Convert.ToString(Session["COMPANYID"]));
varheadList=MsOpSeaeDAL.GetDataAllList("BSNO IN ('"+bsnos+"')");
varheadList=MsOpSeaeDAL.GetDataList("BSNO IN ('"+bsnos+"')",CookieConfig.GetCookie_UserId(Request),Convert.ToString(Session["SHOWNAME"]),Convert.ToString(Session["COMPANYID"]));
varheadList=MsOpSeaeDAL.GetDataAllList("BSNO IN ('"+bsnos+"')");
varblUpSQL=" if (select CID from Op_SeaCover where bsno='"+bill.BSNO+"' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'"+bill.BSNO+"','发送SO','','"+Session["SHOWNAME"]+"','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"','1')";
varheadList=MsOpSeaeDAL.GetDataList("BSNO IN ('"+bsnos+"')",CookieConfig.GetCookie_UserId(Request),Convert.ToString(Session["SHOWNAME"]),Convert.ToString(Session["COMPANYID"]));
varheadList=MsOpSeaeDAL.GetDataAllList("BSNO IN ('"+bsnos+"')");
varblUpSQL=" if (select CID from Op_SeaCover where bsno='"+bill.BSNO+"' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'"+bill.BSNO+"','发送SO','','"+Session["SHOWNAME"]+"','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"','1')";
varheadList=MsOpSeaeDAL.GetDataList("BSNO IN ('"+bsnos+"')",CookieConfig.GetCookie_UserId(Request),Convert.ToString(Session["SHOWNAME"]),Convert.ToString(Session["COMPANYID"]));
varheadList=MsOpSeaeDAL.GetDataAllList("BSNO IN ('"+bsnos+"')");
varblUpSQL=" if (select CID from Op_SeaCover where bsno='"+bill.BSNO+"' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'"+bill.BSNO+"','发送SO','','"+Session["SHOWNAME"]+"','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"','1')";
// strSql.Append("SELECT top 200 B.BSNO,MASTERNO,ORDERTYPE,ORDTYPE,ORDERNO,BSSTATUS,FEESTATUS,BSDATE,ACCDATE,MBLNO,HBLNO,CUSTNO,TRANSNO,CUSTOMERNAME,BLTYPE,SHIPPERID,");
strSql.Append(",TRANSTATUS,EDIREMARK,SERVICECONTRACTNO,(CASE BSSTATUS WHEN 1 THEN '锁定' else '未锁定' end) as BSSTATUSREF ");
strSql.Append(",(CASE FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF,TRANSPORT,DFLASH,DTEL,ISMP,PKGTYPE ");
//strSql.Append(",(SELECT TOP 1 STATUS FROM OP_STATUS WHERE BSNO=OP_SEAE.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS ");
strSql.Append(",(SELECT TOP 1 STATUS FROM V_OP_STATUS WITH (NOLOCK) WHERE BSNO=OP_SEAE.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS");
strSql.Append(",(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97018 and EnumValueID=OP_SEAE.MANIFESTSTATUS) as MANIFESTSTATUSREF");