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/EntityDA/T_ALL_DA.cs

4659 lines
222 KiB
C#

2 years ago
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DSWeb.DataAccess;
using DSWeb.Models;
using System.Data.SqlClient;
using System.Collections.Generic;
using Microsoft.International.Converters.PinYinConverter;
namespace DSWeb.EntityDA
{
public class T_ALL_DA
{
/// <summary>
/// 执行命令语句
/// </summary>
/// <returns></returns>
public bool GetExecuteSqlCommand(string strSQL)
{
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, strSQL);
return bl;
}
public static bool ExecuteSqlCommand(string strSQL)
{
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, strSQL);
return bl;
}
/// <summary>
/// 返回 某字段
/// </summary>
/// <returns></returns>
public string GetStrSQL(string strfield, string strSQL)
{
string alt = "";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, strSQL);
if (DS != null)
{
if (DS.Tables[0].Rows.Count > 0)
{
alt = DS.Tables[0].Rows[0]["" + strfield + ""].ToString();
}
}
return alt;
}
public static string GetSQL_str(string strfield, string strSQL)
{
string alt = "";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, strSQL);
if (DS != null)
{
if (DS.Tables[0].Rows.Count > 0)
{
alt = DS.Tables[0].Rows[0]["" + strfield + ""].ToString();
}
}
return alt;
}
public string GetOtStrSQL(string connectionstring, string strfield, string strSQL)
{
string alt = "";
DataSet DS = SqlHelper.OpenSqlDataSet(connectionstring, strSQL);
if (DS != null)
{
if (DS.Tables[0].Rows.Count > 0)
{
alt = DS.Tables[0].Rows[0]["" + strfield + ""].ToString();
}
}
return alt;
}
/// <summary>
/// 返回 数据集
/// </summary>
/// <returns></returns>
public DataSet GetAllSQL(string strSQL)
{
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, strSQL);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
public DataSet GetOtAllSQL(string connectionstring, string strSQL)
{
DataSet DS = SqlHelper.OpenSqlDataSet(connectionstring, strSQL);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
#region 返回所有用户数据集
/// <summary>
/// 返回所有用户数据集
/// </summary>
/// <param name="strSql">查询SQL语句</param>
/// <returns></returns>
public DataSet GetExcuteSql(string strSql)
{
DataSet userSet = new DataSet();
userSet = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSql);
return userSet;
}
#endregion
/// <summary>
/// 生成36位sql编码
/// </summary>
/// <returns></returns>
public String getSQLID(string sName)
{
string strSQLID = Guid.NewGuid().ToString();
strSQLID = strSQLID.Replace("-", "");
strSQLID = sName + strSQLID;
return strSQLID;
}
/// <summary>
/// 返回所有 分公司代码
/// </summary>
/// <param name="strUserID">用户GID</param>
/// <returns></returns>
public String GetCORPID(string strUserID)
{
string str = "select COMPANYID from user_company where USERID='" + strUserID + "' and COMPANYID in (select GID from [company] where ISDELETED=0 and ISDISABLE=0)";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["COMPANYID"].ToString();
}
else
{
str = "";
}
return str;
}
/// <summary>
/// 返回所有 分公司部门代码
/// </summary>
/// <param name="strUserID">用户GID</param>
/// <returns></returns>
public String GetDEPTGID(string strUserID)
{
string strcompanyid = GetCORPID(strUserID);
string str = "select GID from sys_dept where LINKID='" + strcompanyid + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["GID"].ToString();
}
else
{
str = "";
}
return str;
}
/// <summary>
/// 返回所有 用户显示名称
/// </summary>
/// <param name="strUserID">用户GID</param>
/// <returns></returns>
public String GetSHOWNAME(string strUserID)
{
string str = "select SHOWNAME from [user] where GID='" + strUserID + "' and ISDELETED=0";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["SHOWNAME"].ToString();
}
else
{
str = "";
}
return str;
}
public static String GetShowName(string strUserID)
{
string str = "select SHOWNAME from [user] where GID='" + strUserID + "' and ISDELETED=0";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["SHOWNAME"].ToString();
}
else
{
str = "";
}
return str;
}
/// <summary>
/// 返回所有 业务状态的颜色值
/// </summary>
/// <param name="strBSTYPE">业务类型</param>
/// <param name="strBSSTATUS">业务状态</param>
/// <returns></returns>
public String GetTCodeBsstatus(string strBSTYPE, bool strBSSTATUS)
{
string str = "select COLOR from code_bsstatus where BSTYPE='" + strBSTYPE + "' and BSSTATUS='" + strBSSTATUS + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["COLOR"].ToString();
}
else
{
str = "";
}
return str;
}
/// <summary>
/// 返回所有 费用状态的颜色值
/// </summary>
/// <param name="strBSSTATUS">费用状态</param>
/// <returns></returns>
public String GetTCodeFeeColor(string strFEESTATU)
{
string str = "select COLOR from code_fee_color where FEESTATU='" + strFEESTATU + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["COLOR"].ToString();
}
else
{
str = "";
}
return str;
}
/// <summary>
/// 返回所有 运输条款 数据集
/// </summary>
/// <param name="strSql"></param>
/// <returns></returns>
public DataSet GetTCodeService()
{
string str = "select * from code_service order by [SERVICE]";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 付费方式 数据集
/// </summary>
/// <param name="strSql"></param>
/// <returns></returns>
public DataSet GetTCodeFrt()
{
string str = "select * from code_frt order by [FRT]";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 市场来源大类
/// </summary>
/// <returns></returns>
public DataSet GetTCodeSource(string strUserID)
{
string strCORPID = GetCORPID(strUserID);
string str = "select * from code_source where CORPID='' or CORPID is null or CORPID='" + strCORPID + "' order by SOURCENAME";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 市场来源细类
/// </summary>
/// <returns></returns>
public DataSet GetTCodeSourceDetail(string strSOURCEID)
{
string str = "select * from code_source_detail where SOURCEID='" + strSOURCEID + "' order by SOURCEDETAIL";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 所属分公司的操作人员
/// </summary>
/// <returns></returns>
public DataSet GetOP(string strUserID,string rName)
{
string strCORPID = GetCORPID(strUserID);
string str = "select CODENAME,SHOWNAME from [user] where GID in(select USERID from user_company where COMPANYID='" + strCORPID + "' and USERID in(select USERID from user_userattribute where ATTRIBUTEID in(select GID from user_attribute where [NAME]='" + rName + "') and value='true')) and ISDISABLE=0 and ISDELETED=0";
if (rName.Trim() == "")
{
str = "select CODENAME,SHOWNAME from [user] where GID in(select USERID from user_company where COMPANYID='" + strCORPID + "' and USERID in(select USERID from user_userattribute where ATTRIBUTEID in(select GID from user_attribute) and value='true')) and ISDISABLE=0 and ISDELETED=0";
}
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 所属分公司的揽货人员
/// </summary>
/// <returns></returns>
public DataSet GetSALE(string strUserID, string rName)
{
string strCORPID = GetCORPID(strUserID);
string str = "select CODENAME,SHOWNAME from [user] where GID in(select USERID from user_company where COMPANYID='" + strCORPID + "' and USERID in(select USERID from user_userattribute where ATTRIBUTEID in(select GID from user_attribute where [NAME]='" + rName + "') and value='true')) and ISDISABLE=0 and ISDELETED=0 and GID='"+strUserID+"'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
public DataSet GetDataSet(string Sqlstr)
{
string str = Sqlstr;
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 单位
/// </summary>
/// <returns></returns>
public DataSet GetWebCrmClient(string strIS,string strCompanyID)
{
string str = "select CODENAME,SHORTNAME from info_client where " + strIS + "='True' and ISSTOP=0 and (CORPID='" + strCompanyID + "' or gid in(select clientid from info_client_share where ISSHARE=1 and companyid='" + strCompanyID + "')) order by CODENAME";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 单位(两个属性)
/// </summary>
/// <returns></returns>
public DataSet GetWebCrmClient(string strIS, string strIS2, string strCompanyID)
{
int iK = 0;
string str = "select CODENAME,SHORTNAME from info_client where 1=1 and (";
if (strIS.Trim() != "")
{
str += strIS + "='True'";
iK = 1;
}
if (strIS2.Trim() != "")
{
if (iK == 1)
{
str += " or " + strIS2 + "='True' ";
}
else
{
str += strIS2 + "='True' ";
}
}
str += ") and ISSTOP=0 and (CORPID='" + strCompanyID + "' or gid in(select clientid from info_client_share where ISSHARE=1 and companyid='" + strCompanyID + "')) order by CODENAME";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 根据CODENAME返回单位
/// </summary>
/// <returns></returns>
public DataSet GetWebCrmClientCODENAME(string strIS,string strCODENAME)
{
string str = "select * from info_client where " + strIS + "='True' and CODENAME='" + strCODENAME + "' order by CODENAME";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 航线
/// </summary>
/// <returns></returns>
public DataSet GetTCodeLanes()
{
string str = "select * from code_lanes";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 info_client表中的BLCONTENT(详细信息)字段
/// </summary>
/// <param name="strBLCONTENT">BLCONTENT(详细信息)</param>
/// <returns></returns>
public String GetBLCONTENT(string strName)
{
string str = "select BLCONTENT from info_client where CODENAME='" + strName + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["BLCONTENT"].ToString();
}
else
{
str = "";
}
return str;
}
/// <summary>
/// 返回所有 船名
/// </summary>
/// <returns></returns>
public DataSet GetTCodeVessel()
{
string str = "select * from code_vessel";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 航次
/// </summary>
/// <returns></returns>
public DataSet GetTCodeVoyno(string strVESSEL)
{
string str = "select * from code_voyno where VSID='"+strVESSEL+"'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 起运港口
/// </summary>
/// <returns></returns>
public DataSet GetTCodeLoadport()
{
string str = "select * from code_loadport order by PORT";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 卸货港、目的港、交货地
/// </summary>
/// <returns></returns>
public DataSet GetTCodeDisport(string strSel)
{
string str="";
if(strSel=="")
{
str = "select top 50 * from code_disport order by PORT";
}
else
{
str = "select * from code_disport where PORT like '"+strSel+"%' order by PORT";
}
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回 运价的卸货港、船公司等等
/// </summary>
/// <returns></returns>
public DataSet GetYunJiaGroupBy(string strGroupBy)
{
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, strGroupBy);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 包装类型
/// </summary>
/// <returns></returns>
public DataSet GetTCodePackage()
{
string str = "select * from code_package order by PKGS";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 货物信息
/// </summary>
/// <returns></returns>
public DataSet GetTCodeGoods()
{
string str = "select GID, GOODCODE, GOODNAME, DESCRIP from code_goods order by GOODCODE";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 货物信息
/// </summary>
/// <returns></returns>
public DataTable GetGoodsTb()
{
DataTable dt = new DataTable();
string str = "select GID, GOODCODE, GOODNAME, DESCRIP from code_goods order by GOODCODE";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
dt = DS.Tables[0];
return dt;
}
/// <summary>
/// 返回所有 货物信息code_goods表中的DESCRIP(详细信息)字段
/// </summary>
/// <param name="strBLCONTENT">BLCONTENT(详细信息)</param>
/// <returns></returns>
public String GetDESCRIP(string strName)
{
string str = "select DESCRIP from code_goods where GOODCODE='" + strName + "' order by GOODCODE";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["DESCRIP"].ToString();
}
else
{
str = "";
}
return str;
}
/// <summary>
/// 返回所有 货物信息(DESCRIP)字段
/// </summary>
/// <param name="strBLCONTENT">BLCONTENT(详细信息)</param>
/// <returns></returns>
public String GetTCodeGoodsDESCRIP(string strID)
{
string str = "select DESCRIP from code_goods where GOODCODE='" + strID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["DESCRIP"].ToString();
}
else
{
str = "";
}
return str;
}
/// <summary>
/// 返回所有 货物信息
/// </summary>
/// <returns></returns>
public DataSet GetTopSeaeMidway(string strBSNO)
{
string str = "select * from op_seae_midway where BSNO='"+strBSNO+"'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
str = "select top 1 MID='无数据',BSNO='无数据',MIDNUM='无数据',VESSEL_VOYNO='无数据',TRANTYPE='无数据',PORTLOAD='无数据',ETD='无数据',ETA='无数据',PORTDISCHAGE='无数据' from op_seae_midway";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
}
}
catch
{
str = "select top 1 MID='无数据',BSNO='无数据',MIDNUM='无数据',VESSEL_VOYNO='无数据',TRANTYPE='无数据',PORTLOAD='无数据',ETD='无数据',ETA='无数据',PORTDISCHAGE='无数据' from op_seae_midway";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
}
return DS;
}
/// <summary>
/// 返回所有 运输过程信息删除
/// </summary>
/// <returns></returns>
public String GetTopSeaeMidwayDel(string MID, string strUserID)
{
string str = "delete from op_seae_midway where MID='" + MID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "运输过程信息删除op_seae_midway操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除运输过程信息','删除操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 运输过程信息更新
/// </summary>
/// <returns></returns>
public String GetTopSeaeMidwayUp(string MID,string MIDNUM,string TRANTYPE,string VESSEL_VOYNO,string ETD,string PORTDISCHAGE, string strUserID)
{
string str = "update op_seae_midway set MIDNUM='" + MIDNUM + "',TRANTYPE='" + TRANTYPE + "',VESSEL_VOYNO='" + VESSEL_VOYNO + "',ETD='" + ETD + "',PORTDISCHAGE='" + PORTDISCHAGE + "' where MID='" + MID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "运输过程信息更新op_seae_midway操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新运输过程信息op_seae_midway','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 运输过程信息插入
/// </summary>
/// <returns></returns>
public String GetTopSeaeMidwayInsert(string strBSNO, string MIDNUM, string TRANTYPE, string VESSEL_VOYNO, string ETD, string PORTDISCHAGE,string strUserID)
{
string str = "insert into op_seae_midway(BSNO,MIDNUM,TRANTYPE,[VESSEL_VOYNO],ETD,PORTDISCHAGE) values('" + strBSNO + "','" + MIDNUM + "','" + TRANTYPE + "','" + VESSEL_VOYNO + "','" + ETD + "','" + PORTDISCHAGE + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "运输过程信息插入op_seae_midway操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入运输过程表op_seae_midway的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 集装箱更新
/// </summary>
/// <returns></returns>
public String GetCTNCODEUp(string strBSNO, string strUserID,string strCTNID, string hdcomboCTNCODE, int inum,string hdcomboCTNCODEold,string snumold)
{
string alt = "";
string strold = "";
int inumold = int.Parse(snumold);
string strCORPID = GetCORPID(strUserID);//分公司代码
string str = "select * from code_ctn_disp";// where CORPID = '" + strCORPID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
//
int iTEU = 0;
int iTEUold = 0;
string sCTNCODE1 = hdcomboCTNCODE.Trim();
string sCTNCODE2 = hdcomboCTNCODE.Trim();
try
{
if (int.Parse(hdcomboCTNCODE.Trim().Substring(0, 2)) < 40)//.Equals("20"))
{
iTEU = 1 * inum;
sCTNCODE1 = hdcomboCTNCODE.Trim().Substring(0, 2);
sCTNCODE2 = hdcomboCTNCODE.Trim().Substring(2, 2);
}
else
{
iTEU = 2 * inum;
sCTNCODE1 = hdcomboCTNCODE.Trim().Substring(0, 2);
sCTNCODE2 = hdcomboCTNCODE.Trim().Substring(2, 2);
}
//
if (int.Parse(hdcomboCTNCODEold.Trim().Substring(0, 2)) < 40)//.Equals("20"))
{
iTEUold = 1 * inumold;
}
else
{
iTEUold = 2 * inumold;
}
}
catch (Exception)
{
}
//
if (DS == null)
{
strold = "update op_seae set OTCNTR=OTCNTR-" + inumold + ",TEU=TEU-" + iTEUold + " where BSNO='" + strBSNO + "'";
str = "update op_seae set OTCNTR=OTCNTR+" + inum + ",TEU=TEU+"+iTEU+" where BSNO='" + strBSNO + "'";
}
else
{
int s = 0;
for (int i = 1; i < 11; i++)
{
if (DS.Tables[0].Rows[0][i].ToString().Trim().Equals(hdcomboCTNCODEold.Trim()))
{
strold = "update op_seae set CNTR" + i + "=CNTR" + i + "-" + inumold + ",TEU=TEU-" + iTEUold + " where BSNO='" + strBSNO + "'";
s = i;
break;
}
}
int j = 0;
for (int i = 1; i < 11; i++)
{
if(DS.Tables[0].Rows[0][i].ToString().Trim().Equals(hdcomboCTNCODE.Trim()))
{
str = "update op_seae set CNTR"+i+"=CNTR"+i+"+" + inum + ",TEU=TEU+"+iTEU+" where BSNO='" + strBSNO + "'";
j = i;
break;
}
}
if (s == 0)
{
strold = "update op_seae set OTCNTR=OTCNTR-" + inumold + ",TEU=TEU-" + iTEUold + " where BSNO='" + strBSNO + "'";
}
if (j == 0)
{
str = "update op_seae set OTCNTR=OTCNTR+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
}
}
//
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, strold);
if (bl == false)
{
alt = "集装箱信息更新减op_seae操作出错";
return alt;
}
else
{
//strold = strold.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新减集装箱信息op_seae','更新操作','" + strold + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
//
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "集装箱信息更新增op_seae操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新增集装箱信息op_seae','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
//
str = "update op_ctn set SIZE='" + sCTNCODE1.Trim() + "',CTN='" + sCTNCODE2.Trim() + "',CTNNUM=" + inum + ",TEU=" + iTEU + ",CTNALL='" + hdcomboCTNCODE.Trim() + "',PKGS=" + inum + " where CTN_ID='" + strCTNID + "'";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "集装箱信息更新op_ctn操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新集装箱信息op_ctn','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 集装箱删除
/// </summary>
/// <returns></returns>
public string GetCTNCODEDel(string strBSNO, string strUserID, string strCTNID, string hdcomboCTNCODE, int inum)
{
string alt = "";
string strCORPID = GetCORPID(strUserID);//分公司代码
string str = "select * from code_ctn_disp";// where CORPID = '" + strCORPID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
//
int iTEU = 0;
try
{
if (int.Parse(hdcomboCTNCODE.Trim().Substring(0, 2)) < 40)//.Equals("20"))
{
iTEU = 1 * inum;
}
else
{
iTEU = 2 * inum;
}
}
catch(Exception)
{
}
if (DS == null)
{
str = "update op_seae set OTCNTR=OTCNTR-" + inum + ",TEU=TEU-" + iTEU + " where BSNO='" + strBSNO + "'";
}
else
{
int j = 0;
for (int i = 1; i < 11; i++)
{
if (DS.Tables[0].Rows[0][i].ToString().Trim().Equals(hdcomboCTNCODE.Trim()))
{
str = "update op_seae set CNTR" + i + "=CNTR" + i + "-" + inum + ",TEU=TEU-" + iTEU + " where BSNO='" + strBSNO + "'";
j = i;
break;
}
}
if (j == 0)
{
str = "update op_seae set OTCNTR=OTCNTR-" + inum + ",TEU=TEU-" + iTEU + " where BSNO='" + strBSNO + "'";
}
}
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "集装箱信息删除op_seae操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除集装箱信息op_seae','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
//
str = "delete from op_ctn where CTN_ID='" + strCTNID + "'";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "集装箱信息删除op_ctn操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除集装箱信息','删除操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 集装箱插入
/// </summary>
/// <returns></returns>
public String GetCTNCODEInsert(string bstype,string strBSNO, string strUserID, string hdcomboCTNCODE, int inum, string strCTNID, string strREMARK, string strCNTRNO, string strSEALNO, string strPKGS, string strKGS, string strCBM)
{
string alt = "";
//
int iTEU = 0;
string sCTNCODE1 = hdcomboCTNCODE.Trim();
string sCTNCODE2 = hdcomboCTNCODE.Trim();
try
{
if (int.Parse(hdcomboCTNCODE.Trim().Substring(0, 2)) < 40)//.Equals("20"))
{
iTEU = 1 * inum;
sCTNCODE1 = hdcomboCTNCODE.Trim().Substring(0, 2);
sCTNCODE2 = hdcomboCTNCODE.Trim().Substring(2, 2);
}
else
{
iTEU = 2 * inum;
sCTNCODE1 = hdcomboCTNCODE.Trim().Substring(0, 2);
sCTNCODE2 = hdcomboCTNCODE.Trim().Substring(2, 2);
}
}
catch(Exception)
{
}
//
string strCORPID = GetCORPID(strUserID);//分公司代码
string str = "select * from code_ctn_disp";// where CORPID = '" + strCORPID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
if (DS == null)
{
str = "update " + bstype + " set OTCNTR=OTCNTR+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
}
else
{
int j = 0;
for (int i = 1; i < 11; i++)
{
if (DS.Tables[0].Rows[0][i].ToString().Trim().Equals(hdcomboCTNCODE.Trim()))
{
str = "update " + bstype + " set CNTR" + i + "=CNTR" + i + "+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
j = i;
break;
}
}
if(j==0)
{
str = "update " + bstype + " set OTCNTR=OTCNTR+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
}
}
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "集装箱信息更新op_seae操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新集装箱信息op_seae','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
//
str = "select * from op_ctn where CTN_ID = '" + strCTNID + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
if (DS != null)
{
str = "update op_ctn set BSNO='" + strBSNO + "',[SIZE]='" + sCTNCODE1 + "',CTN='" + sCTNCODE2 + "',CTNNUM=" + inum + ",TEU=" + iTEU + ",CTNALL='" + hdcomboCTNCODE.Trim() + "',REMARK='" + strREMARK + "', CNTRNO='" + strCNTRNO + "', SEALNO='" + strSEALNO + "',PKGS=" + strPKGS + ", KGS='" + strKGS + "', CBM='" + strCBM + "' where CTN_ID='" + strCTNID + "'";
}
else
{
if (strCTNID.Trim().Equals(""))
{
str = "insert into op_ctn(BSNO,[SIZE],CTN,CTNNUM,TEU,CTNALL,REMARK,CNTRNO,SEALNO,PKGS,KGS,CBM) values('" + strBSNO + "','" + sCTNCODE1 + "','" + sCTNCODE2 + "'," + inum + "," + iTEU + ",'" + hdcomboCTNCODE.Trim() + "','" + strREMARK + "','" + strCNTRNO + "','" + strSEALNO + "'," + strPKGS + "," + strKGS + ", " + strCBM + ")";
}
else
{
str = "insert into op_ctn(CTN_ID,BSNO,[SIZE],CTN,CTNNUM,TEU,CTNALL,REMARK,CNTRNO,SEALNO,PKGS,KGS,CBM) values('" + strCTNID + "','" + strBSNO + "','" + sCTNCODE1 + "','" + sCTNCODE2 + "'," + inum + "," + iTEU + ",'" + hdcomboCTNCODE.Trim() + "','" + strREMARK + "','" + strCNTRNO + "','" + strSEALNO + "'," + strPKGS + "," + strKGS + ", " + strCBM + ")";
}
}
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "集装箱信息插入op_ctn操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入集装箱信息表op_ctn的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 edi集装箱插入委托表
/// </summary>
/// <returns></returns>
public String setEDICTN(string strBSNO, string strUserID, string hdcomboCTNCODE, int inum, string strCTNID, string strREMARK, string strCNTRNO, string strSEALNO)
{
string alt = "";
//
int iTEU = 0;
try
{
if (int.Parse(hdcomboCTNCODE.Trim().Substring(0, 2)) < 40)//.Equals("20"))
{
iTEU = 1 * inum;
}
else
{
iTEU = 2 * inum;
}
}
catch (Exception)
{
}
//
string strCORPID = GetCORPID(strUserID);//分公司代码
string str = "select * from code_ctn_disp";// where CORPID = '" + strCORPID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
if (DS == null)
{
str = "update op_seae set OTCNTR=OTCNTR+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
}
else
{
int j = 0;
for (int i = 1; i < 11; i++)
{
if (DS.Tables[0].Rows[0][i].ToString().Trim().Equals(hdcomboCTNCODE.Trim()))
{
str = "update op_seae set CNTR" + i + "=CNTR" + i + "+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
j = i;
break;
}
}
if (j == 0)
{
str = "update op_seae set OTCNTR=OTCNTR+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
}
}
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "集装箱信息更新op_seae操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新集装箱信息op_seae','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 箱号封号导入--清空委托
/// </summary>
/// <returns></returns>
public int setQQCTCTNDEL(string strBSNO)
{
int iResult = 0;
string str = "";
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
//op_Seae中集装箱清空
str = "update op_seae set CNTR1=0,CNTR2=0,CNTR3=0,CNTR4=0,CNTR5=0,CNTR6=0,CNTR7=0,CNTR8=0,CNTR9=0,CNTR10=0,OTCNTR=0,TEU=0,CNTRTOTAL='',CNTRSEALNO='' where BSNO='" + strBSNO + "'";
iResult = -3;//op_Seae中集装箱清空
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
str = "delete from op_ctn where BSNO='" + strBSNO + "'";
iResult = -4;//删除集装箱明细出错
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
//事务提交
sqlTran.Commit();
iResult = 1;//状态为1表示插入成功
}
catch (Exception execError)
{
iResult = -1;//有异常,插入失败
sqlTran.Rollback();
iResult = -2;//插入异常,事务已回滚成功
throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
/*
iResult = -3;//op_Seae中集装箱清空
iResult = -4;//删除集装箱明细出错
*/
return iResult;
}
/// <summary>
/// 箱号封号导入--集装箱导入
/// </summary>
/// <returns></returns>
public int setQQCTCTN(string strBSNO, string strUserID, string strSIZE, string strCTN, int strCTNNUM, string strCNTRNO, string strSEALNO)
{
int iResult = 0;
string str = "";
int inum = strCTNNUM;
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
int iTEU = 0;
try
{
if (int.Parse(strSIZE.Trim().Substring(0, 2)) < 40)//20"))
{
iTEU = 1 * inum;
}
else
{
iTEU = 2 * inum;
}
}
catch(Exception)
{
}
//
str = "insert into op_ctn(BSNO,[SIZE],CTN,CTNNUM,TEU,CTNALL,REMARK,CNTRNO,SEALNO,PKGS) values('" + strBSNO + "','" + strSIZE.Trim() + "','" + strCTN.Trim() + "',1," + iTEU + ",'" + strSIZE.Trim() + strCTN.Trim() + "','','" + strCNTRNO + "','" + strSEALNO + "'," + inum + ")";
iResult = -6;//插入集装箱明细出错
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
//
string strCORPID = GetCORPID(strUserID);//分公司代码
str = "select * from code_ctn_disp";// where CORPID = '" + strCORPID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
if (DS == null)
{
str = "update op_seae set OTCNTR=OTCNTR+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
}
else
{
int j = 0;
for (int i = 1; i < 11; i++)
{
if (DS.Tables[0].Rows[0][i].ToString().Trim().Equals(strSIZE.Trim() + strCTN.Trim()))
{
str = "update op_seae set CNTR" + i + "=CNTR" + i + "+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
j = i;
break;
}
}
if (j == 0)
{
str = "update op_seae set OTCNTR=OTCNTR+" + inum + ",TEU=TEU+" + iTEU + " where BSNO='" + strBSNO + "'";
}
}
iResult = -5;//更新委托的TEU出错//
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
//
string sCNTRTOTAL = strSIZE.Trim() + strCTN.Trim() + "*" + strCTNNUM.ToString().Trim() + " / ";
string sCNTRNO = strCNTRNO.Trim() + "/" + strSEALNO.Trim() + "/" + strSIZE.Trim() + strCTN.Trim() + "\r\n";//"/" + myRow["PKGS"].ToString().Trim() + "PKGS/" + myRow["KGS"].ToString().Trim() + "KGS/" + myRow["CBM"].ToString().Trim() + "CBM
str = "update op_seae set CNTRTOTAL=CNTRTOTAL+'" + sCNTRTOTAL + "',CNTRSEALNO=CNTRSEALNO+'" + sCNTRNO + "' where BSNO='" + strBSNO.Trim() + "'";
iResult = -6;//集装箱大写和箱封号
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
//
//事务提交
sqlTran.Commit();
iResult = 1;//状态为1表示插入成功
}
catch (Exception)
{
iResult = -1;//有异常,插入失败
sqlTran.Rollback();
iResult = -2;//插入异常,事务已回滚成功
//throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
/*
iResult = -5;//更新委托的集装箱大写和TEU出错
iResult = -6;//插入集装箱明细出错
*/
return iResult;
}
/// <summary>
/// 箱号封号导入--集装箱导入
/// </summary>
/// <returns></returns>
public string setQQCTCTN(string strBSNO, string strUserID, DataTable dtINFO)
{
int iResult = 0;
string alt = "";
string str = "";
string sCNTRTOTAL = "";
string sCNTRNO = "";
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
str = "delete from op_ctn where BSNO='" + strBSNO + "'";
iResult = -3;//
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
//
//op_Seae中集装箱清空
str = "update op_seae set CNTR1=0,CNTR2=0,CNTR3=0,CNTR4=0,CNTR5=0,CNTR6=0,CNTR7=0,CNTR8=0,CNTR9=0,CNTR10=0,OTCNTR=0,TEU=0,CNTRTOTAL='',CNTRSEALNO='' where BSNO='" + strBSNO + "'";
iResult = -4;//op_Seae中集装箱清空
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
//
string strCORPID = GetCORPID(strUserID);//分公司代码
str = "select * from code_ctn_disp";// where CORPID = '" + strCORPID + "'";
DataSet DS = GetAllSQL(str);
//
//dc = dtINFO.Columns.Add("尺寸", Type.GetType("System.String"));
//dc = dtINFO.Columns.Add("箱型", Type.GetType("System.String"));
//dc = dtINFO.Columns.Add("箱量", Type.GetType("System.String"));//1
//dc = dtINFO.Columns.Add("TEU", Type.GetType("System.String"));//
//dc = dtINFO.Columns.Add("表现形式", Type.GetType("System.String"));
//dc = dtINFO.Columns.Add("箱号", Type.GetType("System.String"));
//dc = dtINFO.Columns.Add("封号", Type.GetType("System.String"));
//dc = dtINFO.Columns.Add("件数", Type.GetType("System.String"));
//dc = dtINFO.Columns.Add("货重", Type.GetType("System.String"));
//dc = dtINFO.Columns.Add("尺码", Type.GetType("System.String"));
//dc = dtINFO.Columns.Add("备注", Type.GetType("System.String"));//
//dc = dtINFO.Columns.Add("包装类型", Type.GetType("System.String"));//PACKAGES
//dc = dtINFO.Columns.Add("箱皮重", Type.GetType("System.String"));
for (int i = 0; i < dtINFO.Rows.Count; i++)
{
str = "insert into op_ctn(BSNO,CTNCODE,[SIZE],CTN,CTNNUM,TEU,CTNALL,CNTRNO,SEALNO,PKGS,KGS,CBM,REMARK,KINDPKGS,TAREWEIGHT) values('" + strBSNO + "','','" + dtINFO.Rows[i]["尺寸"].ToString().Trim() + "','" + dtINFO.Rows[i]["箱型"].ToString().Trim() + "'," + int.Parse(dtINFO.Rows[i]["箱量"].ToString().Trim()) + "," + int.Parse(dtINFO.Rows[i]["TEU"].ToString().Trim()) + ",'" + dtINFO.Rows[i]["表现形式"].ToString().Trim() + "','" + dtINFO.Rows[i]["箱号"].ToString().Trim() + "','" + dtINFO.Rows[i]["封号"].ToString().Trim() + "'," + int.Parse(dtINFO.Rows[i]["件数"].ToString().Trim()) + "," + Decimal.Parse(dtINFO.Rows[i]["货重"].ToString().Trim()) + "," + Decimal.Parse(dtINFO.Rows[i]["尺码"].ToString().Trim()) + ",'','" + dtINFO.Rows[i]["包装类型"].ToString().Trim() + "'," + Decimal.Parse(dtINFO.Rows[i]["箱皮重"].ToString().Trim()) + ")";
iResult = -5;//插入集装箱明细出错
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
//
sCNTRTOTAL += dtINFO.Rows[i]["表现形式"].ToString().Trim() + "*" + dtINFO.Rows[i]["箱量"].ToString().Trim() + " / ";
sCNTRNO += dtINFO.Rows[i]["箱号"].ToString().Trim() + "/" + dtINFO.Rows[i]["封号"].ToString().Trim() + "/" + dtINFO.Rows[i]["表现形式"].ToString().Trim() + "\r\n";
//
if (DS == null)
{
str = "update op_seae set OTCNTR=OTCNTR+" + int.Parse(dtINFO.Rows[i]["箱量"].ToString().Trim()) + ",TEU=TEU+" + int.Parse(dtINFO.Rows[i]["TEU"].ToString().Trim()) + " where BSNO='" + strBSNO + "'";
}
else
{
int j = 0;
for (int k = 1; k < 11; k++)
{
if (DS.Tables[0].Rows[0][k].ToString().Trim().Equals(dtINFO.Rows[i]["表现形式"].ToString().Trim()))
{
str = "update op_seae set CNTR" + i + "=CNTR" + i + "+" + int.Parse(dtINFO.Rows[i]["箱量"].ToString().Trim()) + ",TEU=TEU+" + int.Parse(dtINFO.Rows[i]["TEU"].ToString().Trim()) + " where BSNO='" + strBSNO + "'";
j = i;
break;
}
}
if (j == 0)
{
str = "update op_seae set OTCNTR=OTCNTR+" + int.Parse(dtINFO.Rows[i]["箱量"].ToString().Trim()) + ",TEU=TEU+" + int.Parse(dtINFO.Rows[i]["TEU"].ToString().Trim()) + " where BSNO='" + strBSNO + "'";
}
}
iResult = -6;//更新委托的TEU出错//
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
}
//
sCNTRTOTAL = sCNTRTOTAL.Trim().Substring(0, sCNTRTOTAL.Trim().Length - 1);
str = "update op_seae set CNTRTOTAL='" + sCNTRTOTAL.Trim() + "',CNTRSEALNO='" + sCNTRNO.Trim() + "' where BSNO='" + strBSNO.Trim() + "'";
iResult = -7;//集装箱大写和箱封号
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
//
//事务提交
sqlTran.Commit();
iResult = 1;//状态为1表示插入成功
}
catch (Exception)
{
iResult = -1;//有异常,插入失败
sqlTran.Rollback();
iResult = -2;//插入异常,事务已回滚成功
//throw execError;
alt = "集装箱箱号封号导入出错!";
}
finally
{
SqlHelper.CloseConnection();
}
}
//
return alt;
}
/// <summary>
/// 返回所有 集装箱类型
/// </summary>
/// <returns></returns>
public DataSet GetTCodeCtn()
{
string str = "select * from code_ctn order by CTN";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 删除一票货
/// </summary>
/// <returns></returns>
public String GetSeaExportInfoDel(string strBSNO, bool strBSSTATUS,string strUserID)
{
string alt = "";
if (strBSSTATUS)
{
alt = "当前业务为锁定状态,不允许删除此业务!";//业务封帐
return alt;
}
//
//str = "select * from code_bsstatus where BSSTATUS='" + strBSSTATUS + "' and ISEDIT='False'";
//DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
//try
//{
// if (DS.Tables[0].Rows.Count > 0)
// {
// alt = "当前业务状态为不允许删除此业务!";
// return alt;
// }
//}
//catch
//{
// DS = null;
// alt = "当前业务状态判断出错,暂不允许删除业务!";
// return alt;
//}
//
string str = "select * from ch_fee where BSNO='" + strBSNO + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count > 0)
{
alt = "当前业务有其相关的费用信息,请先删除!";
return alt;
}
}
catch
{
DS = null;
}
//
str = "select * from op_seae where MASTERNO='" + strBSNO + "' and BSNO<>MASTERNO and BLTYPE='拼箱分票'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count > 0)
{
alt = "当前业务有其相关的拼箱分票信息,请先删除!";
return alt;
}
}
catch
{
DS = null;
}
str = "delete from op_seae where BSNO='" + strBSNO + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "删除一票货op_seae操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除一票货信息','删除操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
//
str = "delete from op_ctn where BSNO='" + strBSNO + "'";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl)
{
//str = str.Trim().Replace("'","''");
//str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除一票货的集装箱信息','删除操作','" + str + "','" + strUserID + "')";
//bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
return alt;
}
/// <summary>
/// 返回所有 删除一票货
/// </summary>
/// <returns></returns>
public String GetSeaImportInfoDel(string strBSNO, bool strBSSTATUS, string strUserID)
{
string alt = "";
if (strBSSTATUS)
{
alt = "当前业务为锁定状态,不允许删除此业务!";//业务封帐
return alt;
}
//
//str = "select * from code_bsstatus where BSSTATUS='" + strBSSTATUS + "' and ISEDIT='False'";
//DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
//try
//{
// if (DS.Tables[0].Rows.Count > 0)
// {
// alt = "当前业务状态为不允许删除此业务!";
// return alt;
// }
//}
//catch
//{
// DS = null;
// alt = "当前业务状态判断出错,暂不允许删除业务!";
// return alt;
//}
//
string str = "select * from ch_fee where BSNO='" + strBSNO + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count > 0)
{
alt = "当前业务有其相关的费用信息,请先删除!";
return alt;
}
}
catch
{
DS = null;
}
//
str = "select * from op_seai where MASTERNO='" + strBSNO + "' and BSNO<>MASTERNO and BLTYPE='拼箱分票'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count > 0)
{
alt = "当前业务有其相关的拼箱分票信息,请先删除!";
return alt;
}
}
catch
{
DS = null;
}
str = "delete from op_seai where BSNO='" + strBSNO + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "删除一票货op_seai操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除一票货信息','删除操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
//
str = "delete from op_ctn where BSNO='" + strBSNO + "'";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl)
{
//str = str.Trim().Replace("'","''");
//str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除一票货的集装箱信息','删除操作','" + str + "','" + strUserID + "')";
//bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
return alt;
}
/// <summary>
/// 返回所有 货物信息(DESCRIP)字段
/// </summary>
/// <param name="strBLCONTENT">BLCONTENT(详细信息)</param>
/// <returns></returns>
public string GetISBSNO(string strBSNO)
{
string str = "select BSNO from op_seae where BSNO='" + strBSNO + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["BSNO"].ToString();
}
else
{
str = "";
}
return str;
}
/// <summary>
/// 返回 表的字段及其说明
/// </summary>
/// <returns></returns>
public DataSet GetTableField(string tableName)
{
string str = "SELECT a.name AS Field,isnull(g.[value],'-') AS Explain FROM sys.columns a left join sys.extended_properties g on (a.object_id = g.major_id AND g.minor_id = a.column_id) WHERE object_id =(SELECT object_id FROM sys.tables WHERE name = '" + tableName + "')"; //a.column_id AS No,
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 提单模板参数设置信息插入
/// </summary>
/// <returns></returns>
public String GetTSysTemplateSetInsert(string TEMPLATEID, string MARKS_SET, string DESCRIPTION_SETS, string KGS_DIGITAL, string CBM_DIGITAL,string strUserID)
{
string str = "insert into sys_Template_set(TEMPLATEID, [MARKS_SET], [DESCRIPTION_SETS], [KGS_DIGITAL], [CBM_DIGITAL]) values('" + TEMPLATEID + "','" + MARKS_SET + "','" + DESCRIPTION_SETS + "','" + KGS_DIGITAL + "','" + CBM_DIGITAL + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "提单模板参数设置插入sys_Template_set操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入提单模板参数设置表sys_Template_set的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 提单模板参数设置信息更新
/// </summary>
/// <returns></returns>
public String GetTSysTemplateSetUpdate(string TEMPLATEID, string MARKS_SET, string DESCRIPTION_SETS, string KGS_DIGITAL, string CBM_DIGITAL,string strUserID)
{
string str = "update sys_Template_set set [MARKS_SET]='" + MARKS_SET + "', [DESCRIPTION_SETS]='" + DESCRIPTION_SETS + "', [KGS_DIGITAL]='" + KGS_DIGITAL + "', [CBM_DIGITAL]='" + CBM_DIGITAL + "' where TEMPLATEID='" + TEMPLATEID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "提单模板参数设置更新sys_Template_set操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新提单模板参数设置sys_Template_set','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 提单模板参数
/// </summary>
/// <returns></returns>
public DataSet GetTSysTemplateSet(string TEMPLATEID)
{
string str = "select * from sys_Template_set where TEMPLATEID='" + TEMPLATEID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 提单模板
/// </summary>
/// <returns></returns>
public String GetTCodeTemplateTEMPLATE(string TEMPLATEID)
{
string str = "select TEMPLATE from code_Template where TEMPLATEID='" + TEMPLATEID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["BSNO"].ToString();
}
else
{
str = "";
}
return str;
}
/// <summary>
/// 返回所有 提单模板
/// </summary>
/// <returns></returns>
public DataSet GetTCodeTemplate()
{
string str = "select * from code_Template";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 集装箱箱型箱量信息
/// </summary>
/// <returns></returns>
public DataSet GetTopCtn(string strBSNO)
{
string str = "select * from op_ctn where BSNO='" + strBSNO + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 业务函电列表信息删除
/// </summary>
/// <returns></returns>
public String GetTopLetterDel(string leid,string LETTERNAME, string strUserID)
{
string alt = "";
//DataSet ds =GetTopLetter(leid);
//if(ds!=null)
//{
//if (ds.Tables[0].Rows[0]["LETTERNAME"].ToString().Trim().Equals("入货通知"))
if (LETTERNAME.Trim().Equals("入货通知"))
{
string str = "delete from op_letter_yard where [LE_ID]='" + leid + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "业务函电入货通知信息删除op_letter_yard操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除业务函电入货通知信息','删除操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
else if (LETTERNAME.Trim().Equals("更改通知"))
{
string str = "delete from op_letter_change where [LE_ID]='" + leid + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "业务函电更改通知信息删除op_letter_change操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除业务函电更改通知信息','删除操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
else if (LETTERNAME.Trim().Equals("电放保函"))
{
string str = "delete from op_letter_sur where [LE_ID]='" + leid + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "业务函电电放保函信息删除op_letter_sur操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除业务函电电放保函信息','删除操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
else if (LETTERNAME.Trim().Equals("派车通知"))
{
string str = "delete from op_letter_truck where [LE_ID]='" + leid + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "业务函电派车通知信息删除op_letter_truck操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除业务函电派车通知信息','删除操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
//}
string str2 = "delete from op_letter where [LE_ID]='" + leid + "'";
bool bl2 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str2);
alt = "";
if (bl2 == false)
{
alt = "业务函电列表信息删除op_letter操作出错";
return alt;
}
else
{
//str2 = str2.Trim().Replace("'", "''");
//string str1 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除业务函电列表信息','删除操作','" + str2 + "','" + strUserID + "')";
//bool bl1 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str1);
}
return alt;
}
/// <summary>
/// 返回所有 业务函电信息
/// </summary>
/// <returns></returns>
public DataSet GetTopLetter(string strLEID)
{
string str = "select * from op_letter where LE_ID='" + strLEID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 业务函电入货通知信息插入
/// </summary>
/// <returns></returns>
public String GetTopLetterYardInsert(string strLEID, string strBSNO, string tbTO, string tbATTN, string tbATTNTEL, string tbATTNFAX, string tbFM, string tbFMTEL, string tbFMFAX, string tbFMEMAIL, string hd_comboDOC, string tbMBLNO, string tbPORTDISCHARGE, string tbVESSELVOYNO, string tbETD, string tbPKC, string tbCNTR, string tbDESCRIPTION, string ddlYARD, string tbAddress, string tbCHIEF, string tbTel, string ddlYARD2, string tbAddress2, string tbCHIEF2, string tbTel2, string tbCLOSINGDATE, string tbCLOSEDOCDATE, string tbExportCustoms, string tbCustomsCode, string tbDeclarationCode, string tbREMARK, string tbDOCTEL, string tbDOCFAX, string tbDOCEMAIL, string strUserID)
{
string str = "insert into op_letter(LE_ID,BSNO,HEAD_TO,HEAD_ATTN,LETTERNAME,INPUTBY,INPUTTIME,HEAD_ATTNTEL,HEAD_ATTNFAX,HEAD_FMTEL,HEAD_FMFAX,HEAD_FMEMAIL) values('" + strLEID + "','" + strBSNO + "','" + tbTO + "','" + tbATTN + "','入货通知','" + tbFM + "',getdate(),'" + tbATTNTEL + "','" + tbATTNFAX + "','" + tbFMTEL + "','" + tbFMFAX + "','" + tbFMEMAIL + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "业务函电信息添加op_letter操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入业务函电信息表op_letter的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
//
str = "insert into op_letter_yard(LE_ID,MBLNO,PORTDISCHARGE,VESSELVOYNO,ETD,PKC,CNTR,DESCRIPTION,YARD,Address,CHIEF,Tel,YARD2,Address2,CHIEF2,Tel2,CLOSINGDATE,CLOSEDOCDATE,ExportCustoms,CustomsCode,DeclarationCode,REMARK,DOC,DOCTEL,DOCFAX,DOCEMAIL) values('" + strLEID + "','" + tbMBLNO + "','" + tbPORTDISCHARGE + "','" + tbVESSELVOYNO + "',{0},'" + tbPKC + "','" + tbCNTR + "','" + tbDESCRIPTION + "','" + ddlYARD + "','" + tbAddress + "','" + tbCHIEF + "','" + tbTel + "','" + ddlYARD2 + "','" + tbAddress2 + "','" + tbCHIEF2 + "','" + tbTel2 + "',{1},{2},'" + tbExportCustoms + "','" + tbCustomsCode + "','" + tbDeclarationCode + "','" + tbREMARK + "','" + hd_comboDOC + "','" + tbDOCTEL + "','" + tbDOCFAX + "','" + tbDOCEMAIL + "')";
//
if (tbETD.Trim().IndexOf("0001")>-1 || tbETD.Trim() == "")
{
tbETD = "NULL";
}
else
{
tbETD = "'" + tbETD.Trim() + "'";
}
if (tbCLOSINGDATE.Trim().IndexOf("0001")>-1 || tbCLOSINGDATE.Trim() == "")
{
tbCLOSINGDATE = "NULL";
}
else
{
tbCLOSINGDATE = "'" + tbCLOSINGDATE.Trim() + "'";
}
if (tbCLOSEDOCDATE.Trim().IndexOf("0001")>-1 || tbCLOSEDOCDATE.Trim() == "")
{
tbCLOSEDOCDATE = "NULL";
}
else
{
tbCLOSEDOCDATE = "'" + tbCLOSEDOCDATE.Trim() + "'";
}
str = String.Format(str, tbETD, tbCLOSINGDATE, tbCLOSEDOCDATE);
//
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
alt = "";
if (bl == false)
{
string str3 = "delete from op_letter where [LE_ID]='" + strLEID + "' and BSNO='" + strBSNO + "'";
bool bl3 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str3);
alt = "业务函电入货通知信息添加op_letter_yard操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入业务函电入货通知信息表op_letter_yard的信息','插入操作','" + str + "','" + strUserID + "')";
//bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
return alt;
}
/// <summary>
/// 返回所有 业务函电入货通知信息更新
/// </summary>
/// <returns></returns>
public String GetTopLetterYardUpdate(string strLEID, string tbTO, string tbATTN, string tbATTNTEL, string tbATTNFAX, string tbFM, string tbFMTEL, string tbFMFAX,string tbFMEMAIL, string hd_comboDOC, string tbMBLNO, string tbPORTDISCHARGE, string tbVESSELVOYNO, string tbETD, string tbPKC, string tbCNTR, string tbDESCRIPTION, string ddlYARD, string tbAddress, string tbCHIEF, string tbTel, string ddlYARD2, string tbAddress2, string tbCHIEF2, string tbTel2, string tbCLOSINGDATE, string tbCLOSEDOCDATE, string tbExportCustoms, string tbCustomsCode, string tbDeclarationCode, string tbREMARK,string tbDOCTEL,string tbDOCFAX,string tbDOCEMAIL, string strUserID)
{
string str = "update op_letter set HEAD_TO='" + tbTO + "',HEAD_ATTN='" + tbATTN + "',UpdateTime=getdate(),HEAD_ATTNTEL='" + tbATTNTEL + "',HEAD_ATTNFAX='" + tbATTNFAX + "',HEAD_FMTEL='" + tbFMTEL + "',HEAD_FMFAX='" + tbFMFAX + "',HEAD_FMEMAIL='" + tbFMEMAIL + "' where LE_ID='" + strLEID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "业务函电信息更新op_letter操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新业务函电信息op_letter','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
//
str = "update op_letter_yard set MBLNO='" + tbMBLNO + "',PORTDISCHARGE='" + tbPORTDISCHARGE + "',VESSELVOYNO='" + tbVESSELVOYNO + "',{0},PKC='" + tbPKC + "',CNTR='" + tbCNTR + "',DESCRIPTION='" + tbDESCRIPTION + "',YARD='" + ddlYARD + "',Address='" + tbAddress + "',CHIEF='" + tbCHIEF + "',Tel='" + tbTel + "',YARD2='" + ddlYARD2 + "',Address2='" + tbAddress2 + "',CHIEF2='" + tbCHIEF2 + "',Tel2='" + tbTel2 + "',{1},{2},ExportCustoms='" + tbExportCustoms + "',CustomsCode='" + tbCustomsCode + "',DeclarationCode='" + tbDeclarationCode + "',REMARK='" + tbREMARK + "',[DOC]='" + hd_comboDOC + "',DOCTEL='" + tbDOCTEL + "',DOCFAX='" + tbDOCFAX + "',DOCEMAIL='" + tbDOCEMAIL + "' where LE_ID='" + strLEID + "'";
//
if (tbETD.Trim().IndexOf("0001")>-1 || tbETD.Trim() == "")
{
tbETD = "ETD=NULL";
}
else
{
tbETD = "ETD='" + tbETD.Trim() + "'";
}
if (tbCLOSINGDATE.Trim().IndexOf("0001")>-1 || tbCLOSINGDATE.Trim() == "")
{
tbCLOSINGDATE = "CLOSINGDATE=NULL";
}
else
{
tbCLOSINGDATE = "CLOSINGDATE='" + tbCLOSINGDATE.Trim() + "'";
}
if (tbCLOSEDOCDATE.Trim().IndexOf("0001")>-1 || tbCLOSEDOCDATE.Trim() == "")
{
tbCLOSEDOCDATE = "CLOSEDOCDATE=NULL";
}
else
{
tbCLOSEDOCDATE = "CLOSEDOCDATE='" + tbCLOSEDOCDATE.Trim() + "'";
}
str = String.Format(str, tbETD, tbCLOSINGDATE, tbCLOSEDOCDATE);
//
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
alt = "";
if (bl == false)
{
alt = "业务函电入货通知信息更新op_letter_yard操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新业务函电入货通知信息op_letter_yard','更新操作','" + str + "','" + strUserID + "')";
//bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
return alt;
}
/// <summary>
/// 返回所有 业务函电入货通知信息
/// </summary>
/// <returns></returns>
public DataSet GetTopLetterYard(string strLEID)
{
string str = "select * from op_letter_yard where LE_ID='" + strLEID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 业务函电更改通知信息插入
/// </summary>
/// <returns></returns>
public String GetTopLetterChangeInsert(string strLEID, string strBSNO, string tbTO, string tbATTN, string tbFM, string tbMBLNO, string tbPORTDISCHARGE, string tbVESSELVOYNO, string tbETD, string tbPKC, string tbCNTR, string tbProName, string tbProOld, string tbProNew, string tbREMARK,string strUserID)
{
string str = "insert into op_letter(LE_ID,BSNO,HEAD_TO,HEAD_ATTN,LETTERNAME,INPUTBY,INPUTTIME) values('" + strLEID + "','" + strBSNO + "','" + tbTO + "','" + tbATTN + "','更改通知','" + tbFM + "','" + DateTime.Today.Date + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "业务函电信息添加op_letter操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入业务函电信息表op_letter的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
//
str = "insert into op_letter_change(LE_ID,MBLNO,PORTDISCHARGE,VESSELVOYNO,ETD,PKC,CNTR,ProName,ProOld,ProNew,REMARK) values('" + strLEID + "','" + tbMBLNO + "','" + tbPORTDISCHARGE + "','" + tbVESSELVOYNO + "',{0},'" + tbPKC + "','" + tbCNTR + "','" + tbProName + "','" + tbProOld + "','" + tbProNew + "','" + tbREMARK + "')";
//
if (tbETD.Trim().IndexOf("0001")>-1 || tbETD.Trim() == "")
{
tbETD = "NULL";
}
else
{
tbETD = "'" + tbETD.Trim() + "'";
}
str = String.Format(str, tbETD);
//
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
alt = "";
if (bl == false)
{
string str3 = "delete from op_letter where LE_ID='" + strLEID + "' and BSNO='"+ strBSNO + "'";
bool bl3 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str3);
alt = "业务函电更改通知信息添加op_letter_change操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入业务函电更改通知信息表op_letter_change的信息','插入操作','" + str + "','" + strUserID + "')";
//bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
return alt;
}
/// <summary>
/// 返回所有 业务函电更改通知信息更新
/// </summary>
/// <returns></returns>
public String GetTopLetterChangeUpdate(string strLEID, string tbTO, string tbATTN, string tbFM, string tbMBLNO, string tbPORTDISCHARGE, string tbVESSELVOYNO, string tbETD, string tbPKC, string tbCNTR, string tbProName, string tbProOld, string tbProNew, string tbREMARK,string strUserID)
{
string str = "update op_letter set HEAD_TO='" + tbTO + "',HEAD_ATTN='" + tbATTN + "',UpdateTime='" + DateTime.Now + "' where LE_ID='" + strLEID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "业务函电信息更新op_letter操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新业务函电信息op_letter','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
//
str = "update op_letter_change set MBLNO='" + tbMBLNO + "',PORTDISCHARGE='" + tbPORTDISCHARGE + "',VESSELVOYNO='" + tbVESSELVOYNO + "',{0},PKC='" + tbPKC + "',CNTR='" + tbCNTR + "',ProName='" + tbProName + "',ProOld='" + tbProOld + "',ProNew='" + tbProNew + "',REMARK='" + tbREMARK + "' where LE_ID='" + strLEID + "'";
//
if (tbETD.Trim().IndexOf("0001")>-1 || tbETD.Trim() == "")
{
tbETD = "ETD=NULL";
}
else
{
tbETD = "ETD='" + tbETD.Trim() + "'";
}
str = String.Format(str, tbETD);
//
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
alt = "";
if (bl == false)
{
alt = "业务函电更改通知信息更新op_letter_change操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新业务函电更改通知信息op_letter_change','更新操作','" + str + "','" + strUserID + "')";
//bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
return alt;
}
/// <summary>
/// 返回所有 业务函电更改通知信息
/// </summary>
/// <returns></returns>
public DataSet GetTopLetterChange(string strLEID)
{
string str = "select * from op_letter_change where LE_ID='" + strLEID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 业务函电电放保函信息插入
/// </summary>
/// <returns></returns>
public String GetTopLetterSurInsert(string strLEID, string strBSNO, string tbTO, string tbATTN, string tbFM, string tbMBLNO, string tbPORTLOAD, string tbPORTDISCHARGE, string tbVESSELVOYNO, string tbCONSIGNEE, string tbREMARK,string strUserID)
{
string str = "insert into op_letter(LE_ID,BSNO,HEAD_TO,HEAD_ATTN,LETTERNAME,INPUTBY,INPUTTIME) values('" + strLEID + "','" + strBSNO + "','" + tbTO + "','" + tbATTN + "','电放保函','" + tbFM + "','" + DateTime.Today.Date + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "业务函电信息添加op_letter操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入业务函电信息表op_letter的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
//
str = "insert into op_letter_Sur(LE_ID,MBLNO,PORTLOAD,PORTDISCHARGE,VESSELVOYNO,CONSIGNEE,REMARK) values('" + strLEID + "','" + tbMBLNO + "','" + tbPORTLOAD + "','" + tbPORTDISCHARGE + "','" + tbVESSELVOYNO + "','" + tbCONSIGNEE + "','" + tbREMARK + "')";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
alt = "";
if (bl == false)
{
string str3 = "delete from op_letter where [LE_ID]='" + strLEID + "' and BSNO='" + strBSNO + "'";
bool bl3 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str3);
alt = "业务函电电放保函信息添加op_letter_Sur操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入业务函电电放保函信息表op_letter_Sur的信息','插入操作','" + str + "','" + strUserID + "')";
//bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
return alt;
}
/// <summary>
/// 返回所有 业务函电电放保函信息更新
/// </summary>
/// <returns></returns>
public String GetTopLetterSurUpdate(string strLEID, string tbTO, string tbATTN, string tbFM, string tbMBLNO, string tbPORTLOAD, string tbPORTDISCHARGE, string tbVESSELVOYNO, string tbCONSIGNEE, string tbREMARK,string strUserID)
{
string str = "update op_letter set HEAD_TO='" + tbTO + "',HEAD_ATTN='" + tbATTN + "',UpdateTime='" + DateTime.Now + "' where LE_ID='" + strLEID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "业务函电信息更新op_letter操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新业务函电信息op_letter','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
//
str = "update op_letter_Sur set MBLNO='" + tbMBLNO + "',PORTLOAD='" + tbPORTLOAD + "',PORTDISCHARGE='" + tbPORTDISCHARGE + "',VESSELVOYNO='" + tbVESSELVOYNO + "',CONSIGNEE='" + tbCONSIGNEE + "',REMARK='" + tbREMARK + "' where LE_ID='" + strLEID + "'";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
alt = "";
if (bl == false)
{
alt = "业务函电电放保函信息更新op_letter_Sur操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新业务函电电放保函信息op_letter_Sur','更新操作','" + str + "','" + strUserID + "')";
//bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
return alt;
}
/// <summary>
/// 返回所有 业务函电电放保函信息
/// </summary>
/// <returns></returns>
public DataSet GetTopLetterSur(string strLEID)
{
string str = "select * from op_letter_sur where LE_ID='" + strLEID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 业务函电派车通知信息插入
/// </summary>
/// <returns></returns>
public String GetTopLetterTruckInsert(string strLEID, string strBSNO, string tbTO, string tbATTN, string tbATTNFAX, string tbFM, string hd_comboTRUCK, string tbCTNS, string hd_comboYARD, string tbYARDATTN, string tbYARDTEL, string tbFACTRYATTN, string tbFACTRYTEL, string tbFACTRYADDR, string tbFACTRYTIME, string hd_comboRETURNYARD, string tbRETURNATTN, string tbRETURNTEL, string tbTRUCKFEE, string tbPAYTYPE, string tbREMARK, string tbCLOSINGDATE, string strUserID)
{
string str = "insert into op_letter(LE_ID,BSNO,HEAD_TO,HEAD_ATTN,HEAD_ATTNFAX,LETTERNAME,INPUTBY,INPUTTIME) values('" + strLEID + "','" + strBSNO + "','" + tbTO + "','" + tbATTN + "','" + tbATTNFAX + "','派车通知','" + tbFM + "','" + DateTime.Today.Date + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "业务函电信息添加op_letter操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入业务函电信息表op_letter的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
//
str = "insert into op_letter_truck(LE_ID,TRUCK, CTNS, YARD, YARDATTN, YARDTEL, FACTRYATTN, FACTRYTEL, FACTRYADDR,FACTRYTIME, RETURNYARD, RETURNATTN, RETURNTEL, TRUCKFEE, PAYTYPE, REMARK{1}) values('" + strLEID + "','" + hd_comboTRUCK + "','" + tbCTNS + "','" + hd_comboYARD + "','" + tbYARDATTN + "','" + tbYARDTEL + "','" + tbFACTRYATTN + "','" + tbFACTRYTEL + "','" + tbFACTRYADDR + "','" + tbFACTRYTIME + "','" + hd_comboRETURNYARD + "','" + tbRETURNATTN + "','" + tbRETURNTEL + "',{0},'" + tbPAYTYPE + "','" + tbREMARK + "'{2})";
//
if (tbTRUCKFEE.Trim() == "")
{
tbTRUCKFEE = "0";
}
else
{
tbTRUCKFEE = "'" + tbTRUCKFEE.Trim() + "'";
}
//
string strCLOSINGDATE = "";
if (tbCLOSINGDATE.Trim().IndexOf("0001")>-1 || tbCLOSINGDATE.Trim() == "")
{
strCLOSINGDATE = "";
tbCLOSINGDATE = "";
}
else
{
strCLOSINGDATE = ",CLOSINGDATE";
tbCLOSINGDATE = ",'" + tbCLOSINGDATE.Trim() + "'";
}
str = String.Format(str, tbTRUCKFEE,strCLOSINGDATE, tbCLOSINGDATE);
//
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
alt = "";
if (bl == false)
{
string str3 = "delete from op_letter where [LE_ID]='" + strLEID + "' and BSNO='" + strBSNO + "'";
bool bl3 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str3);
alt = "业务函电派车通知信息添加op_letter_truck操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入业务函电派车通知信息表op_letter_truck的信息','插入操作','" + str + "','" + strUserID + "')";
//bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
return alt;
}
/// <summary>
/// 返回所有 业务函电派车通知信息更新
/// </summary>
/// <returns></returns>
public String GetTopLetterTruckUpdate(string strLEID, string tbTO, string tbATTN, string tbATTNFAX, string tbFM, string hd_comboTRUCK, string tbCTNS, string hd_comboYARD, string tbYARDATTN, string tbYARDTEL, string tbFACTRYATTN, string tbFACTRYTEL, string tbFACTRYADDR, string tbFACTRYTIME, string hd_comboRETURNYARD, string tbRETURNATTN, string tbRETURNTEL, string tbTRUCKFEE, string tbPAYTYPE, string tbREMARK, string tbCLOSINGDATE, string strUserID)
{
string str = "update op_letter set HEAD_TO='" + tbTO + "',HEAD_ATTN='" + tbATTN + "',HEAD_ATTNFAX='" + tbATTNFAX + "',UpdateTime='" + DateTime.Now + "' where LE_ID='" + strLEID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "业务函电信息更新op_letter操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新业务函电信息op_letter','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
//
str = "update op_letter_truck set TRUCK='" + hd_comboTRUCK + "',CTNS='" + tbCTNS + "',YARD='" + hd_comboYARD + "',YARDATTN='" + tbYARDATTN + "',YARDTEL='" + tbYARDTEL + "',FACTRYATTN='" + tbFACTRYATTN + "',FACTRYTEL='" + tbFACTRYTEL + "',FACTRYADDR='" + tbFACTRYADDR + "',FACTRYTIME='" + tbFACTRYTIME + "',RETURNYARD='" + hd_comboRETURNYARD + "',RETURNATTN='" + tbRETURNATTN + "',RETURNTEL='" + tbRETURNTEL + "'{0},PAYTYPE='" + tbPAYTYPE + "',REMARK='" + tbREMARK + "'{1}";
//
if (tbTRUCKFEE.Trim() == "")
{
tbTRUCKFEE = ",TRUCKFEE=0";
}
else
{
tbTRUCKFEE = ",TRUCKFEE='" + tbTRUCKFEE.Trim() + "'";
}
//
if (tbCLOSINGDATE.Trim().IndexOf("0001")>-1 || tbCLOSINGDATE.Trim() == "")
{
tbCLOSINGDATE = "";
}
else
{
tbCLOSINGDATE = ",CLOSINGDATE='" + tbCLOSINGDATE.Trim() + "'";
}
str = String.Format(str, tbTRUCKFEE,tbCLOSINGDATE);
//
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
alt = "";
if (bl == false)
{
alt = "业务函电派车通知信息更新op_letter_truck操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新业务函电派车通知信息op_letter_truck','更新操作','" + str + "','" + strUserID + "')";
//bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
return alt;
}
/// <summary>
/// 返回所有 业务函电派车通知信息
/// </summary>
/// <returns></returns>
public DataSet GetTopLetterTruck(string strLEID)
{
string str = "select * from op_letter_truck where LE_ID='" + strLEID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 提单签发管理表op_blissue信息更新
/// </summary>
/// <returns></returns>
public String GetOpBlissueUpdate(string strSel,string strUserID)
{
string alt = "";
string str = "update op_blissue set " + strSel;
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "提单签发管理表op_blissue更新操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新提单签发管理表op_blissue','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 提单签发申请表op_blissuelist信息删除
/// </summary>
/// <returns></returns>
public String GetOpBlissuelistDel(string strSel,string strUserID)
{
string alt = "";
string str = "update op_blissuelist set DElFLAG=1 where BSNO='" + strSel + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "提单签发申请表op_blissuelist删除操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除提单签发申请表op_blissuelist','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
//
str = "update op_blissue set DElFLAG=1 where BSINKNO='" + strSel + "'";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "提单签发管理表op_blissue删除操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除提单签发管理表op_blissue','更新操作','" + str + "','" + strUserID + "')";
//bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
return alt;
}
/// <summary>
/// 返回所有 海运业务信息主表op_seae的签单方式信息更新
/// </summary>
/// <returns></returns>
public String GetOpSeaeUpdate(string strSel,string strUserID)
{
string str = "update op_seae set " + strSel;
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "海运业务信息主表op_seae的签单方式更新操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新海运业务信息主表op_seae的签单方式','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 生成 提单签发管理表op_blissuelist信息生成BSNO
/// </summary>
/// <returns></returns>
public String GetOpSeaeBSNOSel(string strOPNAME,string strBSNO)
{
string str = "";
string strBSINKNO = "";
int iMonth=DateTime.Today.Month;
string strMonth = "";
try
{
if(iMonth<10)
{
str = "select BSNO=max(BSNO) from op_blissuelist where BSNO like '" + DateTime.Today.Year + "0" + iMonth + "%'";
strMonth = "0"+iMonth.ToString();
}
else
{
str = "select BSNO=max(BSNO) from op_blissuelist where BSNO like '" + DateTime.Today.Year + iMonth + "%'";
strMonth = iMonth.ToString();
}
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0 && DS.Tables[0].Rows[0]["BSNO"].ToString().Trim()!="")
{
strBSINKNO = DS.Tables[0].Rows[0]["BSNO"].ToString().Trim();
int iBSINKNO = int.Parse(strBSINKNO.Trim().Substring(6)) + 1;
if (iBSINKNO.ToString().Length == 1)
{
strBSINKNO = strBSINKNO.Trim().Substring(0, 9) + iBSINKNO.ToString();
}
else if (iBSINKNO.ToString().Length == 2)
{
strBSINKNO = strBSINKNO.Trim().Substring(0, 8) + iBSINKNO.ToString();
}
else if (iBSINKNO.ToString().Length == 3)
{
strBSINKNO = strBSINKNO.Trim().Substring(0, 7) + iBSINKNO.ToString();
}
else if (iBSINKNO.ToString().Length == 4)
{
strBSINKNO = strBSINKNO.Trim().Substring(0, 6) + iBSINKNO.ToString();
}
}
else
{
strBSINKNO = DateTime.Today.Year.ToString() + strMonth + "0001";
}
//
str = "select * from op_seae where BSNO='" + strBSNO.Trim() + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
string strUserID = strOPNAME;
strOPNAME = GetSHOWNAME(strOPNAME);
str = "insert into op_blissuelist(BSNO,OPNAME,VESSEL,VOYNO) values('" + strBSINKNO.Trim() + "','" + strOPNAME.Trim() + "','" + DS.Tables[0].Rows[0]["VESSEL"].ToString().Trim() + "','" + DS.Tables[0].Rows[0]["VOYNO"].ToString().Trim() + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
//strBSINKNO = "提单签发申请表op_blissuelist插入操作出错";
strBSINKNO = "";
return strBSINKNO;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入提单签发申请表op_blissuelist的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
}
catch
{
//strBSINKNO = "提单签发申请表op_blissuelist插入操作出错";
strBSINKNO = "";
return strBSINKNO;
}
return strBSINKNO;
}
/// <summary>
/// 返回所有 提单签发管理表op_blissue信息插入
/// </summary>
/// <returns></returns>
public String GetOpBlissueInsert(string strOPNAME,string strBSINKNO,string strBSNO)
{
string alt = "";
bool bl=false;
string str = "select * from op_blissue where BSNO='" + strBSNO.Trim() + "' and BLSTATUS='申请提单'";//第二种 and BSINKNO='"+strBSINKNO.Trim()+"'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count > 0)
{
string blDElFLAG = DS.Tables[0].Rows[0]["DElFLAG"].ToString().Trim();
if (blDElFLAG == "True")
{
str = "select * from op_seae where BSNO='" + strBSNO.Trim() + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
string strUserID = strOPNAME;
strOPNAME = GetSHOWNAME(strOPNAME);
str = "update op_blissue set BSINKNO='" + strBSINKNO.Trim() + "',ISSUETYPE='" + DS.Tables[0].Rows[0]["ISSUETYPE"].ToString().Trim() + "',BLORDERNO='',REMARK='',DElFLAG=0 where BSNO='" + DS.Tables[0].Rows[0]["BSNO"].ToString().Trim() + "' and BLSTATUS='申请提单'";// and BSINKNO='" + strBSINKNO.Trim() + "'";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
//alt = "提单签发管理表op_blissue插入(删除回复)操作出错!";
alt = "1";//第二种
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新提单签发管理表op_blissue','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
}
else//第二种
{
alt = DS.Tables[0].Rows[0]["BLNO"].ToString().Trim();
return alt;
}
}
else
{
str = "select * from op_seae where BSNO='" + strBSNO.Trim() + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
string strUserID=strOPNAME;
strOPNAME = GetSHOWNAME(strOPNAME);
str = "insert into op_blissue(BSNO,BLNO,BLSTATUS,ISSUETYPE,OPNAME,BSINKNO) values('" + DS.Tables[0].Rows[0]["BSNO"].ToString().Trim() + "','" + DS.Tables[0].Rows[0]["MBLNO"].ToString().Trim() + "','申请提单','" + DS.Tables[0].Rows[0]["ISSUETYPE"].ToString().Trim() + "','" + strOPNAME.Trim() + "','" + strBSINKNO.Trim() + "')";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
//alt = "提单签发管理表op_blissue插入操作出错";
alt = "2";//第二种
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入提单签发管理表op_blissue的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
else
{
//alt = "提单签发管理表op_blissue插入操作出错";
alt = "2";//第二种
return alt;
}
}
}
catch
{
alt = "2";
}
return alt;
}
/// <summary>
/// 返回所有 提单签收表op_blissue信息插入
/// </summary>
/// <returns></returns>
public String GetOpBlissueSignInsert(string strOPNAME, string strBSNO, string strISSUETYPE)
{
string alt = "";
bool bl = false;
string str = "select * from op_blissue where BSNO='" + strBSNO.Trim() + "' and BLSTATUS='提单签收' and DElFLAG=0";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count > 0)
{
/*
string blDElFLAG = DS.Tables[0].Rows[0]["DElFLAG"].ToString().Trim();
if (blDElFLAG == "True")
{
str = "select * from op_seae where BSNO='" + strBSNO.Trim() + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
string strUserID=strOPNAME;
strOPNAME = GetSHOWNAME(strOPNAME);
str = "update op_blissue set BLNO='" + DS.Tables[0].Rows[0]["MBLNO"].ToString().Trim() + "',ISSUETYPE='" + DS.Tables[0].Rows[0]["ISSUETYPE"].ToString().Trim() + "',OPNAME='" + strOPNAME + "',OPTIME='" + DateTime.Today.Date.ToString() + "',DElFLAG=0 where BSNO='" + DS.Tables[0].Rows[0]["BSNO"].ToString().Trim() + "' and BLSTATUS='提单签收'";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
//alt = "提单签发管理表op_blissue插入(删除回复)操作出错!";
alt = "1";//第二种
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新提单签发管理表op_blissue','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
}
else//第二种
{
*/
alt = ",4,"+DS.Tables[0].Rows[0]["BLNO"].ToString().Trim();
return alt;
//}
}
else
{
str = "select * from op_seae where BSNO='" + strBSNO.Trim() + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
if (DS.Tables[0].Rows[0]["ISSUETYPE"].ToString().Trim() != strISSUETYPE.Trim())
{
//alt = "签单方式与委托业务不同";
alt = ",3," + DS.Tables[0].Rows[0]["MBLNO"].ToString().Trim();//第三种
return alt;
}
string strUserID = strOPNAME;
strOPNAME = GetSHOWNAME(strOPNAME);
str = "insert into op_blissue(BSNO,BLNO,BLSTATUS,ISSUETYPE,OPNAME) values('" + DS.Tables[0].Rows[0]["BSNO"].ToString().Trim() + "','" + DS.Tables[0].Rows[0]["MBLNO"].ToString().Trim() + "','提单签收','" + strISSUETYPE.Trim() + "','" + strOPNAME.Trim() + "')";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
//alt = "提单签发管理表op_blissue插入操作出错";
alt = "2";//第二种
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入提单签发管理表op_blissue的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
else
{
//alt = "提单签发管理表op_blissue插入操作出错";
alt = "2";//第二种
return alt;
}
}
}
catch
{
alt = "2";
}
return alt;
}
/// <summary>
/// 返回所有 提单签出表op_blissue信息插入
/// </summary>
/// <returns></returns>
public String GetOpBlissueCheckoutInsert(string strOPNAME, string strBSNO, string strEXPRESSCORP, string strEXPRESSNO)
{
string alt = "";
bool bl = false;
string strISSUETYPE = "";
string str = "select * from op_blissue where BSNO='" + strBSNO.Trim() + "' and BLSTATUS='提单签收' and DElFLAG=0";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count > 0)
{
strISSUETYPE = DS.Tables[0].Rows[0]["ISSUETYPE"].ToString().Trim();
str = "select * from op_blissue where BSNO='" + strBSNO.Trim() + "' and BLSTATUS='提单签出' and DElFLAG=0";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
/*
string blDElFLAG = DS.Tables[0].Rows[0]["DElFLAG"].ToString().Trim();
if (blDElFLAG == "True")
{
str = "select * from op_seae where BSNO='" + strBSNO.Trim() + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
string strUserID=strOPNAME;
strOPNAME = GetSHOWNAME(strOPNAME);
str = "update op_blissue set BLNO='" + DS.Tables[0].Rows[0]["MBLNO"].ToString().Trim() + "',ISSUETYPE='" + DS.Tables[0].Rows[0]["ISSUETYPE"].ToString().Trim() + "',OPNAME='" + strOPNAME + "',OPTIME='" + DateTime.Today.Date.ToString() + "',DElFLAG=0 where BSNO='" + DS.Tables[0].Rows[0]["BSNO"].ToString().Trim() + "' and BLSTATUS='提单签出'";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
//alt = "提单签发管理表op_blissue插入(删除回复)操作出错!";
alt = "1";//第二种
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新提单签发管理表op_blissue','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
}
else//第二种
{*/
alt = "4+"+DS.Tables[0].Rows[0]["BLNO"].ToString().Trim();
return alt;
//}
}
else
{
str = "select * from op_seae where BSNO='" + strBSNO.Trim() + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
string strUserID = strOPNAME;
strOPNAME = GetSHOWNAME(strOPNAME);
if (strISSUETYPE == "电放")
{
str = "insert into op_blissue(BSNO,BLNO,BLSTATUS,ISSUETYPE,OPNAME,EXPRESSCORP,EXPRESSNO) values('" + DS.Tables[0].Rows[0]["BSNO"].ToString().Trim() + "','" + DS.Tables[0].Rows[0]["MBLNO"].ToString().Trim() + "','提单签出','" + strISSUETYPE.Trim() + "','" + strOPNAME.Trim() + "','','')";
}
else
{
str = "insert into op_blissue(BSNO,BLNO,BLSTATUS,ISSUETYPE,OPNAME,EXPRESSCORP,EXPRESSNO) values('" + DS.Tables[0].Rows[0]["BSNO"].ToString().Trim() + "','" + DS.Tables[0].Rows[0]["MBLNO"].ToString().Trim() + "','提单签出','" + strISSUETYPE.Trim() + "','" + strOPNAME.Trim() + "','" + strEXPRESSCORP.Trim() + "','" + strEXPRESSNO.Trim() + "')";
}
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
//alt = "提单签发管理表op_blissue插入操作出错";
alt = "2";//第二种
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入提单签发管理表op_blissue的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
else
{
//alt = "提单签发管理表op_blissue插入操作出错";
alt = "2";//第二种
return alt;
}
}
}
else
{
alt = "3+"+DS.Tables[0].Rows[0]["BLNO"].ToString().Trim();
return alt;
}
}
catch
{
alt = "2";
}
return alt;
}
/// <summary>
/// 返回所有 提单电放出表op_blissue信息插入
/// </summary>
/// <returns></returns>
public String GetOpBlissueSurInsert(string strOPNAME, string strBSNO,string tbDate,string tbREMARK)
{
string alt = "";
bool bl = false;
string str = "select * from op_blissue where BSNO='" + strBSNO.Trim() + "' and BLSTATUS='提单电放'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count > 0)
{
string blDElFLAG = DS.Tables[0].Rows[0]["DElFLAG"].ToString().Trim();
if (blDElFLAG == "True")
{
str = "select * from op_seae where BSNO='" + strBSNO.Trim() + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
string strUserID=strOPNAME;
strOPNAME = GetSHOWNAME(strOPNAME);
str = "update op_blissue set BLNO='" + DS.Tables[0].Rows[0]["MBLNO"].ToString().Trim() + "',ISSUETYPE='" + DS.Tables[0].Rows[0]["ISSUETYPE"].ToString().Trim() + "',OPNAME='" + strOPNAME + "',OPTIME='" + tbDate + "',REMARK='" + tbREMARK + "',DElFLAG=0 where BSNO='" + DS.Tables[0].Rows[0]["BSNO"].ToString().Trim() + "' and BLSTATUS='提单电放'";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
//alt = "提单签发管理表op_blissue插入(删除回复)操作出错!";
alt = "1";//第二种
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新提单签发管理表op_blissue','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
}
else//第二种
{
alt = DS.Tables[0].Rows[0]["BLNO"].ToString().Trim();
if (alt == "")
{
alt = "3";
}
return alt;
}
}
else
{
str = "select * from op_seae where BSNO='" + strBSNO.Trim() + "'";
DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
string strUserID =strOPNAME;
strOPNAME = GetSHOWNAME(strOPNAME);
str = "insert into op_blissue(BSNO,BLNO,BLSTATUS,ISSUETYPE,OPNAME,OPTIME,REMARK) values('" + DS.Tables[0].Rows[0]["BSNO"].ToString().Trim() + "','" + DS.Tables[0].Rows[0]["MBLNO"].ToString().Trim() + "','提单电放','" + DS.Tables[0].Rows[0]["ISSUETYPE"].ToString().Trim() + "','" + strOPNAME.Trim() + "','" + tbDate + "','" + tbREMARK + "')";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
//alt = "提单签发管理表op_blissue插入操作出错";
alt = "2";//第二种
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入提单签发管理表op_blissue的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
}
else
{
//alt = "提单签发管理表op_blissue插入操作出错";
alt = "2";//第二种
return alt;
}
}
}
catch
{
alt = "2";
}
return alt;
}
/// <summary>
/// 返回往来单位管理表信息表info_client信息
/// </summary>
/// <returns></returns>
public DataSet GetInfoClient(string strGID)
{
string str = "select * from info_client where 1=1 " + strGID;
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回 往来单位管理表信息表info_client插入
/// </summary>
/// <returns></returns>
public String GetInfoClientInsert(bool cbISSTOP, string hdcomboSALE, string hdcomboOP, string hdcomboDOC, string tbCODENAME, string tbSHORTNAME, string tbDESCRIPTION, string tbNAME, string tbEnFullName, string tbTEL, string tbFAX, string tbADDR, string tbEMAIL, string tbWEB, string ddlCustomAttributes1, string ddlCustomAttributes2, bool cbISCARRIER, bool cbISCONTROLLER, bool cbISYARD, bool cbISCUSTOM, bool cbISSHIPPER, bool cbISCONSIGNEE, bool cbISBOOKING, bool cbISAIRLINES, bool cbISWAREHOUSE, bool cbISEXPRESS, bool cbISAGENTCN, bool cbISAGENT, bool cbISTRUCK, bool cbISWHARF, bool cbISSHIPPINGAGENT, bool cbISINSURE, bool cbISLEASING, string tbREMARK, string strUserID, string strLEVEL, string tbLOGINNAME, string tbLOGINPASSWORD,
string tbQQ, string tbMSN, string tbREGISTRATIONNO, string tbORDERNO, string tbUNITPRICE, bool cbISTRADINGAGENCY, bool cbISENTERP, bool cbISOTHER, string tbOTHERS, string tbCHIEF, string tbEDICODE)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strOPNAME = GetSHOWNAME(strUserID.Trim());
string str = "insert into info_client(ISSTOP,SALE,OP,DOC,CODENAME,SHORTNAME,DESCRIPTION,NAME,EnFullName,TEL,FAX,ADDR,EMAIL,WEB,CustomAttributes1,CustomAttributes2,ISCARRIER,ISCONTROLLER,ISYARD,ISCUSTOM,ISSHIPPER,ISCONSIGNEE,ISBOOKING,ISAIRLINES,ISWAREHOUSE,ISEXPRESS,ISAGENTCN,ISAGENT,ISTRUCK,ISWHARF,ISSHIPPINGAGENT,ISINSURE,ISLEASING,REMARK,CORPID,OPNAME,BillRises1,BillRises2,RMBBillRises,USDBillRises,[LEVEL],LOGINNAME,LOGINPASSWORD,QQ,MSN,REGISTRATIONNO,ORDERNO,UNITPRICE,ISTRADINGAGENCY,ISENTERP,ISOTHER,OTHERS,CHIEF,EDICODE) values('" + cbISSTOP + "','" + hdcomboSALE + "','" + hdcomboOP + "','" + hdcomboDOC + "','" + tbCODENAME + "','" + tbSHORTNAME + "','" + tbDESCRIPTION + "','" + tbNAME + "','" + tbEnFullName + "','" + tbTEL.Replace("--", "") + "','" + tbFAX.Replace("--", "") + "','" + tbADDR + "','" + tbEMAIL + "','" + tbWEB + "','" + ddlCustomAttributes1 + "','" + ddlCustomAttributes2 + "','" + cbISCARRIER + "','" + cbISCONTROLLER + "','" + cbISYARD + "','" + cbISCUSTOM + "','" + cbISSHIPPER + "','" + cbISCONSIGNEE + "','" + cbISBOOKING + "','" + cbISAIRLINES + "','" + cbISWAREHOUSE + "','" + cbISEXPRESS + "','" + cbISAGENTCN + "','" + cbISAGENT + "','" + cbISTRUCK + "','" + cbISWHARF + "','" + cbISSHIPPINGAGENT + "','" + cbISINSURE + "','" + cbISLEASING + "','" + tbREMARK + "','" + strCompany + "','" + strOPNAME + "','" + tbDESCRIPTION + "','" + tbDESCRIPTION + "','" + tbDESCRIPTION + "','" + tbDESCRIPTION + "','" + strLEVEL + "','" + tbLOGINNAME + "','" + tbLOGINPASSWORD + "','" + tbQQ + "','" + tbMSN + "','" + tbREGISTRATIONNO + "','" + tbORDERNO + "','" + tbUNITPRICE + "','" + cbISTRADINGAGENCY + "','" + cbISENTERP + "','" + cbISOTHER + "','" + tbOTHERS + "','" + tbCHIEF + "','" + tbEDICODE + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "往来单位管理信息表info_client插入操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入往来单位管理表info_client的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回 往来单位管理表信息表info_client更新
/// </summary>
/// <returns></returns>
public String GetInfoClientUpdate(string strGid, bool cbISSTOP, string hdcomboSALE, string hdcomboOP, string hdcomboDOC, string tbCODENAME, string tbSHORTNAME, string tbDESCRIPTION, string tbNAME, string tbEnFullName, string tbTEL, string tbFAX, string tbADDR, string tbEMAIL, string tbWEB, string ddlCustomAttributes1, string ddlCustomAttributes2, bool cbISCARRIER, bool cbISCONTROLLER, bool cbISYARD, bool cbISCUSTOM, bool cbISSHIPPER, bool cbISCONSIGNEE, bool cbISBOOKING, bool cbISAIRLINES, bool cbISWAREHOUSE, bool cbISEXPRESS, bool cbISAGENTCN, bool cbISAGENT, bool cbISTRUCK, bool cbISWHARF, bool cbISSHIPPINGAGENT, bool cbISINSURE, bool cbISLEASING, string tbREMARK, string strUserID, string hdRises, string strLEVEL, string tbLOGINNAME, string tbLOGINPASSWORD, string tbQQ, string tbMSN, string tbREGISTRATIONNO, string tbORDERNO, string tbUNITPRICE, bool cbISTRADINGAGENCY, bool cbISENTERP, bool cbISOTHER, string tbOTHERS, string tbCHIEF, string tbEDICODE)
{
string alt = "";
string str = "update info_client set ISSTOP='" + cbISSTOP + "',SALE='" + hdcomboSALE + "',OP='" + hdcomboOP + "',DOC='" + hdcomboDOC + "',CODENAME='" + tbCODENAME + "',SHORTNAME='" + tbSHORTNAME + "',DESCRIPTION='" + tbDESCRIPTION + "',NAME='" + tbNAME + "',EnFullName='" + tbEnFullName + "',TEL='" + tbTEL.Replace("--", "") + "',FAX='" + tbFAX.Replace("--", "") + "',ADDR='" + tbADDR + "',EMAIL='" + tbEMAIL + "',WEB='" + tbWEB + "',CustomAttributes1='" + ddlCustomAttributes1 + "',CustomAttributes2='" + ddlCustomAttributes2 + "',ISCARRIER='" + cbISCARRIER + "',ISCONTROLLER='" + cbISCONTROLLER + "',ISYARD='" + cbISYARD + "',ISCUSTOM='" + cbISCUSTOM + "',ISSHIPPER='" + cbISSHIPPER + "',ISCONSIGNEE='" + cbISCONSIGNEE + "',ISBOOKING='" + cbISBOOKING + "',ISAIRLINES='" + cbISAIRLINES + "',ISWAREHOUSE='" + cbISWAREHOUSE + "',ISEXPRESS='" + cbISEXPRESS + "',ISAGENTCN='" + cbISAGENTCN + "',ISAGENT='" + cbISAGENT + "',ISTRUCK='" + cbISTRUCK + "',ISWHARF='" + cbISWHARF + "',ISSHIPPINGAGENT='" + cbISSHIPPINGAGENT + "',ISINSURE='" + cbISINSURE + "',ISLEASING='" + cbISLEASING + "',REMARK='" + tbREMARK + "',[LEVEL]='" + strLEVEL + "',LOGINNAME='" + tbLOGINNAME + "',LOGINPASSWORD='" + tbLOGINPASSWORD + "',QQ='" + tbQQ + "',MSN='" + tbMSN + "',REGISTRATIONNO='" + tbREGISTRATIONNO + "',ORDERNO='" + tbORDERNO + "',UNITPRICE='" + tbUNITPRICE + "',MODIFIEDUSER='" + strUserID + "',ISTRADINGAGENCY='" + cbISTRADINGAGENCY + "',ISENTERP='" + cbISENTERP + "',ISOTHER='" + cbISOTHER + "',OTHERS='" + tbOTHERS + "',CHIEF='" + tbCHIEF + "',MODIFIEDTIME=getdate(),EDICODE='" + tbEDICODE + "' where Gid='" + strGid + "'";
if (hdRises.Trim().Equals("1"))
{
str = "update info_client set ISSTOP='" + cbISSTOP + "',SALE='" + hdcomboSALE + "',OP='" + hdcomboOP + "',DOC='" + hdcomboDOC + "',CODENAME='" + tbCODENAME + "',SHORTNAME='" + tbSHORTNAME + "',DESCRIPTION='" + tbDESCRIPTION + "',NAME='" + tbNAME + "',EnFullName='" + tbEnFullName + "',TEL='" + tbTEL.Replace("--", "") + "',FAX='" + tbFAX.Replace("--", "") + "',ADDR='" + tbADDR + "',EMAIL='" + tbEMAIL + "',WEB='" + tbWEB + "',CustomAttributes1='" + ddlCustomAttributes1 + "',CustomAttributes2='" + ddlCustomAttributes2 + "',ISCARRIER='" + cbISCARRIER + "',ISCONTROLLER='" + cbISCONTROLLER + "',ISYARD='" + cbISYARD + "',ISCUSTOM='" + cbISCUSTOM + "',ISSHIPPER='" + cbISSHIPPER + "',ISCONSIGNEE='" + cbISCONSIGNEE + "',ISBOOKING='" + cbISBOOKING + "',ISAIRLINES='" + cbISAIRLINES + "',ISWAREHOUSE='" + cbISWAREHOUSE + "',ISEXPRESS='" + cbISEXPRESS + "',ISAGENTCN='" + cbISAGENTCN + "',ISAGENT='" + cbISAGENT + "',ISTRUCK='" + cbISTRUCK + "',ISWHARF='" + cbISWHARF + "',ISSHIPPINGAGENT='" + cbISSHIPPINGAGENT + "',REMARK='" + tbREMARK + "',BillRises1='" + tbDESCRIPTION + "',BillRises2='" + tbDESCRIPTION + "',RMBBillRises='" + tbDESCRIPTION + "',USDBillRises='" + tbDESCRIPTION + "',[LEVEL]='" + strLEVEL + "',LOGINNAME='" + tbLOGINNAME + "',LOGINPASSWORD='" + tbLOGINPASSWORD + "',QQ='" + tbQQ + "',MSN='" + tbMSN + "',REGISTRATIONNO='" + tbREGISTRATIONNO + "',ORDERNO='" + tbORDERNO + "',UNITPRICE='" + tbUNITPRICE + "',MODIFIEDUSER='" + strUserID + "',ISTRADINGAGENCY='" + cbISTRADINGAGENCY + "',ISENTERP='" + cbISENTERP + "',ISOTHER='" + cbISOTHER + "',OTHERS='" + tbOTHERS + "',CHIEF='" + tbCHIEF + "',MODIFIEDTIME=getdate(),EDICODE='" + tbEDICODE + "' where Gid='" + strGid + "'";
}
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "往来单位管理表信息表info_client更新操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新往来单位管理表信息表info_client','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回 往来单位管理表信息表info_client删除
/// </summary>
/// <returns></returns>
public String GetInfoClientDel(string strGid, string strUserID)
{
string alt = "";
string str = "delete from info_client where 1=1 "+strGid;
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "往来单位管理表信息表info_client删除操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str1 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除往来单位管理表信息表info_client的信息','删除操作','" + str + "','" + strUserID + "')";
//bool bl1 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str1);
}
return alt;
}
/// <summary>
/// 返回 往来单位管理表信息表info_client财务更新
/// </summary>
/// <returns></returns>
public String GetInfoClientFinancialUpdate(string strGid, string tbBillRises1, string tbBillRises2, string tbRMBBank, string tbRMBOnlineNO, string tbRMBAccount, string tbUSDBank, string tbUSDOnlineNO, string tbUSDAccount, string tbRMBBillRises, string tbUSDBillRises, string tbFARCODE,string tbFAPCODE, string tbRMBMaxAmountCredit, string tbUSDMaxAmountCredit, string tbMaxAmountCredit, string ddlSTLNAME, string tbUSDExchangeRate, string tbSTLDATE, string tbSTLFIRSTHALFDATE, string tbSTLMIDDLEDATE,string tbSTLDATEPJ, string strUserID)
{
string alt = "";
string str = "update info_client set BillRises1='" + tbBillRises1 + "',TAXNO='" + tbBillRises2 + "',RMBBank='" + tbRMBBank + "',RMBOnlineNO='" + tbRMBOnlineNO + "',RMBAccount='" + tbRMBAccount + "',USDBank='" + tbUSDBank + "',USDOnlineNO='" + tbUSDOnlineNO + "',USDAccount='" + tbUSDAccount + "',RMBBillRises='" + tbRMBBillRises + "',USDBillRises='" + tbUSDBillRises + "',FARCODE='" + tbFARCODE + "',FAPCODE='" + tbFAPCODE + "',RMBMaxAmountCredit='" + tbRMBMaxAmountCredit + "',USDMaxAmountCredit='" + tbUSDMaxAmountCredit + "',MaxAmountCredit='" + tbMaxAmountCredit + "',STLNAME='" + ddlSTLNAME + "',USDExchangeRate='" + tbUSDExchangeRate + "',STLDATE='" + tbSTLDATE + "',STLFIRSTHALFDATE='" + tbSTLFIRSTHALFDATE + "',STLMIDDLEDATE='" + tbSTLMIDDLEDATE + "',STLDATEPJ='" + tbSTLDATEPJ + "' where Gid='" + strGid + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "往来单位管理表信息表info_client财务更新操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新往来单位管理表信息表info_client财务','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回90. 收发货人信息维护表
/// </summary>
/// <returns></returns>
public DataSet GetInfoShipper(string codename)
{
string str = "select *,shippertypeName=(case shippertype when 1 then '收货人' when 2 then '发货人' when 3 then '通知人' when 4 then '代理人' end) from info_shipper where codename='" + codename.Trim() + "' order by shipperID";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回90. 收发货人信息维护表
/// </summary>
/// <returns></returns>
public DataSet GetInfoShipperSQL(string strSQL)
{
string str = "select * from info_shipper where 1=1 " + strSQL;
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回 收发货人信息维护表info_shipper插入
/// </summary>
/// <returns></returns>
public String GetInfoShipperInsert(string strcodename, string tbshipperID, string tbSHORTNAME, int RadioButtonList1, string tbshipperdetail,string strUserID,string loadaddress,string deliveraddress,bool cbISPUBLIC)
{
string alt = "";
string str = "insert into info_shipper(codename,shipperID,SHORTNAME,shippertype,shipperdetail,LOADADDRESS,DELIVERADDRESS,ISPUBLIC) values('" + strcodename + "','" + tbshipperID + "','" + tbSHORTNAME + "'," + RadioButtonList1 + ",'" + tbshipperdetail + "','" + loadaddress + "','" + deliveraddress + "','" + cbISPUBLIC + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "收发货人信息维护表info_shipper插入操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入收发货人信息维护表info_shipper的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回 收发货人信息维护表info_shipper更新
/// </summary>
/// <returns></returns>
public String GetInfoShipperUpdate(string strcodename, string tbshipperID, string tbSHORTNAME, int RadioButtonList1, string tbshipperdetail, string tbshipperID2, string strUserID, string loadaddress, string deliveraddress, bool cbISPUBLIC)
{
string alt = "";
string str = "update info_shipper set shipperID='" + tbshipperID + "',SHORTNAME='" + tbSHORTNAME + "',shippertype='" + RadioButtonList1 + "',shipperdetail='" + tbshipperdetail + "',LOADADDRESS='" + loadaddress + "',DELIVERADDRESS='" + deliveraddress + "',ISPUBLIC='" + cbISPUBLIC + "' where codename='" + strcodename + "' and shipperID='" + tbshipperID2 + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "收发货人信息维护表info_shipper更新操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新收发货人信息维护表info_shipper','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回 收发货人信息维护表info_shipper删除
/// </summary>
/// <returns></returns>
public String GetInfoShipperDel(string strshipperID, string strUserID)
{
string alt = "";
string str = "delete from info_shipper where shipperID='" + strshipperID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "收发货人信息维护表info_shipper删除操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str1 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除收发货人信息维护表info_shipper的信息','删除操作','" + str + "','" + strUserID + "')";
//bool bl1 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str1);
}
return alt;
}
/// <summary>
/// 返回 行动表action
/// </summary>
/// <returns></returns>
public DataSet GetActionSQL(string strSQL)
{
string str = "select * from action where 1=1 and STATE=0 " + strSQL;
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
return DS;
}
/// <summary>
/// 返回所有 用户、行为关联表user_action信息插入
/// </summary>
/// <returns></returns>
public String GetUserActionInsert(string USERID,string ACTIONID, string strUserID)
{
string alt = "";
bool bl = false;
string str = "insert into user_action(ACTIONID,USERID,CREATEUSER,MODIFIEDUSER) values('" + ACTIONID + "','" + USERID + "','" + strUserID + "','" + strUserID + "')";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "用户、行为关联表user_action信息插入操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入用户、行为关联表user_action的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 用户、行为关联表user_action信息删除
/// </summary>
/// <returns></returns>
public String GetUserActionDel(string USERID, string strUserID)
{
string alt = "";
bool bl = false;
string str = "delete from user_action where USERID='" + USERID + "'";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "用户、行为关联表user_action信息删除操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除用户、行为关联表user_action的信息','删除操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回 客户联系人信息从表info_client_contact删除
/// </summary>
/// <returns></returns>
public String GetInfoClientContactDel(string strGid, string strUserID)
{
string alt = "";
string str = "update info_client_contact set ISDELETED=1 where Gid='" + strGid + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "客户联系人信息从表info_client_contact删除操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str1 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('删除客户联系人信息从表info_client_contact的信息','更新操作','" + str + "','" + strUserID + "')";
//bool bl1 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str1);
}
return alt;
}
/// <summary>
/// 返回 客户联系人信息从表info_client_contact插入
/// </summary>
/// <returns></returns>
public String GetInfoClientInsertContact(string strGID, string LINKID, bool cbISSTOP, bool cbISFINANCIALSTAFF, bool cbISOPERATOR, bool cbISSALEMAN, bool cbISOTHER, string tbCODENAME, string tbSHOWNAME, string tbTEL, string tbFAX, string tbMOBILE, string tbADDR, string tbEMAIL, string tbREMARK, string strUserID, string tbBIRTHDAY, string tbANNIVERSARY1, string tbAREMARK1, string tbANNIVERSARY2, string tbAREMARK2, bool cbBIRTHDAY, bool cbANNIVERSARY1, bool cbANNIVERSARY2, int iBIRTHDAYDAY, int iANNIVERSARYDAY1, int iANNIVERSARYDAY2, string tbJOB, string rblSEX, string tbAGE, string ddlMARRY, string tbCHILDREN, string tbHOBBIES)
{
string alt = "";
string str = "insert into info_client_contact(GID,LINKID,ISSTOP,ISFINANCIALSTAFF,ISOPERATOR,ISSALEMAN,ISOTHER,CODENAME,SHOWNAME,TEL,FAX,MOBILE,ADDR,EMAIL,REMARK,MODIFIEDUSER,CREATEUSER,BIRTHDAY,ANNIVERSARY1,AREMARK1,ANNIVERSARY2,AREMARK2,ISBIRTHDAY,ISANNIVERSARY1,ISANNIVERSARY2,BIRTHDAYDAY,ANNIVERSARYDAY1,ANNIVERSARYDAY2,JOB, SEX, AGE, MARRY, CHILDREN, HOBBIES) values('" + strGID + "','" + LINKID + "','" + cbISSTOP + "','" + cbISFINANCIALSTAFF + "','" + cbISOPERATOR + "','" + cbISSALEMAN + "','" + cbISOTHER + "','" + tbCODENAME + "','" + tbSHOWNAME + "','" + tbTEL + "','" + tbFAX + "','" + tbMOBILE + "','" + tbADDR + "','" + tbEMAIL + "','" + tbREMARK + "','" + strUserID + "','" + strUserID + "'";
if (tbBIRTHDAY.Trim() == "")
{
str += ",null";
}
else
{
str += ",'" + tbBIRTHDAY + "'";
}
if (tbANNIVERSARY1.Trim() == "")
{
str += ",null";
}
else
{
str += ",'" + tbANNIVERSARY1 + "'";
}
str += ",'" + tbAREMARK1 + "'";
if (tbANNIVERSARY2.Trim() == "")
{
str += ",null";
}
else
{
str += ",'" + tbANNIVERSARY2 + "'";
}
str += ",'" + tbAREMARK2 + "','" + cbBIRTHDAY + "','" + cbANNIVERSARY1 + "','" + cbANNIVERSARY2 + "'," + iBIRTHDAYDAY + "," + iANNIVERSARYDAY1 + "," + iANNIVERSARYDAY2 + ",'" + tbJOB + "','" + rblSEX + "','" + tbAGE + "','" + ddlMARRY + "','" + tbCHILDREN + "','" + tbHOBBIES + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "客户联系人信息从表info_client_contact插入操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入客户联系人信息从表info_client_contact的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回 客户联系人信息从表info_client_contact更新
/// </summary>
/// <returns></returns>
public String GetInfoClientUpdateContact(string LINKID, string strGid, bool cbISSTOP, bool cbISFINANCIALSTAFF, bool cbISOPERATOR, bool cbISSALEMAN, bool cbISOTHER, string tbCODENAME, string tbSHOWNAME, string tbTEL, string tbFAX, string tbMOBILE, string tbADDR, string tbEMAIL, string tbREMARK, string strUserID, string tbBIRTHDAY, string tbANNIVERSARY1, string tbAREMARK1, string tbANNIVERSARY2, string tbAREMARK2, bool cbBIRTHDAY, bool cbANNIVERSARY1, bool cbANNIVERSARY2, int iBIRTHDAYDAY, int iANNIVERSARYDAY1, int iANNIVERSARYDAY2, string tbJOB, string rblSEX, string tbAGE, string ddlMARRY, string tbCHILDREN, string tbHOBBIES)
{
string alt = "";
string str = "update info_client_contact set ISSTOP='" + cbISSTOP + "',ISFINANCIALSTAFF='" + cbISFINANCIALSTAFF + "',ISOPERATOR='" + cbISOPERATOR + "',ISSALEMAN='" + cbISSALEMAN + "',ISOTHER='" + cbISOTHER + "',CODENAME='" + tbCODENAME + "',SHOWNAME='" + tbSHOWNAME + "',TEL='" + tbTEL + "',FAX='" + tbFAX + "',MOBILE='" + tbMOBILE + "',ADDR='" + tbADDR + "',EMAIL='" + tbEMAIL + "',MODIFIEDTIME=getdate(),REMARK='" + tbREMARK + "',MODIFIEDUSER='" + strUserID + "'";
if (tbBIRTHDAY.Trim() != "")
{
str += ",BIRTHDAY='" + tbBIRTHDAY + "'";
}
if (tbANNIVERSARY1.Trim() != "")
{
str += ",ANNIVERSARY1='" + tbANNIVERSARY1 + "'";
}
if (tbAREMARK1.Trim() != "")
{
str += ",AREMARK1='" + tbAREMARK1 + "'";
}
if (tbANNIVERSARY2.Trim() != "")
{
str += ",ANNIVERSARY2='" + tbANNIVERSARY2 + "'";
}
if (tbAREMARK2.Trim() != "")
{
str += ",AREMARK2='" + tbAREMARK2 + "'";
}
str += ",ISBIRTHDAY='" + cbBIRTHDAY + "',ISANNIVERSARY1='" + cbANNIVERSARY1 + "',ISANNIVERSARY2='" + cbANNIVERSARY2 + "',BIRTHDAYDAY=" + iBIRTHDAYDAY + ",ANNIVERSARYDAY1=" + iANNIVERSARYDAY1 + ",ANNIVERSARYDAY2=" + iANNIVERSARYDAY2 + ",JOB='" + tbJOB + "', SEX='" + rblSEX + "', AGE='" + tbAGE + "', MARRY='" + ddlMARRY + "', CHILDREN='" + tbCHILDREN + "', HOBBIES='" + tbHOBBIES + "'";
str += " where Gid='" + strGid + "' and LINKID='" + LINKID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "客户联系人信息从表info_client_contact更新操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新客户联系人信息从表info_client_contact','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 编码规则设置信息插入
/// </summary>
/// <returns></returns>
public String GetCodeRuleInsert(string ddlRULENAME, string tbRULECONTENT, string ddlRULEDATE, string ddlRULEYEAR, string tbRULENOLENGTH, bool cbISSTARTUSING, bool cbISALLOWEDITS, bool cbISCLEAREDINEARLY, bool cbISCOMPANY, bool cbISDEPT, string strUserID, int iRULETYPE, string tbRULENOSTART)
{
string str = "insert into code_rule(RULENAME,RULECONTENT,RULEDATE,RULEYEAR,RULENOLENGTH,ISSTARTUSING,ISALLOWEDITS,ISCLEAREDINEARLY,ISCOMPANY,ISDEPT,CREATEUSER,MODIFIEDUSER,RULETYPE,RULENOSTART,CREATETIME,MODIFIEDTIME) values('" + ddlRULENAME + "','" + tbRULECONTENT + "','" + ddlRULEDATE + "','" + ddlRULEYEAR + "','" + tbRULENOLENGTH + "','" + cbISSTARTUSING + "','" + cbISALLOWEDITS + "','" + cbISCLEAREDINEARLY + "','" + cbISCOMPANY + "','" + cbISDEPT + "','" + strUserID + "','" + strUserID + "'," + iRULETYPE + ",'" + tbRULENOSTART + "',getdate(),getdate())";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "编码规则设置插入code_rule操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('编码规则设置表code_rule的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 编码规则设置信息更新
/// </summary>
/// <returns></returns>
public String GetCodeRuleUpdate(string hdGID, string ddlRULENAME, string tbRULECONTENT, string ddlRULEDATE, string ddlRULEYEAR, string tbRULENOLENGTH, bool cbISSTARTUSING, bool cbISALLOWEDITS, bool cbISCLEAREDINEARLY, bool cbISCOMPANY, bool cbISDEPT, string strUserID, int iRULETYPE, string tbRULENOSTART)
{
string str = "update code_rule set RULENAME='" + ddlRULENAME + "',RULECONTENT='" + tbRULECONTENT + "',RULEDATE='" + ddlRULEDATE + "',RULEYEAR='" + ddlRULEYEAR + "',RULENOLENGTH='" + tbRULENOLENGTH + "',ISSTARTUSING='" + cbISSTARTUSING + "',ISALLOWEDITS='" + cbISALLOWEDITS + "',ISCLEAREDINEARLY='" + cbISCLEAREDINEARLY + "',ISCOMPANY='" + cbISCOMPANY + "',ISDEPT='" + cbISDEPT + "',MODIFIEDUSER='" + strUserID + "',MODIFIEDTIME=getdate(),RULETYPE=" + iRULETYPE + ",RULENOSTART='" + tbRULENOSTART + "' where GID='" + hdGID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "编码规则设置更新code_rule操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('编码规则设置code_rule','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 分公司海运出口默认值插入
/// </summary>
/// <returns></returns>
public String GetSubcompSeaeDefInsert(string hd_comboSubCompanyID, string hd_comboPORTLOADID, string hd_comboPORTLOAD, string hd_comboBLFRT, string hd_comboSERVICE, string strUserID, string kgs, bool ISCGOL, bool ISADVANCE)
{
string str = "insert into subcomp_seae_def(CORPID,PORTLOADID,PORTLOAD,BLFRT,SERVICE,KGS,ISCGOL,ISADVANCE) values('" + hd_comboSubCompanyID + "','" + hd_comboPORTLOADID + "','" + hd_comboPORTLOAD + "','" + hd_comboBLFRT + "','" + hd_comboSERVICE + "','" + kgs.Trim() + "','" + ISCGOL + "','" + ISADVANCE + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "分公司海运出口默认值插入subcomp_seae_def操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('分公司海运出口默认值subcomp_seae_def的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回所有 分公司海运出口默认值更新
/// </summary>
/// <returns></returns>
public String GetSubcompSeaeDefUpdate(string strGID, string hd_comboSubCompanyID, string hd_comboPORTLOADID, string hd_comboPORTLOAD, string hd_comboBLFRT, string hd_comboSERVICE, string strUserID, string kgs, bool ISCGOL, bool ISADVANCE)
{
string str = "update subcomp_seae_def set PORTLOADID='" + hd_comboPORTLOADID + "',PORTLOAD='" + hd_comboPORTLOAD + "',BLFRT='" + hd_comboBLFRT + "',SERVICE='" + hd_comboSERVICE + "',KGS='" + kgs.Trim() + "',ISCGOL='" + ISCGOL + "',ISADVANCE='" + ISADVANCE + "' where GID='" + strGID + "' and CORPID='" + hd_comboSubCompanyID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "分公司海运出口默认值更新subcomp_seae_def操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('分公司海运出口默认值设置subcomp_seae_def','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 插入权限范围
/// </summary>
/// <returns></returns>
public String GetUserAuthorityRangeInsert(string USERID, string AUTHORITYID, string VISIBLERANGE, string OPERATERANGE, string strUserID)
{
string str = "insert into user_authority_range(USERID,AUTHORITYID,VISIBLERANGE,OPERATERANGE,CREATEUSER,MODIFIEDUSER) values('" + USERID + "','" + AUTHORITYID + "','" + VISIBLERANGE + "','" + OPERATERANGE + "','" + strUserID + "','" + strUserID + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "插入权限范围user_authority_range操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入权限范围user_authority_range的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 权限范围更新
/// </summary>
/// <returns></returns>
public String GetUserAuthorityRangeUpdate(string USERID, string AUTHORITYID, string VISIBLERANGE, string OPERATERANGE, string strUserID)
{
string str = "update user_authority_range set VISIBLERANGE='" + VISIBLERANGE + "',OPERATERANGE='" + OPERATERANGE + "',MODIFIEDUSER='" + strUserID + "',MODIFIEDTIME=getdate() where USERID='" + USERID + "' and AUTHORITYID='" + AUTHORITYID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "权限范围更新user_authority_range操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('权限范围更新user_authority_range','更新操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 海关报关信息查看
/// </summary>
/// <returns></returns>
public String GetOpMsgBgInsert(string BSNO, string MBLNO, string VESSEL, string VOYNO, string CUSTOMNO, int RELEASEPKGS, DateTime RELEASEDATE, Decimal NET, Decimal KGS, DateTime IMPORTTIME, string SEAETYPE, string DISPORTTYPE, string strUserID)
{
string str = "delete from op_msg_bg where BSNO='" + BSNO + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
//
str = "insert into op_msg_bg(BSNO,MBLNO,VESSEL,VOYNO,CUSTOMNO,RELEASEPKGS,RELEASEDATE,NET,KGS,IMPORTTIME,SEAETYPE,DISPORTTYPE,CREATEUSER) values('" + BSNO + "','" + MBLNO + "','" + VESSEL + "','" + VOYNO + "','" + CUSTOMNO + "','" + RELEASEPKGS + "','" + RELEASEDATE + "','" + NET + "','" + KGS + "','" + IMPORTTIME + "','" + SEAETYPE + "','" + DISPORTTYPE + "','" + strUserID + "')";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "海关报关信息查看op_msg_bg操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('海关报关信息查看op_msg_bg的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 海关运抵报告查看
/// </summary>
/// <returns></returns>
public String GetOpMsgYdbgInsert(string BSNO, string MBLNO, string HBLNO, string VESSEL, string VOYNO, string CNTNO, DateTime DATEOFENTRY, DateTime SENDDATE, DateTime RECEIPTDATE, string RECEIPTTYPE, string RECEIPTINFO, string DISPORTTYPE, string strUserID)
{
string str = "delete from op_msg_ydbg where BSNO='" + BSNO + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
//
str = "insert into op_msg_ydbg(BSNO,MBLNO,HBLNO,VESSEL,VOYNO,CNTNO,DATEOFENTRY,SENDDATE,RECEIPTDATE,RECEIPTTYPE,RECEIPTINFO,DISPORTTYPE,CREATEUSER) values('" + BSNO + "','" + MBLNO + "','" + HBLNO + "','" + VESSEL + "','" + VOYNO + "','" + CNTNO + "','" + DATEOFENTRY + "','" + SENDDATE + "','" + RECEIPTDATE + "','" + RECEIPTTYPE + "','" + RECEIPTINFO + "','" + DISPORTTYPE + "','" + strUserID + "')";
bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
string alt = "";
if (bl == false)
{
alt = "海关运抵报告查看op_msg_ydbg操作出错";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('海关运抵报告查看op_msg_ydbg的信息','插入操作','" + str + "','" + strUserID + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 插入客户运价查询日志
/// </summary>
/// <returns></returns>
public bool GetEBPricequeryListLOG(string strSel, string strUserID, string strCORPID)
{
string strSQL = "insert into [crm_price_carrier_log](PODLOAD,PORTDISCHARGE,CARRIER,LANE,DESTINATION,TYPE,CREATEUSER,LOGTIME,CORPID) values(" + strSel + " ,'" + strUserID + "',getdate(),'"+strCORPID.Trim()+"')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, strSQL);
return bl;
}
/// <summary>
/// 返回 往来单位运价查看注册登记
/// </summary>
/// <returns></returns>
public String GetClientSignInInsert(string tbLOGINNAME,string tbLOGINPASSWORD,string tbDESCRIPTION,string tbEMAIL,string tbTEL,string tbADDR,string tbMSN,string tbQQ,string tbSALE)
{
string alt = "";
//
DataSet DS = GetAllSQL("select * from eb_custreg where loginname='" + tbLOGINNAME + "' and ISAUDIT=0");
if (DS != null)
{
if (DS.Tables[0].Rows.Count > 0)
{
alt = "此信息已注册,请等待审核!";
return alt;
}
}
//
string str = "insert into eb_custreg(CLIENTGID,LOGINNAME,LOGINPASSWORD,DESCRIPTION,EMAIL,TEL,ADDR,MSN,QQ,SALE,AUDITOPERATOR,CREATEUSER,MODIFIEDUSER) values('','" + tbLOGINNAME + "','" + tbLOGINPASSWORD + "','" + tbDESCRIPTION + "','" + tbEMAIL + "','" + tbTEL + "','" + tbADDR + "','" + tbMSN + "','" + tbQQ + "','" + tbSALE + "','','" + tbLOGINNAME + "','" + tbLOGINNAME + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "注册登记出错!";// "往来单位运价查看注册登记表插入操作出错!";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入往来单位运价查看注册登记表的信息','插入操作','" + str + "','" + tbDESCRIPTION + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回 往来单位运价查看注册登记更新
/// </summary>
/// <returns></returns>
public String GetClientSignInUpdate(string strGid,string hdCLIENTGID, string tbLOGINNAME, string tbLOGINPASSWORD, string tbDESCRIPTION, string tbEMAIL, string tbTEL, string tbADDR, string tbMSN, string tbQQ, string tbSALE)
{
string alt = "";
string str = "update eb_custreg set LOGINNAME='" + tbLOGINNAME + "',LOGINPASSWORD='" + tbLOGINPASSWORD + "',DESCRIPTION='" + tbDESCRIPTION + "',EMAIL='" + tbEMAIL + "',TEL='" + tbTEL + "',ADDR='" + tbADDR + "',MSN='" + tbMSN + "',QQ='" + tbQQ + "',SALE='" + tbSALE + "',MODIFIEDUSER='" + tbLOGINNAME + "',MODIFIEDTIME=getdate() where Gid='" + strGid + "' and CLIENTGID='" + hdCLIENTGID + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "往来单位运价查看注册登记更新操作出错!";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新往来单位运价查看注册登记','更新操作','" + str + "','" + tbDESCRIPTION + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回 放单申请插入
/// </summary>
/// <returns></returns>
public String GetBlissueSurPutSingleInsert(string strGid, string strBSNO, string tbBLNO, string tbPUTSINGLETIME, string tbPUTSINGLE, string tbPAYTIME,string hdISSUETYPE, string strUserID,string tbPAYRMB,string tbPAYUSD)
{
string alt = "";
string sname = GetSHOWNAME(strUserID);
string strPUTSINGLE = tbPUTSINGLE.Trim().Replace("'", "");
Decimal iPAYRMB = 0;
if (tbPAYRMB.Trim() != "")
{
iPAYRMB=Decimal.Parse(tbPAYRMB.Trim());
}
Decimal iPAYUSD = 0;
if (tbPAYUSD.Trim() != "")
{
iPAYUSD=Decimal.Parse(tbPAYUSD.Trim());
}
//
string str = "insert into op_blissue(ID,BSNO,BLNO,PUTSINGLETIME,PUTSINGLE,PAYTIME,ISSUETYPE,OPNAME,OPTIME,BLSTATUS,PAYRMB,PAYUSD) values('" + strGid + "','" + strBSNO + "','" + tbBLNO + "','" + tbPUTSINGLETIME + "','" + strPUTSINGLE + "','" + tbPAYTIME + "','" + hdISSUETYPE + "','" + sname + "',getdate(),'放单申请','" + iPAYRMB + "','" + iPAYUSD + "')";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "放单申请插入操作出错!";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('插入放单申请','插入操作','" + str + "','" + tbDESCRIPTION + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 返回 放单申请更新
/// </summary>
/// <returns></returns>
public String GetBlissueSurPutSingleUpdate(string strGid, string tbPUTSINGLETIME, string tbPUTSINGLE, string tbPAYTIME, string hdISSUETYPE, string strUserID, string tbPAYRMB, string tbPAYUSD)
{
string alt = "";
string sname = GetSHOWNAME(strUserID);
string strPUTSINGLE = tbPUTSINGLE.Trim().Replace("'", "");
Decimal iPAYRMB = 0;
if (tbPAYRMB.Trim() != "")
{
iPAYRMB = Decimal.Parse(tbPAYRMB.Trim());
}
Decimal iPAYUSD = 0;
if (tbPAYUSD.Trim() != "")
{
iPAYUSD = Decimal.Parse(tbPAYUSD.Trim());
}
//
string str = "update op_blissue set PUTSINGLETIME='" + tbPUTSINGLETIME + "',PUTSINGLE='" + strPUTSINGLE + "',PAYTIME='" + tbPAYTIME + "',OPNAME='" + sname + "',ISSUETYPE='" + hdISSUETYPE + "',OPTIME=getdate(),PAYRMB='" + iPAYRMB + "',PAYUSD='" + iPAYUSD + "' where id='" + strGid + "'";
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str);
if (bl == false)
{
alt = "放单申请更新操作出错!";
return alt;
}
else
{
//str = str.Trim().Replace("'", "''");
//string str0 = "insert into sys_log(NAME,LOGTYPE,LOGCONTENT,CREATEUSER) values('更新放单申请','更新操作','" + str + "','" + tbDESCRIPTION + "')";
//bool bl0 = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, str0);
}
return alt;
}
/// <summary>
/// 提取规则编号
/// </summary>
/// <param name="strRULENAME">规则项目名称</param>
/// <param name="strfield">需要加规则的字段</param>
/// <param name="strETD">开船日期</param>
/// <param name="strACCDATE">会计期间</param>
/// <param name="strUserID">用户gid</param>
/// <returns></returns>
protected String getCodeRule(string strRULENAME, string strfield, string strETD, string strACCDATE, string strUserID, int iRULETYPE, string strCompanyID)
{
//调用编码规则
string strRULEYEAR = "";
string strRULECONTENT = "";
string strCODENAME = "";
string strDEPTNO = "";
string strRULENOLENGTH = "";
int iRULENOLENGTH = 0;
int inum = 0;
string strCONTENT = "";
DataSet ds = GetAllSQL("select * from code_rule where RULENAME='" + strRULENAME.Trim() + "' and RULETYPE=" + iRULETYPE);
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 (strETD.Trim() == "")
{
return "";
}
DateTime dETD = System.Convert.ToDateTime(strETD.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 (strACCDATE.Trim() == "")
{
return "";
}
DateTime dACCDATE = System.Convert.ToDateTime(strACCDATE.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(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 = GetStrSQL("CODENAME", "select CODENAME from [company] where GID=(select top 1 COMPANYID from user_company where USERID='" + strUserID.Trim() + "')");
}
if (ds.Tables[0].Rows[0]["ISDEPT"].ToString().Trim().Equals("True"))
{
strDEPTNO = GetStrSQL("DEPTNO", "select DEPTNO from [sys_dept] where LINKID=(select top 1 COMPANYID from user_company where USERID='" + strUserID.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 = GetStrSQL("BANKSHEAD", "SELECT TOP 1 BANKSHEAD FROM company WHERE GID='" + strCompanyID.Trim() + "'");
strCONTENT = tempBANKSHEAD + strCONTENT;
//
strRULENOLENGTH = 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 "";
}
/// <summary>
/// 保存客户的共享信息
/// </summary>
/// <returns></returns>
public int GetInfoClientShareSave(string sClientid,string sCompanyid,string strUserID)
{
int iResult = 0;
string str = "";
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
str = "select top 1 * from info_client_share where clientid = '" + sClientid + "' and Companyid = '" + sCompanyid + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
//
if (DS == null)
{
string sbl = GetStrSQL("gid", "select top 1 gid from info_client where gid = '" + sClientid + "' and CORPID = '" + sCompanyid + "'");
//
if (sbl == "")
{
str = "insert into info_client_share(CLIENTID,COMPANYID,ISMASTER,ISSHARE,CREATEUSER) values('" + sClientid + "','" + sCompanyid + "','False','True','" + strUserID + "')";
}
else
{
str = "insert into info_client_share(CLIENTID,COMPANYID,ISMASTER,ISSHARE,CREATEUSER) values('" + sClientid + "','" + sCompanyid + "','True','True','" + strUserID + "')";
}
}
else
{
string sshare = DS.Tables[0].Rows[0]["ISSHARE"].ToString().Trim();
if (sshare.Trim() == "True")
{
str = "update info_client_share set ISSHARE='False',MODIFIEDUSER='" + strUserID + "',MODIFIEDTIME=getdate() where clientid = '" + sClientid + "' and Companyid = '" + sCompanyid + "'";
}
else
{
str = "update info_client_share set ISSHARE='True',CREATEUSER='" + strUserID + "',CREATETIME=getdate() where clientid = '" + sClientid + "' and Companyid = '" + sCompanyid + "'";
}
}
iResult = -3;//
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
//事务提交
sqlTran.Commit();
iResult = 1;//状态为1表示插入成功
}
catch (Exception)
{
iResult = -1;//有异常,插入失败
sqlTran.Rollback();
iResult = -2;//插入异常,事务已回滚成功
//throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
return iResult;
}
/// <summary>
/// 返回 某客户共享分公司
/// </summary>
/// <returns></returns>
public string GetISCompanyid(string strClientid)
{
string alt = "";
string strSQL = "select * from info_client_share where clientid = '" + strClientid + "' and ISSHARE=1";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, strSQL);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
//
if (DS != null)
{
foreach (DataTable myTable in DS.Tables)
{
foreach (DataRow myRow in myTable.Rows)//遍历表
{
alt += "," + myRow["COMPANYID"].ToString().Trim()+"#comp";
}
}
}
//
if (alt.Trim() != "")
{
alt = alt.Trim().Substring(1);
}
return alt.Trim();
}
/// <summary>
/// 判断往来单位是否使用
/// </summary>
/// <returns></returns>
public string GetBeing(string strClientID)
{
string alt = "";
//获取参数
SqlParameter[] parms = new SqlParameter[]
{
new SqlParameter("@GID",SqlDbType.VarChar,36),
new SqlParameter("@CODENAME",SqlDbType.VarChar,20),
new SqlParameter("@SHORTNAME",SqlDbType.VarChar,20),
new SqlParameter("@DESCRIPTION",SqlDbType.VarChar,50),
};
//
string strSQL = "select * from info_client where gid = '" + strClientID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, strSQL);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
//
if (DS != null)
{
foreach (DataTable myTable in DS.Tables)
{
foreach (DataRow myRow in myTable.Rows)//遍历表
{
parms[0].Value = strClientID;// 惟一值
parms[1].Value = myRow["CODENAME"].ToString();// 客户代码
parms[2].Value = myRow["SHORTNAME"].ToString();// 客户简称
parms[3].Value = myRow["DESCRIPTION"].ToString();//客户中文名称或描述信息
}
}
//
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int iResult = SqlHelper.ExecuteSqlStoredProcedureReturn(conn, "proc_isClientBeing", parms);
if (iResult == 1)
{
alt = "在相关业务模块中已经引用,禁止删除此数据!";
}
else if (iResult<0)
{
alt = "删除失败!";
}
else
{
alt = "";
}
}
}
return alt.Trim();
}
/// <summary>
/// 判断航线是否使用
/// </summary>
/// <returns></returns>
public string GetBeingLane(string strLaneID)
{
string alt = "";
//获取参数
SqlParameter[] parms = new SqlParameter[]
{
new SqlParameter("@GID",SqlDbType.VarChar,36),
new SqlParameter("@LANE",SqlDbType.VarChar,20),
};
//
string strSQL = "select * from code_lanes where gid = '" + strLaneID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, strSQL);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
//
if (DS != null)
{
foreach (DataTable myTable in DS.Tables)
{
foreach (DataRow myRow in myTable.Rows)//遍历表
{
parms[0].Value = strLaneID;// 惟一值
parms[1].Value = myRow["LANE"].ToString().Trim();// 名称
}
}
//
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int iResult = SqlHelper.ExecuteSqlStoredProcedureReturn(conn, "proc_isLaneBeing", parms);
if (iResult == 1)
{
alt = "在相关业务模块中已经引用,禁止删除此数据!";
}
else if (iResult < 0)
{
alt = "删除失败!";
}
else
{
alt = "";
}
}
}
return alt.Trim();
}
/// <summary>
/// 判断人员是否使用
/// </summary>
/// <returns></returns>
public string GetBeingUser(string strUserID)
{
string alt = "";
//获取参数
SqlParameter[] parms = new SqlParameter[]
{
new SqlParameter("@GID",SqlDbType.VarChar,36),
new SqlParameter("@CODENAME",SqlDbType.VarChar,20),//用户代码名
new SqlParameter("@SHOWNAME",SqlDbType.VarChar,50),//显示用户名
};
//
string strSQL = "select * from [user] where gid = '" + strUserID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, strSQL);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
//
if (DS != null)
{
foreach (DataTable myTable in DS.Tables)
{
foreach (DataRow myRow in myTable.Rows)//遍历表
{
parms[0].Value = strUserID;// 惟一值
parms[1].Value = myRow["CODENAME"].ToString().Trim();// 用户代码名
parms[2].Value = myRow["SHOWNAME"].ToString().Trim();// 显示用户名
}
}
//
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int iResult = SqlHelper.ExecuteSqlStoredProcedureReturn(conn, "proc_isUserBeing", parms);
if (iResult == 1)
{
//alt = "在相关业务模块中已经引用,禁止删除此数据!";
alt = parms[2].Value.ToString().Trim() + "、";
}
else if (iResult < 0)
{
alt = "删除失败!";
}
else
{
alt = "";
}
}
}
return alt.Trim();
}
/// <summary>
/// 判断费用是否使用
/// </summary>
/// <returns></returns>
public string GetBeingCodeFee(string strUserID)
{
string alt = "";
//获取参数
SqlParameter[] parms = new SqlParameter[]
{
new SqlParameter("@GID",SqlDbType.VarChar,36),
new SqlParameter("@FEECODE",SqlDbType.VarChar,20),//费用代码,
new SqlParameter("@NAME",SqlDbType.VarChar,50),//费用中文名称,
new SqlParameter("@DESCRIPTION",SqlDbType.VarChar,50)//费用英文名称
};
//
string strSQL = "select * from [code_fee] where gid = '" + strUserID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, strSQL);
try
{
if (DS.Tables[0].Rows.Count <= 0)
{
DS = null;
}
}
catch
{
DS = null;
}
//
if (DS != null)
{
foreach (DataTable myTable in DS.Tables)
{
foreach (DataRow myRow in myTable.Rows)//遍历表
{
parms[0].Value = strUserID;// 惟一值
parms[1].Value = myRow["FEECODE"].ToString().Trim();// 费用代码
parms[2].Value = myRow["NAME"].ToString().Trim();// 费用中文名称
parms[3].Value = myRow["DESCRIPTION"].ToString().Trim();// 费用英文名称
}
}
//
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int iResult = SqlHelper.ExecuteSqlStoredProcedureReturn(conn, "proc_isCodeFeeBeing", parms);
if (iResult == 1)
{
alt = "在相关业务模块中已经引用,禁止删除此数据!";
}
else if (iResult < 0)
{
alt = "删除失败!";
}
else
{
alt = "";
}
}
}
return alt.Trim();
}
/// <summary>
/// 重复往来单位合并
/// </summary>
/// <returns></returns>
public string GetRepeatClient(string oldGID, string oldCODENAME, string oldSHORTNAME, string oldDESCRIPTION, string newGID, string newCODENAME, string newSHORTNAME, string newDESCRIPTION, string strUserID, string strUserName)
{
string alt = "";
//获取参数
SqlParameter[] parms = new SqlParameter[]
{
new SqlParameter("@oldGID",SqlDbType.VarChar,36),
new SqlParameter("@oldCODENAME",SqlDbType.VarChar,20),
new SqlParameter("@oldSHORTNAME",SqlDbType.VarChar,20),
new SqlParameter("@oldDESCRIPTION",SqlDbType.VarChar,50),
new SqlParameter("@newGID",SqlDbType.VarChar,36),
new SqlParameter("@newCODENAME",SqlDbType.VarChar,20),
new SqlParameter("@newSHORTNAME",SqlDbType.VarChar,20),
new SqlParameter("@newDESCRIPTION",SqlDbType.VarChar,50),
new SqlParameter("@strUserID",SqlDbType.VarChar,36),
new SqlParameter("@strUserName",SqlDbType.VarChar,150),
};
parms[0].Value = oldGID;// 惟一值
parms[1].Value = oldCODENAME;// 客户代码
parms[2].Value = oldSHORTNAME;// 客户简称
parms[3].Value = oldDESCRIPTION;//客户中文名称或描述信息
parms[4].Value = newGID;// 惟一值
parms[5].Value = newCODENAME;// 客户代码
parms[6].Value = newSHORTNAME;// 客户简称
parms[7].Value = newDESCRIPTION;//客户中文名称或描述信息
parms[8].Value = strUserID;
parms[9].Value = strUserName;
//
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int iResult = SqlHelper.ExecuteSqlStoredProcedureReturn(conn, "proc_isClientRepeat", parms);
if (iResult == 1)
{
alt = "";//成功
}
else
{
alt = "删除失败!";
}
}
return alt.Trim();
}
/// <summary>
/// 客户名称更改
/// </summary>
/// <returns></returns>
public string GetRepeatClient(string strGID, string oldCODENAME, string oldSHORTNAME, string oldDESCRIPTION, string newCODENAME, string newSHORTNAME, string newDESCRIPTION, string strUserID, string strUserName)
{
string alt = "";
//获取参数
SqlParameter[] parms = new SqlParameter[]
{
new SqlParameter("@GID",SqlDbType.VarChar,36),
new SqlParameter("@oldCODENAME",SqlDbType.VarChar,20),
new SqlParameter("@oldSHORTNAME",SqlDbType.VarChar,20),
new SqlParameter("@oldDESCRIPTION",SqlDbType.VarChar,50),
new SqlParameter("@newCODENAME",SqlDbType.VarChar,20),
new SqlParameter("@newSHORTNAME",SqlDbType.VarChar,20),
new SqlParameter("@newDESCRIPTION",SqlDbType.VarChar,50),
new SqlParameter("@strUserID",SqlDbType.VarChar,36),
new SqlParameter("@strUserName",SqlDbType.VarChar,150),
};
parms[0].Value = strGID;// 惟一值
parms[1].Value = oldCODENAME;// 客户代码
parms[2].Value = oldSHORTNAME;// 客户简称
parms[3].Value = oldDESCRIPTION;//客户中文名称或描述信息
parms[4].Value = newCODENAME;// 客户代码
parms[5].Value = newSHORTNAME;// 客户简称
parms[6].Value = newDESCRIPTION;//客户中文名称或描述信息
parms[7].Value = strUserID;
parms[8].Value = strUserName;
//
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int iResult = SqlHelper.ExecuteSqlStoredProcedureReturn(conn, "proc_isClientUpdate", parms);
if (iResult == 1)
{
alt = "";//成功
}
else
{
2 years ago
alt = "更改失败!";
2 years ago
}
}
return alt.Trim();
}
/// <summary>
/// 调整船期时同时计算结算日期和签单日期
/// </summary>
/// <returns></returns>
public int GetEditSeaeAdjustETD(string strGid,string tbAdjustETD)
{
int iResult = 0;
string str = "";
string strSTLDATE = "";
string strSTLFIRSTHALFDATE = "";
string strSTLMIDDLEDATE = "";
string strSTLNAME = "";
string strSTLDATEPJ = "";
//
DataSet ds = GetAllSQL("select top 1 * from info_client where SHORTNAME=(select CUSTOMERNAME from op_seae where BSNO='" + strGid.Trim() + "') and ISSTOP=0");
if(ds!=null)
{
strSTLDATE = ds.Tables[0].Rows[0]["STLDATE"].ToString().Trim();
strSTLFIRSTHALFDATE = ds.Tables[0].Rows[0]["STLFIRSTHALFDATE"].ToString().Trim();
strSTLMIDDLEDATE = ds.Tables[0].Rows[0]["STLMIDDLEDATE"].ToString().Trim();
strSTLNAME = ds.Tables[0].Rows[0]["STLNAME"].ToString().Trim();
strSTLDATEPJ = ds.Tables[0].Rows[0]["STLDATEPJ"].ToString().Trim();
//
strSTLDATE = editSeaeSTLDATE(strSTLNAME,strSTLDATEPJ,strSTLDATE,strSTLFIRSTHALFDATE,strSTLMIDDLEDATE,tbAdjustETD);
//
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
//op_Seae更改开船日期
iResult = -3;
str = "update op_seae set etd='" + tbAdjustETD.Trim() + "',ISSUEDATE='" + tbAdjustETD.Trim() + "',STLDATE='" + strSTLDATE.Trim() + "',STLNAME='" + strSTLNAME.Trim() + "' where BSNO='" + strGid.Trim() + "'";
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, str, null);
//事务提交
sqlTran.Commit();
iResult = 1;//状态为1表示插入成功
}
catch (Exception execError)
{
iResult = -1;//有异常,插入失败
sqlTran.Rollback();
iResult = -2;//插入异常,事务已回滚成功
throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
}
return iResult;
}
/// <summary>
/// 调整船期时同时计算结算日期和签单日期
/// </summary>`
/// <returns></returns>
private string editSeaeSTLDATE(string strSTLNAME,string strSTLDATEPJ,string strSTLDATE,string strSTLFIRSTHALFDATE,string strSTLMIDDLEDATE, string strETD)
{
//string strSTLNAME = "";//结算类型
//string strSTLDATEPJ = "";//票结
//string strSTLDATE = "";//月结
//string strSTLFIRSTHALFDATE = "";//上半月
//string strSTLMIDDLEDATE = "";//下半月
string sdate = "";
if(strSTLNAME=="票结")
{
if(strSTLDATEPJ!="")
{
DateTime myDate = DateTime.Parse(strETD.Trim());
myDate = myDate.AddDays(int.Parse(strSTLDATEPJ.Trim()));
sdate = myDate.ToString("yyyy-MM-dd");
}
else
{
sdate = "";
}
}
else if(strSTLNAME=="月结")
{
if(strSTLDATE!="")
{
DateTime myDate = DateTime.Parse(strETD.Trim());
myDate = myDate.AddMonths(1);
sdate = myDate.ToString("yyyy-MM-dd");
sdate = sdate.Substring(0, 8) + strSTLDATE;
//判断日期是否正确
var bl = verifyDate(sdate);
if(!bl)
{
//获取某月份最大天数
int iday = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(myDate.Year, myDate.Month);
sdate = sdate.Substring(0, 8) + iday;
}
}
else
{
sdate = "";
}
}
else if(strSTLNAME=="半月结")
{
DateTime myDate = DateTime.Parse(strETD.Trim());
if (myDate.Day>15)//下半月
{
if(strSTLFIRSTHALFDATE!="")
{
myDate = myDate.AddMonths(1);
sdate = myDate.ToString("yyyy-MM-dd");
sdate = sdate.Substring(0, 8) + strSTLFIRSTHALFDATE;
}
else
{
sdate = "";
}
}
else//上半月
{
if(strSTLMIDDLEDATE!="")
{
sdate = myDate.ToString("yyyy-MM-dd");
sdate = sdate.Substring(0, 8) + strSTLMIDDLEDATE;
//判断日期是否正确
var bl = verifyDate(sdate);
if(!bl)
{
//获取某月份最大天数
int iday = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(myDate.Year, myDate.Month);
sdate = sdate.Substring(0, 8) + iday;
}
}
else
{
sdate = "";
}
}
}
return sdate.Trim();
}
/*
All by happywinds
*/
private bool verifyDate(string textObj)
{
try
{
DateTime DT = DateTime.Parse(textObj.Trim());
int y = DT.Year;
int m = DT.Month;
int d = DT.Day;
  switch(m)
  {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
if(d>31)
{
return false;
}
else
{
return true;
}
break;
case 2:
if((y%4==0 && d>29) || ((y%4!=0 && d>28)))
{
return false;
}  
else
{
return true;
}
break;
case 4:
case 6:
case 9:
case 11:
if(d>30)
{
return false;
}
else
{
return true;
}
break;
default:
return false;
}
}
catch(Exception)
{
return false;
}
}
/// <summary>
/// 数值位数转换函数
/// </summary>
/// <param name="dl">要转换的数值</param>
/// <param name="iDigit">要转换成的位数</param>
/// <returns></returns>
public Decimal getDigit(Decimal dl, int iDigit)
{
string strDigit = "#.";
string sDigit = "0.";
for(int i=0;i<iDigit;i++)
{
strDigit += "#";
if(i==iDigit-1)
{
sDigit += "1";
}
else
{
sDigit += "0";
}
}
dl = dl < decimal.Parse(sDigit) ? 0 : dl;
dl = dl == 0 ? 0 : decimal.Parse(dl.ToString(strDigit));
return dl;
}
/// <summary>
/// Client客户允许手动录入时判断数据库中是否存在“否”则自动插入数据库的info_client表
/// </summary>
/// <param name="strClient">手动录入的客户</param>
/// <returns></returns>
public string SetAddClient(string strClient,string strUserID,string strShowName,string strCompanyID)
{
string iResult = "0";
string strSQL = "select count(SHORTNAME) as num from info_client where SHORTNAME='" + strClient.Trim() + "'";
int inum = int.Parse(GetStrSQL("num", strSQL));
if (inum == 0)
{
string strCODENAME = "";
//
for (int i = 0; i < strClient.Length;i++ )
{
string qu = strClient.Substring(i,1);
char strCH = char.Parse(qu);
strCODENAME += GetFirstWordByCh(strCH);
}
//
if (strCODENAME == "")
{
strCODENAME = "QTKH";
}
//
strSQL = "select count(SHORTNAME) as num from info_client where CODENAME like '" + strCODENAME.Trim() + "%'";
inum = int.Parse(GetStrSQL("num", strSQL));
if (inum > 0)
{
strCODENAME += (inum + 1).ToString();
}
//
iResult = GetInfoClientInsert(false, strShowName, "", "", strCODENAME, strClient, strClient, "", "", "86--", "86--", "", "", "", "", "", false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, "客户是手动录入,自动插入数据库的。(例如:出库时的转移对象)", strUserID, "", "", "", "", "", "", "", "", false, false, false, "", "", "");
}
return iResult;
}
/// <summary>
/// 返回指定的简体中文的拼音首字符
/// </summary>
/// <param name="singleChinese">单一的简体中文</param>
/// <returns>汉字首字母</returns>
public string GetFirstWordByCh(char singleChinese)
{
if ((int)singleChinese < 127)
{
return "";
//throw new ArgumentException("参数不是简体中文");
}
ChineseChar zhongwen;
try
{
zhongwen = new ChineseChar(singleChinese);
}
catch
{
return "";
//throw new ArgumentException("找不到此汉字 : " + singleChinese);
}
//如果没找到此字的读音
if (zhongwen.PinyinCount < 1)
return "";
//throw new ArgumentException("没有找到此汉字的拼音 : " + singleChinese);
//获取此汉字所有读音
System.Collections.ObjectModel.ReadOnlyCollection<string> pinyins = zhongwen.Pinyins;
//考虑到汉字中多音字的情况 所以需要根据实际情况对此方法进行修改
//此方法暂且返回默认读音的首字母
return pinyins[0][0].ToString();
}
//
}
}