📄 querydb.cs
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Text;
//using PublicDB;
namespace SAMPLE.DLWLJK.QUERY
{
/// <summary>
/// QueryDB 的摘要说明。
/// </summary>
///
public class QueryCondition
{
//query 条件
int m_nGateCrossState=1;
int m_nEntryType;
string m_strShipName;//船名
string m_strVoyageNo;//航次
string m_strBillNo;//提单
string m_strContaNo;//箱号
string m_strEntryID;//报关单号
string m_strOutEntryID;//转关单号
string m_strVehi_No;//车牌号码
int m_nUserID; //用户代码
int m_nCheckType;//检查类型
int m_nCheckFlag;//放行类型
int m_nPlaceID;//地点代码
float m_fEntryWeightErrorStart;//报关误差起始点
float m_fEntryWeightErrorEnd;//报关误差结束点
float m_fBillWeightErrorStart;//舱单误差起始点
float m_fBillWeightErrorEnd;//舱单误差结束点
string m_strGoodsType;//货物类型
string m_strGoodsBillRalation;//货单关系
string m_strQueryCondition;//查询条件
//sql
StringBuilder m_strQueryConditionEntry=new StringBuilder(2048);
StringBuilder m_strQueryConditionTurnEntry=new StringBuilder(2048);
StringBuilder m_strQueryConditionBoth=new StringBuilder(2048);
//turn entry
// StringBuilder m_strTurnEntryCrossGateSQL=new StringBuilder(2048);
// StringBuilder m_strTurnEntryUnCrossGateSQL=new StringBuilder(2048);
// StringBuilder m_strTurnEntryBothSQL=new StringBuilder(2048);
StringBuilder m_strTurnEntryComm =new StringBuilder(2048);
string m_strErrorParaInfo;
//entry
// static StringBuilder m_strCrossGateSQL=new StringBuilder(2048);
// static StringBuilder m_strUnCrossGateSQL=new StringBuilder(2048);
// static StringBuilder m_strBothSQL=new StringBuilder(2048);
StringBuilder m_strEntryComm=new StringBuilder(2048);
int m_iOptionCondition;
string m_strBeginTime ;//经过卡口的起始时间
string m_strEndTime;//经过卡口的结束时间
string m_strCarryContaBegintime;//提箱起始时间
string m_strCarryContaEndtime;//提箱结束时间
public QueryCondition()
{
InitVar();
}
public void Dispose()
{
}
public bool IsFloat(string str)
{
if(str=="")
return false;
else
return true;
}
//set query 条件
//being Date time
public bool SetBeginDateTime(string strTime)
{
m_strBeginTime=strTime;
return true;
}
public string GetBeginDateTime()
{
return m_strBeginTime;
}
//end Date Time
public bool SetEndDateTime(string strTime)
{
m_strEndTime=strTime;
return true;
}
public string GetEndDateTime()
{
return m_strEndTime;
}
//提箱起始时间
public bool SetCarryContaBegintime(string strTime)
{
m_strCarryContaBegintime=strTime;
return true;
}
public string GetCarryContaBegintime()
{
return m_strCarryContaBegintime;
}
//提箱结束时间
public bool SetCarryContaEndtime(string strTime)
{
m_strCarryContaEndtime=strTime;
return true;
}
public string GetCarryContaEndtime()
{
return m_strCarryContaEndtime;
}
//cross Gate
public bool SetGateCrossState(int nGateCrossState)
{
if((nGateCrossState>=0 ) && (nGateCrossState<=2 ))
{
m_nGateCrossState=nGateCrossState;
return true;
}
else
{
m_strErrorParaInfo="是否经过卡口参数选择有误!";
return false;
}
}
public int GetGateCrossState()
{
return m_nGateCrossState;
}
//shipname
public bool SetShipName(string strShipName)
{
m_strShipName=strShipName;
return true;
}
public string GetShipName()
{
return m_strShipName;
}
//Voyage
public bool SetVoyageNo(string strVoyage)
{
m_strVoyageNo=strVoyage;
return true;
}
public string GetVoyageNo()
{
return m_strVoyageNo;
}
//billno
public bool SetBillNo(string strBillNo)
{
m_strBillNo=strBillNo;
return true;
}
public string GetBillNo()
{
return m_strBillNo;
}
//m_strContaNo
public bool SetContaNo(string strContaNo)
{
m_strContaNo=strContaNo;
return true;
}
public string GetContaNo()
{
return m_strContaNo;
}
//EntryID
public bool SetEntryID(string strEntryID)
{
m_strEntryID=strEntryID;
if(m_strEntryID.Length!=0)
m_nEntryType=1;
return true;
}
public string GetEntryID()
{
return m_strEntryID;
}
//转关单
public bool SetOutEntryID(string strOutEntryID)
{
m_strOutEntryID=strOutEntryID;
if(m_strEntryID.Length!=0)
m_nEntryType=0;
return true;
}
public string GetOutEntryID()
{
return m_strOutEntryID;
}
//车牌号码
public bool SetVehiNo(string strVehiNo)
{
m_strVehi_No=strVehiNo;
return true;
}
public string GetVehiNo()
{
return m_strVehi_No;
}
//place id
public bool SetPlaceID_DB(int nPlaceID)
{
m_nPlaceID=nPlaceID;
return true;
}
public bool SetPlaceID(string strPlaceID)
{
m_nPlaceID=-1;
if(strPlaceID=="")
{
return true;
}
QueryDB DbQuery;
int iResult=strPlaceID.CompareTo("所有卡口");
if(iResult==0)
m_nPlaceID=-1;
else
{
DbQuery=new QueryDB();
DbQuery.ConnectDB();
string tstrQueryString="select PlaceID from mPlaceName where PlaceName= '" +strPlaceID+"'" ;
string tstrTable="PlaceName";
DataTable dt =DbQuery.ExeQuery(tstrQueryString,tstrTable);
if(dt.Rows.Count>0)
{
m_nPlaceID=int.Parse(dt.Rows[0][0].ToString());
}
DbQuery.DisConnectDB();
}
return true;
}
public int GetPlaceID()
{
return m_nPlaceID;
}
//UserID
public bool SetUserID_DB(int UserID)
{
m_nUserID=UserID;
return true;
}
public bool SetUserID(string strUserID)
{
if(strUserID=="")
{
m_nUserID=-1;
return true;
}
int iResult=strUserID.CompareTo("所有操作员");
if(iResult==0)
m_nUserID=-1;
else
m_nUserID=int.Parse(strUserID);
return true;
}
public int GetUserID()
{
return m_nUserID;
}
//checktype
public bool SetCheckType_DB(int nCheckType)
{
m_nCheckType=nCheckType;
return true;
}
public bool SetCheckType(string strCheckType)
{
m_nCheckType=-1;
if(strCheckType=="")
return true;
int iResult=strCheckType.CompareTo("所有查验方式");
if(iResult!=0)
{
iResult=strCheckType.CompareTo("卡口 查验");
if(iResult==0)
{
m_nCheckType=101;
}
iResult=strCheckType.CompareTo("H986 查验");
if(iResult==0)
{
m_nCheckType=201;
}
iResult=strCheckType.CompareTo("人工 查验");
if(iResult==0)
{
m_nCheckType=301;
}
}
return true;
}
public int GetCheckType()
{
return m_nCheckType;
}
//放行
public bool SetCheckFlag(string strCheckFlag)
{
QueryDB DbQuery;
int iResult=strCheckFlag.CompareTo("所有放行方式");
if(iResult==0)
{
m_nCheckFlag=-1;
}
else
{
DbQuery=new QueryDB();
DbQuery.ConnectDB();
string tstrQueryString="select CheckFlagID from mCheckFlagInfo where Demo= '" +strCheckFlag+"'" ;
string tstrTable="mCheckFlagInfo";
DataTable dt =DbQuery.ExeQuery(tstrQueryString,tstrTable);
if(dt.Rows.Count>0)
{
m_nCheckFlag=int.Parse(dt.Rows[0][0].ToString());
}
DbQuery.DisConnectDB();
}
return true;
}
public bool SetCheckFlag_DB(int nCheckFlag)
{
m_nCheckFlag=nCheckFlag;
return true;
}
public int GetCheckFlag()
{
return m_nCheckFlag;
}
//good type
public bool SetGoodsType_DB(string strGoodsType)
{
m_strGoodsType=strGoodsType;
return true;
}
public bool SetGoodsType(string strGoodType)
{
bool bResult=true;
m_strGoodsType="";
QueryDB DbQuery;
if(strGoodType=="")
return true;
int iResult=strGoodType.CompareTo("所有货物");
if(iResult!=0)
{
m_strGoodsType=strGoodType;
}
return bResult;
}
public string GetGoodsType()
{
return m_strGoodsType;
}
public bool SetGoodsBillRelation_DB(string strRelation)
{
m_strGoodsBillRalation=strRelation;
return true;
}
public bool SetGoodsBillRelation(string strRelation)
{
bool bResult=true;
m_strGoodsBillRalation="";
if(strRelation=="")
return true;
int iResult=strRelation.CompareTo("所有关系");
if(iResult!=0)
{
m_strGoodsBillRalation=strRelation;
}
return bResult;
}
//货单关系
public string GetGoodsBillRelation()
{
return m_strGoodsBillRalation;
}
//报关误差起始点
public float GetEntryWeightErrorStart()
{
return m_fEntryWeightErrorStart;
}
public bool SetEntryWeightErrorStart(float fEntryWeightErrorStart)
{
m_fEntryWeightErrorStart=fEntryWeightErrorStart;
// if(fEntryWeightErrorStart==float.Parse("-9.99"))
// {
// m_fEntryWeightErrorStart=float.Parse("-9.98");
// }
// else
// {
// m_fEntryWeightErrorStart=fEntryWeightErrorStart;
// }
return true;
}
//报关误差结束点
public float GetEntryWeightErrorEnd()
{
return m_fEntryWeightErrorEnd;
}
public bool SetEntryWeightErrorEnd(float fEntryWeightErrorEnd)
{
// if(fEntryWeightErrorEnd==float.Parse("-9.99"))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -