|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.Security;
|
|
|
|
|
using System.Web.UI;
|
|
|
|
|
using System.Web.UI.HtmlControls;
|
|
|
|
|
using System.Web.UI.WebControls;
|
|
|
|
|
using System.Web.UI.WebControls.WebParts;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using DSWeb.Models;
|
|
|
|
|
using DSWeb.EntityDA;
|
|
|
|
|
|
|
|
|
|
namespace DSWeb.PriceCarrier
|
|
|
|
|
{
|
|
|
|
|
public partial class HtmlSearchService : System.Web.UI.Page
|
|
|
|
|
{
|
|
|
|
|
private int iPage;
|
|
|
|
|
private int iRows;
|
|
|
|
|
private string strSidx;
|
|
|
|
|
private string strSord;
|
|
|
|
|
private string strSearchString;
|
|
|
|
|
private string strUserName;
|
|
|
|
|
private string strPassWord;
|
|
|
|
|
private string strHandle;
|
|
|
|
|
private string strUserID;
|
|
|
|
|
private string strSearchOper;
|
|
|
|
|
public string strSelDate = "";
|
|
|
|
|
public string strCompanyID="";//公司GID
|
|
|
|
|
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (Request.QueryString["handle"] != null)
|
|
|
|
|
{
|
|
|
|
|
strHandle = Request.QueryString["handle"].ToString().Trim().ToLower();
|
|
|
|
|
}
|
|
|
|
|
if (Request.QueryString["page"] != null)
|
|
|
|
|
{
|
|
|
|
|
iPage = int.Parse(Request.QueryString["page"].ToString());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
iPage = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Request.QueryString["rows"] != null)
|
|
|
|
|
{
|
|
|
|
|
iRows = int.Parse(Request.QueryString["rows"].ToString());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
iRows = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Request.QueryString["sidx"] != null)
|
|
|
|
|
{
|
|
|
|
|
strSidx = Request.QueryString["sidx"].ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Request.QueryString["sord"] != null)
|
|
|
|
|
{
|
|
|
|
|
strSord = Request.QueryString["sord"].ToString();
|
|
|
|
|
}
|
|
|
|
|
if (Request.QueryString["searchField"] != null)
|
|
|
|
|
{
|
|
|
|
|
strUserID = Request.QueryString["searchField"].ToString().Trim();
|
|
|
|
|
}
|
|
|
|
|
if (Request.QueryString["searchString"] != null)
|
|
|
|
|
{
|
|
|
|
|
UnicodeEncoding unicode = new UnicodeEncoding();
|
|
|
|
|
strSearchString = unicode.GetString(unicode.GetBytes(Regex.Unescape(Request.QueryString["searchString"].ToString())));
|
|
|
|
|
}
|
|
|
|
|
if (Request.QueryString["searchOper"] != null)
|
|
|
|
|
{
|
|
|
|
|
strSearchOper = Request.QueryString["searchOper"].ToString();
|
|
|
|
|
if (strSearchOper.Trim().Equals("0"))
|
|
|
|
|
{
|
|
|
|
|
strSearchOper = " and 1>2";
|
|
|
|
|
}
|
|
|
|
|
else //if (strSearchOper.Trim().Equals("1"))
|
|
|
|
|
{
|
|
|
|
|
strSearchOper = "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
strSelDate = " and convert(char(10),VALIDDATE,20)>=convert(char(10),getdate(),20) ";
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
if (iPage > 0)
|
|
|
|
|
{
|
|
|
|
|
Response.Write(GetSearchSeaPrice());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Request.QueryString["username"] != null)
|
|
|
|
|
{
|
|
|
|
|
strUserName = Request.QueryString["username"].ToString().Trim();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Request.QueryString["password"] != null)
|
|
|
|
|
{
|
|
|
|
|
strPassWord = Request.QueryString["username"].ToString().Trim();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (strHandle != null)
|
|
|
|
|
{
|
|
|
|
|
if (strUserName != null && strPassWord != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool ValidateSignIn(string strTempUserID)
|
|
|
|
|
{
|
|
|
|
|
bool bResult = false;
|
|
|
|
|
|
|
|
|
|
UserLoginStatusDA userLoginStatusDA = new UserLoginStatusDA();
|
|
|
|
|
UserLoginStatusEntity userLoginStatusEntity = new UserLoginStatusEntity();
|
|
|
|
|
|
|
|
|
|
//查看是否当前登录用户是否是时效内重新登录的用户
|
|
|
|
|
userLoginStatusEntity = userLoginStatusDA.GetLoginStatusByUserID(strUserID);
|
|
|
|
|
|
|
|
|
|
if (userLoginStatusEntity.GID != null)
|
|
|
|
|
{
|
|
|
|
|
DateTime signDateTime = userLoginStatusEntity.SignInTime;
|
|
|
|
|
DateTime serverDateTime = userLoginStatusEntity.ServerDateTime;
|
|
|
|
|
double expiresMinutes = double.Parse(userLoginStatusEntity.ExpiresMinutes.ToString());
|
|
|
|
|
if (signDateTime.AddMinutes(expiresMinutes).CompareTo(serverDateTime) <= 0)
|
|
|
|
|
{
|
|
|
|
|
//userLoginStatusDA.DeleteUserLoginStatus(userLoginStatusEntity.GID);
|
|
|
|
|
|
|
|
|
|
//userLoginStatusEntity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
//userLoginStatusEntity.SessionID = "USERID";
|
|
|
|
|
//userLoginStatusEntity.ExpiresMinutes = 200;
|
|
|
|
|
|
|
|
|
|
//userLoginStatusDA.InsertLoginStatus(userLoginStatusEntity);
|
|
|
|
|
bResult = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
userLoginStatusDA.UpdateLoginStatusForReSign(userLoginStatusEntity);
|
|
|
|
|
bResult = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bResult = false;//用户未正常登录
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return bResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int GetEBPriceQueryTotal()
|
|
|
|
|
{
|
|
|
|
|
EBPricequeryDA ebPriceQueryDA = new EBPricequeryDA();
|
|
|
|
|
|
|
|
|
|
string strSql = "SELECT COUNT(*) FROM eb_pricequery WHERE TYPE='FCL' and CORPID='" + strCompanyID.Trim() + "' " + strSelDate + strSearchOper;
|
|
|
|
|
|
|
|
|
|
//string strAuthorityCondition = "";
|
|
|
|
|
//UserAuthorityManage userAuthorityManage = new UserAuthorityManage(strUserID, "modRecvSettleList");
|
|
|
|
|
|
|
|
|
|
//if (userAuthorityManage.OperateType != AuthorityType.NULL)
|
|
|
|
|
//{
|
|
|
|
|
// strAuthorityCondition = userAuthorityManage.GetVisibleRangeSql(userAuthorityManage.VisibleType, ModuleType.RECVSETTLELIST, strShowName, strCompanyID, strDeptName, strUserID);
|
|
|
|
|
// strSql += strAuthorityCondition;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
string strCondition = "";
|
|
|
|
|
if (!ValidateSignIn(strUserID))
|
|
|
|
|
{
|
|
|
|
|
strSql = "SELECT COUNT(*) FROM eb_pricequery WHERE TYPE='FCL' and CORPID='" + strCompanyID.Trim() + "' and LEVEL='1' " + strSelDate + strSearchOper;//and LEVEL='3'
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (strSearchString != null)
|
|
|
|
|
{
|
|
|
|
|
if (!strSearchString.Trim().Equals(""))
|
|
|
|
|
{
|
|
|
|
|
string tempSearch = strSearchString;
|
|
|
|
|
tempSearch = tempSearch.Replace("{", "");
|
|
|
|
|
tempSearch = tempSearch.Replace("}", "");
|
|
|
|
|
tempSearch = tempSearch.Replace("[", "");
|
|
|
|
|
tempSearch = tempSearch.Replace("]", "");
|
|
|
|
|
|
|
|
|
|
string[] searchArg = tempSearch.Split(new char[] { ',' });
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < searchArg.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (i != (searchArg.Length - 1))
|
|
|
|
|
{
|
|
|
|
|
if (searchArg[i + 1].IndexOf(":") < 0)
|
|
|
|
|
{
|
|
|
|
|
string[] strArg = (searchArg[i] + "," + searchArg[i + 1]).Split(new char[] { ':' });
|
|
|
|
|
if (!strArg[1].Replace("\"", "").Trim().Equals(""))
|
|
|
|
|
{
|
|
|
|
|
switch (strArg[0].Replace("\"", ""))
|
|
|
|
|
{
|
|
|
|
|
case "companyid"://Customer
|
|
|
|
|
strCompanyID = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
strCondition += String.Format(" AND CORPID= '{0}' ", strCompanyID.Trim());
|
|
|
|
|
break;
|
|
|
|
|
case "lane"://Customer
|
|
|
|
|
strCondition += String.Format(" AND LANE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "carr"://BillNO
|
|
|
|
|
strCondition += String.Format(" AND CARRIER = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "dis"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND PORTDISCHARGE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "load"://ETD EndDate
|
|
|
|
|
strCondition += String.Format(" AND PODLOAD = '{0}'", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "des"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND DESTINATION = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
string[] strArg = searchArg[i].Split(new char[] { ':' });
|
|
|
|
|
if (!strArg[1].Replace("\"", "").Trim().Equals(""))
|
|
|
|
|
{
|
|
|
|
|
switch (strArg[0].Replace("\"", ""))
|
|
|
|
|
{
|
|
|
|
|
case "companyid"://Customer
|
|
|
|
|
strCompanyID = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
strCondition += String.Format(" AND CORPID= '{0}' ", strCompanyID.Trim());
|
|
|
|
|
break;
|
|
|
|
|
case "lane"://Customer
|
|
|
|
|
strCondition += String.Format(" AND LANE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "carr"://BillNO
|
|
|
|
|
strCondition += String.Format(" AND CARRIER = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "dis"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND PORTDISCHARGE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "load"://ETD EndDate
|
|
|
|
|
strCondition += String.Format(" AND PODLOAD = '{0}'", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "des"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND DESTINATION = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (searchArg[i].IndexOf(":") > 0)
|
|
|
|
|
{
|
|
|
|
|
string[] strArg = searchArg[i].Split(new char[] { ':' });
|
|
|
|
|
if (!strArg[1].Replace("\"", "").Trim().Equals(""))
|
|
|
|
|
{
|
|
|
|
|
switch (strArg[0].Replace("\"", ""))
|
|
|
|
|
{
|
|
|
|
|
case "companyid"://Customer
|
|
|
|
|
strCompanyID = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
strCondition += String.Format(" AND CORPID= '{0}' ", strCompanyID.Trim());
|
|
|
|
|
break;
|
|
|
|
|
case "lane"://Customer
|
|
|
|
|
strCondition += String.Format(" AND LANE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "carr"://BillNO
|
|
|
|
|
strCondition += String.Format(" AND CARRIER = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "dis"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND PORTDISCHARGE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "load"://ETD EndDate
|
|
|
|
|
strCondition += String.Format(" AND PODLOAD = '{0}'", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
case "des"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND DESTINATION = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strSql += strCondition;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int iTotal = int.Parse(ebPriceQueryDA.GetExcuteSql(strSql).Tables[0].Rows[0][0].ToString());
|
|
|
|
|
|
|
|
|
|
return iTotal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string GetSearchSeaPrice()
|
|
|
|
|
{
|
|
|
|
|
EBPricequeryDA ebPriceQueryDA = new EBPricequeryDA();
|
|
|
|
|
DataTable sourceTable;
|
|
|
|
|
int iTotalCount = GetEBPriceQueryTotal();
|
|
|
|
|
string strCondition = "";
|
|
|
|
|
string strTopNotInclude = "";
|
|
|
|
|
string strTopInclude = "";
|
|
|
|
|
string strSql = "";
|
|
|
|
|
int iPageTotal = 0;
|
|
|
|
|
string strLane = "";
|
|
|
|
|
string strCarrier = "";
|
|
|
|
|
string strDischarge = "";
|
|
|
|
|
string strPortLoad = "";
|
|
|
|
|
string strDESTINATION = "";
|
|
|
|
|
|
|
|
|
|
if (strSearchString != null)
|
|
|
|
|
{
|
|
|
|
|
if (!strSearchString.Trim().Equals(""))
|
|
|
|
|
{
|
|
|
|
|
string tempSearch = strSearchString;
|
|
|
|
|
tempSearch = tempSearch.Replace("{", "");
|
|
|
|
|
tempSearch = tempSearch.Replace("}", "");
|
|
|
|
|
tempSearch = tempSearch.Replace("[", "");
|
|
|
|
|
tempSearch = tempSearch.Replace("]", "");
|
|
|
|
|
|
|
|
|
|
string[] searchArg = tempSearch.Split(new char[] { ',' });
|
|
|
|
|
for (int i = 0; i < searchArg.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (i != (searchArg.Length - 1))
|
|
|
|
|
{
|
|
|
|
|
if (searchArg[i + 1].IndexOf(":") < 0)
|
|
|
|
|
{
|
|
|
|
|
string[] strArg = (searchArg[i] + "," +searchArg[i + 1]).Split(new char[] { ':' });
|
|
|
|
|
if (!strArg[1].Replace("\"", "").Trim().Equals(""))
|
|
|
|
|
{
|
|
|
|
|
switch (strArg[0].Replace("\"", ""))
|
|
|
|
|
{
|
|
|
|
|
case "companyid"://Customer
|
|
|
|
|
strCompanyID = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
strCondition += String.Format(" AND CORPID= '{0}' ", strCompanyID.Trim());
|
|
|
|
|
break;
|
|
|
|
|
case "lane"://Customer
|
|
|
|
|
strCondition += String.Format(" AND LANE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strLane = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "carr"://BillNO
|
|
|
|
|
strCondition += String.Format(" AND CARRIER = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strCarrier = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "dis"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND PORTDISCHARGE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strDischarge = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "load"://ETD EndDate
|
|
|
|
|
strCondition += String.Format(" AND PODLOAD = '{0}'", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strPortLoad = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "des"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND DESTINATION = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strDESTINATION = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
string[] strArg = searchArg[i].Split(new char[] { ':' });
|
|
|
|
|
if (!strArg[1].Replace("\"", "").Trim().Equals(""))
|
|
|
|
|
{
|
|
|
|
|
switch (strArg[0].Replace("\"", ""))
|
|
|
|
|
{
|
|
|
|
|
case "companyid"://Customer
|
|
|
|
|
strCompanyID = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
strCondition += String.Format(" AND CORPID= '{0}' ", strCompanyID.Trim());
|
|
|
|
|
break;
|
|
|
|
|
case "lane"://Customer
|
|
|
|
|
strCondition += String.Format(" AND LANE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strLane = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "carr"://BillNO
|
|
|
|
|
strCondition += String.Format(" AND CARRIER = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strCarrier = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "dis"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND PORTDISCHARGE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strDischarge = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "load"://ETD EndDate
|
|
|
|
|
strCondition += String.Format(" AND PODLOAD = '{0}'", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strPortLoad = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "des"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND DESTINATION = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strDESTINATION = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (searchArg[i].IndexOf(":") > 0)
|
|
|
|
|
{
|
|
|
|
|
string[] strArg = searchArg[i].Split(new char[] { ':' });
|
|
|
|
|
if (!strArg[1].Replace("\"", "").Trim().Equals(""))
|
|
|
|
|
{
|
|
|
|
|
switch (strArg[0].Replace("\"", ""))
|
|
|
|
|
{
|
|
|
|
|
case "companyid"://Customer
|
|
|
|
|
strCompanyID = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
strCondition += String.Format(" AND CORPID= '{0}' ", strCompanyID.Trim());
|
|
|
|
|
break;
|
|
|
|
|
case "lane"://Customer
|
|
|
|
|
strCondition += String.Format(" AND LANE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strLane = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "carr"://BillNO
|
|
|
|
|
strCondition += String.Format(" AND CARRIER = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strCarrier = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "dis"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND PORTDISCHARGE = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strDischarge = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "load"://ETD EndDate
|
|
|
|
|
strCondition += String.Format(" AND PODLOAD = '{0}'", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strPortLoad = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
case "des"://ETD BeginDate
|
|
|
|
|
strCondition += String.Format(" AND DESTINATION = '{0}' ", strArg[1].Replace("\"", "").Replace("##", ","));
|
|
|
|
|
strDESTINATION = strArg[1].Replace("\"", "").Replace("##", ",");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (iTotalCount > 0)
|
|
|
|
|
{
|
|
|
|
|
iPageTotal = (iTotalCount % iRows) > 0 ? ((iTotalCount / iRows) + 1) : (iTotalCount / iRows);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
iPageTotal = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!ValidateSignIn(strUserID))
|
|
|
|
|
{
|
|
|
|
|
//strSql = String.Format(" SELECT GID,LANE,PORTDISCHARGE,PIRICEVIAPORT,CARRIER,[20GP] as D_20GP,[40GP] as D_40GP,[40HQ] as D_40HQ,[45HQ] as D_45HQ,VIA,ETD,TT,POC,SVC,CARRIERLANE,OWS,convert(char(10),EFFECTIVEDATE,20) AS EFFECTIVEDATE,convert(char(10),VALIDDATE,20) AS VALIDDATE,REMARK,COMMODITY FROM eb_pricequery WHERE TYPE='FCL' and LEVEL='3'" + strSelDate + strSearchOper);
|
|
|
|
|
if (iPage > 0 && iRows > 0)
|
|
|
|
|
{
|
|
|
|
|
if (iPage == 1)
|
|
|
|
|
{
|
|
|
|
|
strSql = String.Format(" SELECT {0} GID,LANE,PORTDISCHARGE,DESTINATION,PIRICEVIAPORT,CARRIER,[20GP] as D_20GP,[20RS] as D_20RS,[40GP] as D_40GP,[40HQ] as D_40HQ,[40RH] as D_40RH,[40NOR] as D_40NOR,[45HQ] as D_45HQ,VIA,ETD,TT,POC,SVC,CARRIERLANE,OWS,convert(char(10),EFFECTIVEDATE,20) AS EFFECTIVEDATE,convert(char(10),VALIDDATE,20) AS VALIDDATE,REMARK,COMMODITY FROM eb_pricequery WHERE TYPE='FCL' and LEVEL='1' " + strSelDate + strCondition + strSearchOper + " ORDER BY " + strSidx + " " + strSord + " ", "top " + iRows.ToString());// and LEVEL='3'
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
strTopNotInclude = "top " + (iRows * (iPage - 1)).ToString();//RowCount*PageNum
|
|
|
|
|
strTopInclude = "top " + iRows.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
strSql = String.Format(" SELECT {0} GID,LANE,PORTDISCHARGE,DESTINATION,PIRICEVIAPORT,CARRIER,[20GP] as D_20GP,[20RS] as D_20RS,[40GP] as D_40GP,[40HQ] as D_40HQ,[40RH] as D_40RH,[40NOR] as D_40NOR,[45HQ] as D_45HQ,VIA,ETD,TT,POC,SVC,CARRIERLANE,OWS,convert(char(10),EFFECTIVEDATE,20) AS EFFECTIVEDATE,convert(char(10),VALIDDATE,20) AS VALIDDATE,REMARK,COMMODITY FROM eb_pricequery WHERE GID NOT IN (SELECT {1} GID FROM eb_pricequery WHERE TYPE='FCL' and LEVEL='1' " + strSelDate + strCondition + strSearchOper + " ORDER BY " + strSidx + " " + strSord + " ) and LEVEL='1' and TYPE='FCL' " + strSelDate + strCondition + strSearchOper + " ORDER BY " + strSidx + " " + strSord + " ", strTopInclude, strTopNotInclude);// and LEVEL='3'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
strSql = String.Format(" SELECT GID,LANE,PORTDISCHARGE,DESTINATION,PIRICEVIAPORT,CARRIER,[20GP] as D_20GP,[20RS] as D_20RS,[40GP] as D_40GP,[40HQ] as D_40HQ,[40RH] as D_40RH,[40NOR] as D_40NOR,[45HQ] as D_45HQ,VIA,ETD,TT,POC,SVC,CARRIERLANE,OWS,convert(char(10),EFFECTIVEDATE,20) AS EFFECTIVEDATE,convert(char(10),VALIDDATE,20) AS VALIDDATE,REMARK,COMMODITY FROM eb_pricequery "
|
|
|
|
|
+ " WHERE TYPE='FCL' and LEVEL='1' " + strSelDate + strCondition + strSearchOper + " ORDER BY " + strSidx + " " + strSord + " ");// and LEVEL='3'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//权限级别
|
|
|
|
|
T_ALL_DA T_ALL_DA = new T_ALL_DA();
|
|
|
|
|
string strLEVEL = "";
|
|
|
|
|
strLEVEL = T_ALL_DA.GetStrSQL("LEVEL", "select LEVEL FROM info_client where GID='" + strUserID.Trim() + "' and ISSTOP=0");
|
|
|
|
|
strLEVEL = " and LEVEL='" + strLEVEL + "'";
|
|
|
|
|
if (strUserID.Trim().Equals("1BEC90E1-9780-472F-90C2-0C6390C044A4"))//系统管理员
|
|
|
|
|
{
|
|
|
|
|
strLEVEL = "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (iPage > 0 && iRows > 0)
|
|
|
|
|
{
|
|
|
|
|
if (iPage == 1)
|
|
|
|
|
{
|
|
|
|
|
strSql = String.Format(" SELECT {0} GID,LANE,PORTDISCHARGE,DESTINATION,PIRICEVIAPORT,CARRIER,[20GP] as D_20GP,[20RS] as D_20RS,[40GP] as D_40GP,[40HQ] as D_40HQ,[40RH] as D_40RH,[40NOR] as D_40NOR,[45HQ] as D_45HQ,VIA,ETD,TT,POC,SVC,CARRIERLANE,OWS,convert(char(10),EFFECTIVEDATE,20) AS EFFECTIVEDATE,convert(char(10),VALIDDATE,20) AS VALIDDATE,REMARK,COMMODITY FROM eb_pricequery WHERE TYPE='FCL' " + strSelDate + strLEVEL + strCondition + strSearchOper + " ORDER BY " + strSidx + " " + strSord + " ", "top " + iRows.ToString());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
strTopNotInclude = "top " + (iRows * (iPage - 1)).ToString();//RowCount*PageNum
|
|
|
|
|
strTopInclude = "top " + iRows.ToString();
|
|
|
|
|
|
|
|
|
|
strSql = String.Format(" SELECT {0} GID,LANE,PORTDISCHARGE,DESTINATION,PIRICEVIAPORT,CARRIER,[20GP] as D_20GP,[20RS] as D_20RS,[40GP] as D_40GP,[40HQ] as D_40HQ,[40RH] as D_40RH,[40NOR] as D_40NOR,[45HQ] as D_45HQ,VIA,ETD,TT,POC,SVC,CARRIERLANE,OWS,convert(char(10),EFFECTIVEDATE,20) AS EFFECTIVEDATE,convert(char(10),VALIDDATE,20) AS VALIDDATE,REMARK,COMMODITY FROM eb_pricequery WHERE GID NOT IN (SELECT {1} GID FROM eb_pricequery WHERE TYPE='FCL' " + strLEVEL + strCondition + strSearchOper + " ORDER BY " + strSidx + " " + strSord + " ) and TYPE='FCL' " + strSelDate + strLEVEL + strCondition + strSearchOper + " ORDER BY " + strSidx + " " + strSord + " ", strTopInclude, strTopNotInclude);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
strSql = String.Format(" SELECT GID,LANE,PORTDISCHARGE,DESTINATION,PIRICEVIAPORT,CARRIER,[20GP] as D_20GP,[20RS] as D_20RS,[40GP] as D_40GP,[40HQ] as D_40HQ,[40RH] as D_40RH,[40NOR] as D_40NOR,[45HQ] as D_45HQ,VIA,ETD,TT,POC,SVC,CARRIERLANE,OWS,convert(char(10),EFFECTIVEDATE,20) AS EFFECTIVEDATE,convert(char(10),VALIDDATE,20) AS VALIDDATE,REMARK,COMMODITY FROM eb_pricequery " + " WHERE TYPE='FCL' " + strSelDate + strLEVEL + strCondition + strSearchOper + " ORDER BY " + strSidx + " " + strSord + " ");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sourceTable = ebPriceQueryDA.GetExcuteSql(strSql).Tables[0];
|
|
|
|
|
|
|
|
|
|
StringBuilder sourceBuilder = new StringBuilder();
|
|
|
|
|
sourceBuilder.Append("{");
|
|
|
|
|
sourceBuilder.Append("\"griddatas\":[");
|
|
|
|
|
for (int i = 0; i < sourceTable.Rows.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
sourceBuilder.Append("{\"id\":\"" + sourceTable.Rows[i][0].ToString() + "\",");
|
|
|
|
|
//sourceBuilder.Append("data:[");
|
|
|
|
|
|
|
|
|
|
//sourceBuilder.Append("\"0\",");
|
|
|
|
|
for (int j = 1; j < sourceTable.Columns.Count; j++)
|
|
|
|
|
{
|
|
|
|
|
string ls = sourceTable.Rows[i][j].ToString();
|
|
|
|
|
ls = ls.Replace("\r\n", " ");
|
|
|
|
|
ls = ls.Replace("\n", " ");
|
|
|
|
|
//
|
|
|
|
|
if (j == sourceTable.Columns.Count - 1)
|
|
|
|
|
{
|
|
|
|
|
sourceBuilder.Append("\"" + sourceTable.Columns[j].ColumnName.ToString().ToLower() + "\":\"" + ls + "\"");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sourceBuilder.Append("\"" + sourceTable.Columns[j].ColumnName.ToString().ToLower() + "\":\"" + ls + "\",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (i == sourceTable.Rows.Count - 1)
|
|
|
|
|
{
|
|
|
|
|
sourceBuilder.Append("}");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sourceBuilder.Append("},");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
sourceBuilder.Append("],");
|
|
|
|
|
sourceBuilder.Append("\"page\": " + iPage + ",");
|
|
|
|
|
sourceBuilder.Append("\"record\":" + iTotalCount + ",");
|
|
|
|
|
sourceBuilder.Append("\"rows\": " + iRows + ",");
|
|
|
|
|
sourceBuilder.Append("\"total\":" + iPageTotal);
|
|
|
|
|
sourceBuilder.Append("}");
|
|
|
|
|
|
|
|
|
|
string alt = "'" + strPortLoad + "','" + strDischarge + "','" + strCarrier + "','" + strLane + "','" + strDESTINATION + "','FCL'";
|
|
|
|
|
//
|
|
|
|
|
if (strLane != "" || strCarrier != "" || strDischarge != "" || strPortLoad != "" || strDESTINATION != "")
|
|
|
|
|
{
|
|
|
|
|
T_ALL_DA T_ALL_DA = new T_ALL_DA();
|
|
|
|
|
bool bl = T_ALL_DA.GetEBPricequeryListLOG(alt, strUserID,strCompanyID.Trim());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sourceBuilder.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|