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.

2068 lines
100 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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;
namespace DSWeb.EntityDA
{
public class RangeDA
{
#region 获取信息的基本函数
/// <summary>
/// 执行命令语句
/// </summary>
/// <returns></returns>
public bool GetExecuteSqlCommand(string strSQL)
{
bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, strSQL);
return bl;
}
/// <summary>
/// 返回 某字段
/// </summary>
/// <returns></returns>
public string GetStrSQL(string strfield, string strSQL)
{
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, strSQL);
if (DS.Tables[0].Rows.Count > 0)
{
strSQL = DS.Tables[0].Rows[0]["" + strfield + ""].ToString();
}
else
{
strSQL = "";
}
return strSQL;
}
/// <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;
}
/// <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 GetCORPNAME(string strCompanyID)
{
string str = "select top 1 [NAME] from company where GID='" + strCompanyID + "'";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["NAME"].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 + "' and DEPTNAME=(select top 1 DEPTNAME from user_baseinfo where USERID='" + strUserID + "')";
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 GetDEPTNAME(string strUserID)
{
string strcompanyid = GetCORPID(strUserID);
string str = "select top 1 DEPTNAME from user_baseinfo where USERID='" + strUserID + "' and COMPANYNAME=(select NAME from company where GID='" + strcompanyid + "')";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["DEPTNAME"].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;
}
/// <summary>
/// 返回所有 权限可视范围
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">模块列表名</param>
/// <returns></returns>
public String GetVISIBLERANGE(string strUserID, string strRange)
{
string str = "select VISIBLERANGE from VW_User_Authority where USERID='" + strUserID + "' and [NAME]='" + strRange + "' and ISDELETE=0";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["VISIBLERANGE"].ToString();
}
else
{
str = "";
}
return str;
}
/// <summary>
/// 返回所有 权限可操作范围
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">模块列表名</param>
/// <returns></returns>
public String GetOPERATERANGE(string strUserID, string strRange)
{
string str = "select OPERATERANGE from VW_User_Authority where USERID='" + strUserID + "' and [NAME]='" + strRange + "' and ISDELETE=0";
DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str);
if (DS.Tables[0].Rows.Count > 0)
{
str = DS.Tables[0].Rows[0]["OPERATERANGE"].ToString();
}
else
{
str = "";
}
return str;
}
#endregion
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region 获取modExchangesUnit往来单位列表
/// <summary>
/// 往来单位列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetUnitCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
//alt = "select GID FROM info_client where CORPID='" + strCompany + "'";
alt = "select GID FROM info_client where (CORPID='" + strCompany + "' or gid in(select clientid from info_client_share where ISSHARE=1 and companyid='" + strCompany + "'))";
return alt;
}
/// <summary>
/// 往来单位列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetUnitCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
//alt = GetStrSQL("GID", "select GID FROM info_client where GID='" + strGID.Trim() + "' and CORPID='" + strCompany + "'");
alt = GetStrSQL("GID", "select GID FROM info_client where GID='" + strGID.Trim() + "' and CORPID='" + strCompany + "'");
}
return alt;
}
/// <summary>
/// 往来单位列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetUnitPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
//alt = "select GID FROM info_client where CORPID='" + strCompany + "' and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%')";
alt = "select GID FROM info_client where CORPID='" + strCompany + "' and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or [OPNAME] like '%" + strNAME + "%' or MODIFIEDUSER in(select gid from [user] where SHOWNAME like '%" + strNAME + "%'))";
return alt;
}
/// <summary>
/// 往来单位列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetUnitPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
//alt = GetStrSQL("GID", "select GID FROM info_client where GID='" + strGID.Trim() + "' and CORPID='" + strCompany + "' and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%')");
alt = GetStrSQL("GID", "select GID FROM info_client where GID='" + strGID.Trim() + "' and CORPID='" + strCompany + "' and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or [OPNAME] like '%" + strNAME + "%' or MODIFIEDUSER in(select gid from [user] where SHOWNAME like '%" + strNAME + "%'))");
}
return alt;
}
#endregion
#region 获取modSeaeOrderList销售订舱列表 / modSeaeOrderAudit销售订舱审核
/// <summary>
/// modSeaeOrderList销售订舱列表 / modSeaeOrderAudit销售订舱审核----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetCrmSeaeOrderCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
alt = "select ORDNO FROM crm_seaeorder where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))";
return alt;
}
/// <summary>
/// modSeaeOrderList销售订舱列表 / modSeaeOrderAudit销售订舱审核----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCrmSeaeOrderCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",","','");
alt = GetStrSQL("ORDNO", "select ORDNO FROM crm_seaeorder where ORDNO in ('" + strGID.Trim() + "') and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))");
}
return alt;
}
/// <summary>
/// modSeaeOrderList销售订舱列表 / modSeaeOrderAudit销售订舱审核----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetCrmSeaeOrderDEPT(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select ORDNO FROM crm_seaeorder where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%'))";
return alt;
}
/// <summary>
/// modSeaeOrderList销售订舱列表 / modSeaeOrderAudit销售订舱审核----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCrmSeaeOrderDEPT(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("ORDNO", "select ORDNO FROM crm_seaeorder where ORDNO in ('" + strGID.Trim() + "') and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%'))");
}
return alt;
}
/// <summary>
/// modSeaeOrderList销售订舱列表 / modSeaeOrderAudit销售订舱审核----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCrmSeaeOrderPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select ORDNO FROM crm_seaeorder where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')";
return alt;
}
/// <summary>
/// modSeaeOrderList销售订舱列表 / modSeaeOrderAudit销售订舱审核----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCrmSeaeOrderPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("ORDNO", "select ORDNO FROM crm_seaeorder where ORDNO in ('" + strGID.Trim() + "') and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')");
}
return alt;
}
#endregion
#region 获取modOrderManagement委托管理列表
/// <summary>
/// 委托管理列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetOrderManagementCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
alt = "select BSNO FROM op_seae where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))";
return alt;
}
/// <summary>
/// 委托管理列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetOrderManagementCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM op_seae where BSNO='" + strGID.Trim() + "' and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))");
}
return alt;
}
/// <summary>
/// 委托管理列表----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetOrderManagementDEPT(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select BSNO FROM op_seae where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')) ";
return alt;
}
/// <summary>
/// 委托管理列表----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetOrderManagementDEPT(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM op_seae where BSNO='" + strGID.Trim() + "' and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')) ");
}
return alt;
}
/// <summary>
/// 委托管理列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetOrderManagementPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select BSNO FROM op_seae where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')";
return alt;
}
/// <summary>
/// 委托管理列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetOrderManagementPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM op_seae where BSNO='" + strGID.Trim() + "' and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')");
}
return alt;
}
#endregion
#region 获取modProfitreportRange利润报表查询
/// <summary>
/// 利润报表查询之权限--分公司
/// </summary>
/// <returns></returns>
public string ProfitReportViewPartCompany(string companyid)
{
string addSQL = "";
addSQL = " and corpid='"+companyid.ToString().Trim()+"' ";
return addSQL;
}
/// <summary>
/// 利润报表查询之权限--部门
/// </summary>
/// <param name="companyid"></param>
/// <param name="name"></param>
/// <param name="userid"></param>
/// <returns></returns>
public string ProfitReportViewDept(string companyid,string userid)
{
string addSQL = "";
string strNAME = GetSHOWNAME(userid.Trim());
string strDEPTNAME = GetDEPTNAME(userid.Trim());
addSQL = " and bsno in (select bsno from VW_Settlement where inputby in(select showname from [user] where gid in (select userid from [user_company] where companyid='" + companyid.Trim() + "'))and (inputby in (select showname from [user] where gid in (select userid from [user_baseinfo] where deptname='" + strDEPTNAME.Trim() + "')) or (sale like '%" + strNAME.Trim() + "%' or op like '%" + strNAME.Trim() + "%' or doc like '%" + strNAME.Trim() + "%' or custservice like '%" + strNAME.Trim() + "%')))";
return addSQL;
}
/// <summary>
/// 利润报表查询之权限--个人
/// </summary>
/// <param name="companyid"></param>
/// <param name="userid"></param>
/// <returns></returns>
public string ProfitReportViewPerson(string companyid,string userid)
{
string addSQL = "";
string strNAME = GetSHOWNAME(userid.Trim());
addSQL = " and bsno in (select bsno from VW_Settlement where inputby in (select showname from [user] where gid in (select userid from [user_company] where companyid='" + companyid.Trim() + "'))and (sale like '%" + strNAME.Trim() + "%' or op like '%" + strNAME.Trim() + "%' or doc like '%" + strNAME.Trim() + "%' or custservice like '%" + strNAME.Trim() + "%'))";
return addSQL;
}
#endregion
#region 获取openSeaeInfoLock出口委托信息解锁之权限验证
/// <summary>
/// 出口委托信息解锁之权限验证---分公司
/// </summary>
/// <returns></returns>
public string OpenSeaeInfoLockPartCompany(string strUserID, string strGIDS)
{
string strCompany = GetCORPID(strUserID.Trim());
string strSQL = "";
string result = "have";
DataTable bsnotable;
string[] gidArray = strGIDS.Split(',');
for (int i = 0; i < gidArray.Length; i++)
{
strSQL = "select a.bsno from(select bsno from [op_seae] where corpid='"+strCompany.Trim()+"')a where bsno='"+gidArray[i].ToString()+"'";
bsnotable = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSQL).Tables[0];
if (bsnotable.Rows.Count == 0)
{
result = "no";
break;
}
else
{
continue;
}
}
return result;
}
/// <summary>
/// 出口委托信息解锁之权限验证---部门
/// </summary>
/// <returns></returns>
public string OpenSeaeInfoLockDepartment(string strUserID,string strGIDS)
{
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
//string strNAME = GetSHOWNAME(strUserID.Trim());
string strSQL="";
string result="have";
DataTable bsnotable ;
string[] gidArray = strGIDS.Split(',');
for (int i = 0; i < gidArray.Length; i++)
{
strSQL = "select a.bsno from (select bsno from [op_seae] where inputby in(select showname from [user] where gid in(select userid from [user_baseinfo] where deptname='" + strDEPTNAME + "')) and corpid='" + strCompany + "')a where bsno='" + gidArray[i].ToString()+ "'";
bsnotable = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSQL).Tables[0];
if (bsnotable.Rows.Count == 0)
{
result = "no";
break;
}
else
{
continue;
}
}
return result;
}
/// <summary>
/// 出口委托信息解锁之权限验证--个人
/// </summary>
/// <returns></returns>
public string OpenSeaeInfoLockPerson(string strUserID, string strGIDS)
{
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
string strSQL = "";
string result = "have";
DataTable bsnotable;
string[] gidArray = strGIDS.Split(',');
for (int i = 0; i < gidArray.Length; i++)
{
strSQL = "select a.bsno from(select bsno from [op_seae] where inputby='"+strNAME.Trim()+"' and corpid='"+strCompany.Trim()+"')a where bsno='"+gidArray[i].ToString()+"'";
bsnotable = bsnotable = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSQL).Tables[0];
if (bsnotable.Rows.Count == 0)
{
result = "no";
break;
}
else
{
continue;
}
}
return result;
}
#endregion
#region 获取openSeaiInfoUnLock进口委托信息解锁之权限验证
/// <summary>
/// 进口委托信息解锁之权限验证---分公司
/// </summary>
/// <returns></returns>
public string OpenSeaiInfoUnLockPartCompany(string strUserID, string strGIDS)
{
string strCompany = GetCORPID(strUserID.Trim());
string strSQL = "";
string result = "have";
DataTable bsnotable;
string[] gidArray = strGIDS.Split(',');
for (int i = 0; i < gidArray.Length; i++)
{
strSQL = "select a.bsno from(select bsno from [op_seai] where corpid='" + strCompany.Trim() + "')a where bsno='" + gidArray[i].ToString() + "'";
bsnotable = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSQL).Tables[0];
if (bsnotable.Rows.Count == 0)
{
result = "no";
break;
}
else
{
continue;
}
}
return result;
}
/// <summary>
/// 进口委托信息解锁之权限验证---部门
/// </summary>
/// <returns></returns>
public string OpenSeaiInfoUnLockDepartment(string strUserID, string strGIDS)
{
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
//string strNAME = GetSHOWNAME(strUserID.Trim());
string strSQL = "";
string result = "have";
DataTable bsnotable;
string[] gidArray = strGIDS.Split(',');
for (int i = 0; i < gidArray.Length; i++)
{
strSQL = "select a.bsno from (select bsno from [op_seai] where inputby in(select showname from [user] where gid in(select userid from [user_baseinfo] where deptname='" + strDEPTNAME + "')) and corpid='" + strCompany + "')a where bsno='" + gidArray[i].ToString() + "'";
bsnotable = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSQL).Tables[0];
if (bsnotable.Rows.Count == 0)
{
result = "no";
break;
}
else
{
continue;
}
}
return result;
}
/// <summary>
/// 进口委托信息解锁之权限验证--个人
/// </summary>
/// <returns></returns>
public string OpenSeaiInfoUnLockPerson(string strUserID, string strGIDS)
{
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
string strSQL = "";
string result = "have";
DataTable bsnotable;
string[] gidArray = strGIDS.Split(',');
for (int i = 0; i < gidArray.Length; i++)
{
strSQL = "select a.bsno from(select bsno from [op_seai] where inputby='" + strNAME.Trim() + "' and corpid='" + strCompany.Trim() + "')a where bsno='" + gidArray[i].ToString() + "'";
bsnotable = bsnotable = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSQL).Tables[0];
if (bsnotable.Rows.Count == 0)
{
result = "no";
break;
}
else
{
continue;
}
}
return result;
}
#endregion
#region 获取openSeaiInfoLock进口委托信息锁定之权限验证
/// <summary>
/// 进口委托信息锁定之权限验证---分公司
/// </summary>
/// <returns></returns>
public string OpenSeaiInfoLockPartCompany(string strUserID, string strGIDS)
{
string strCompany = GetCORPID(strUserID.Trim());
string strSQL = "";
string result = "have";
DataTable bsnotable;
string[] gidArray = strGIDS.Split(',');
for (int i = 0; i < gidArray.Length; i++)
{
strSQL = "select a.bsno from(select bsno from [op_seai] where corpid='" + strCompany.Trim() + "')a where bsno='" + gidArray[i].ToString() + "'";
bsnotable = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSQL).Tables[0];
if (bsnotable.Rows.Count == 0)
{
result = "no";
break;
}
else
{
continue;
}
}
return result;
}
/// <summary>
/// 进口委托信息锁定之权限验证---部门
/// </summary>
/// <returns></returns>
public string OpenSeaiInfoLockDepartment(string strUserID, string strGIDS)
{
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
//string strNAME = GetSHOWNAME(strUserID.Trim());
string strSQL = "";
string result = "have";
DataTable bsnotable;
string[] gidArray = strGIDS.Split(',');
for (int i = 0; i < gidArray.Length; i++)
{
strSQL = "select a.bsno from (select bsno from [op_seai] where inputby in(select showname from [user] where gid in(select userid from [user_baseinfo] where deptname='" + strDEPTNAME + "')) and corpid='" + strCompany + "')a where bsno='" + gidArray[i].ToString() + "'";
bsnotable = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSQL).Tables[0];
if (bsnotable.Rows.Count == 0)
{
result = "no";
break;
}
else
{
continue;
}
}
return result;
}
/// <summary>
/// 进口委托信息锁定之权限验证--个人
/// </summary>
/// <returns></returns>
public string OpenSeaiInfoLockPerson(string strUserID, string strGIDS)
{
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
string strSQL = "";
string result = "have";
DataTable bsnotable;
string[] gidArray = strGIDS.Split(',');
for (int i = 0; i < gidArray.Length; i++)
{
strSQL = "select a.bsno from(select bsno from [op_seai] where inputby='" + strNAME.Trim() + "' and corpid='" + strCompany.Trim() + "')a where bsno='" + gidArray[i].ToString() + "'";
bsnotable = bsnotable = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSQL).Tables[0];
if (bsnotable.Rows.Count == 0)
{
result = "no";
break;
}
else
{
continue;
}
}
return result;
}
#endregion
#region 获取modSeaExportInfoBlissueSelect提单流转查询
/// <summary>
/// 提单流转查询----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetBlissueSelectCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
alt = "select BSNO FROM VW_OP_BLISSUE where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))";
return alt;
}
/// <summary>
/// 提单流转查询----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetBlissueSelectCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM VW_OP_BLISSUE where BSNO='" + strGID.Trim() + "' and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))");
}
return alt;
}
/// <summary>
/// 提单流转查询----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetBlissueSelectDEPT(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select BSNO FROM VW_OP_BLISSUE where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%'))";
return alt;
}
/// <summary>
/// 提单流转查询----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetBlissueSelectDEPT(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM VW_OP_BLISSUE where BSNO='" + strGID.Trim() + "' and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%'))");
}
return alt;
}
/// <summary>
/// 提单流转查询----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetBlissueSelectPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select BSNO FROM VW_OP_BLISSUE where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')";
return alt;
}
/// <summary>
/// 提单流转查询----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetBlissueSelectPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM VW_OP_BLISSUE where BSNO='" + strGID.Trim() + "' and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or DOC like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')");
}
return alt;
}
#endregion
#region 获取modSeaExportInfoBlissuelist提单签发申请
/// <summary>
/// 提单签发申请----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetBlissueListCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
alt = "select BSNO FROM op_blissuelist where OPNAME in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))";
return alt;
}
/// <summary>
/// 提单签发申请----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetBlissueListCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM op_blissuelist where BSNO='" + strGID.Trim() + "' and OPNAME in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))");
}
return alt;
}
/// <summary>
/// 提单签发申请----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetBlissueListDEPT(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select BSNO FROM op_blissuelist where OPNAME in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (OPNAME in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (OPNAME like '%" + strNAME + "%'))";
return alt;
}
/// <summary>
/// 提单签发申请----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetBlissueListDEPT(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM op_blissuelist where BSNO='" + strGID.Trim() + "' and OPNAME in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (OPNAME in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (OPNAME like '%" + strNAME + "%'))");
}
return alt;
}
/// <summary>
/// 提单签发申请----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetBlissueListPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select BSNO FROM op_blissuelist where OPNAME in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (OPNAME like '%" + strNAME + "%')";
return alt;
}
/// <summary>
/// 提单签发申请----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetBlissueListPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM op_blissuelist where BSNO='" + strGID.Trim() + "' and OPNAME in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (OPNAME like '%" + strNAME + "%')");
}
return alt;
}
#endregion
#region 获取modSeaImportList海运进口委托管理列表
/// <summary>
/// 海运进口委托管理列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetSeaImportListCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
alt = "select BSNO FROM op_seai where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))";
return alt;
}
/// <summary>
/// 海运进口委托管理列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetSeaImportListCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("BSNO", "select BSNO FROM op_seai where BSNO in('" + strGID.Trim() + "') and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))");
}
return alt;
}
/// <summary>
/// 海运进口委托管理列表----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetSeaImportListDEPT(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select BSNO FROM op_seai where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')) ";
return alt;
}
/// <summary>
/// 海运进口委托管理列表----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetSeaImportListDEPT(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("BSNO", "select BSNO FROM op_seai where BSNO in('" + strGID.Trim() + "') and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')) ");
}
return alt;
}
/// <summary>
/// 海运进口委托管理列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetSeaImportListPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select BSNO FROM op_seai where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')";
return alt;
}
/// <summary>
/// 海运进口委托管理列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetSeaImportListPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("BSNO", "select BSNO FROM op_seai where BSNO in('" + strGID.Trim() + "') and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (SALE like '%" + strNAME + "%' or OP like '%" + strNAME + "%' or CUSTSERVICE like '%" + strNAME + "%')");
}
return alt;
}
#endregion
#region 获取modEBPricequeryLogList销售运价日志查询列表
/// <summary>
/// 销售运价日志查询列表----分公司权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetEBPricequeryLogListCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
alt = "select GID FROM crm_price_carrier_log where CREATEUSER in (select GID from [info_client] where CORPID='" + strCompany + "') or CREATEUSER='' or CREATEUSER is null";
return alt;
}
/// <summary>
/// 销售运价日志查询列表----分公司权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetEBPricequeryLogListCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_price_carrier_log where GID='" + strGID.Trim() + "' and (CREATEUSER in (select GID from [info_client] where CORPID='" + strCompany + "') or CREATEUSER='' or CREATEUSER is null)");
}
return alt;
}
/// <summary>
/// 销售运价日志查询列表----部门权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetEBPricequeryLogListDEPT(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select GID FROM crm_price_carrier_log where CREATEUSER in (select GID from [info_client] where CORPID='" + strCompany + "' and (SALE in (select u.GID from user_baseinfo ub inner join [user] u on ub.USERID=u.GID where ub.DEPTNAME='" + strDEPTNAME + "') or SALE like '%" + strUserID + "%')) or CREATEUSER='' or CREATEUSER is null";
return alt;
}
/// <summary>
/// 销售运价日志查询列表----部门权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetEBPricequeryLogListDEPT(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_price_carrier_log where GID='" + strGID.Trim() + "' and CREATEUSER in (select GID from [info_client] where CORPID='" + strCompany + "' and (SALE in (select u.GID from user_baseinfo ub inner join [user] u on ub.USERID=u.GID where ub.DEPTNAME='" + strDEPTNAME + "') or SALE like '%" + strUserID + "%')) or CREATEUSER='' or CREATEUSER is null");
}
return alt;
}
/// <summary>
/// 销售运价日志查询列表----个人权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetEBPricequeryLogListPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select GID FROM crm_price_carrier_log where CREATEUSER in (select GID from [info_client] where CORPID='" + strCompany + "' and SALE like '%" + strUserID + "%') or CREATEUSER='' or CREATEUSER is null";
return alt;
}
/// <summary>
/// 销售运价日志查询列表----个人权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetEBPricequeryLogListPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_price_carrier_log where GID='" + strGID.Trim() + "' and (CREATEUSER in (select GID from [info_client] where CORPID='" + strCompany + "' and SALE like '%" + strUserID + "%') or CREATEUSER='' or CREATEUSER is null)");
}
return alt;
}
#endregion
#region 获取modCrmPriceCarrierList运价查询列表 / modCrmPriceCarrierSellList运价销售报价查询列表
/// <summary>
/// modCrmPriceCarrierList运价查询列表 / modCrmPriceCarrierSellList运价查询列表----分公司权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetCrmPriceCarrierListCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
alt = "select GID FROM crm_price_carrier where CORPID='" + strCompany + "'";
return alt;
}
/// <summary>
/// modCrmPriceCarrierList运价查询列表 / modCrmPriceCarrierSellList运价查询列表----分公司权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCrmPriceCarrierListCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_price_carrier where GID='" + strGID.Trim() + "' and CORPID='" + strCompany + "'");
}
return alt;
}
/// <summary>
/// modCrmPriceCarrierList运价查询列表 / modCrmPriceCarrierSellList运价查询列表----部门权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetCrmPriceCarrierListDEPT(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select GID FROM crm_price_carrier where CORPID='" + strCompany + "' and (MODIFIEDUSER in (select u.GID from user_baseinfo ub inner join [user] u on ub.USERID=u.GID where ub.DEPTNAME='" + strDEPTNAME + "') or MODIFIEDUSER like '%" + strUserID + "%')";//INPUTBY
return alt;
}
/// <summary>
/// modCrmPriceCarrierList运价查询列表 / modCrmPriceCarrierSellList运价查询列表----部门权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCrmPriceCarrierListDEPT(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_price_carrier where GID='" + strGID.Trim() + "' and CORPID='" + strCompany + "' and (MODIFIEDUSER in (select u.GID from user_baseinfo ub inner join [user] u on ub.USERID=u.GID where ub.DEPTNAME='" + strDEPTNAME + "') or MODIFIEDUSER like '%" + strUserID + "%')");//INPUTBY
}
return alt;
}
/// <summary>
/// modCrmPriceCarrierList运价查询列表 / modCrmPriceCarrierSellList运价查询列表----个人权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCrmPriceCarrierListPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select GID FROM crm_price_carrier where CORPID='" + strCompany + "' and MODIFIEDUSER like '%" + strUserID + "%'";//INPUTBY
return alt;
}
/// <summary>
/// modCrmPriceCarrierList运价查询列表 / modCrmPriceCarrierSellList运价查询列表----个人权限
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCrmPriceCarrierListPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_price_carrier where GID='" + strGID.Trim() + "' and CORPID='" + strCompany + "' and MODIFIEDUSER like '%" + strUserID + "%'");//INPUTBY
}
return alt;
}
#endregion
#region 获取modCRMClientList潜在客户列表
/// <summary>
/// 潜在客户列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetCRMClientListCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
alt = "select GID FROM crm_info_client where (CORPID='" + strCompany + "' or gid in(select clientid from info_client_share where ISSHARE=1 and companyid='" + strCompany + "'))";
return alt;
}
/// <summary>
/// 潜在客户列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMClientListCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_info_client where GID='" + strGID.Trim() + "'");// and CORPID='" + strCompany + "'
}
return alt;
}
/// <summary>
/// 潜在客户列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMClientListPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select GID FROM crm_info_client where (SALE like '%" + strNAME + "%' or OPNAME like '%" + strNAME + "%')";//CORPID='" + strCompany + "' and
return alt;
}
/// <summary>
/// 潜在客户列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMClientListPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_info_client where GID='" + strGID.Trim() + "' and (SALE like '%" + strNAME + "%' or OPNAME like '%" + strNAME + "%')");// and CORPID='" + strCompany + "'
}
return alt;
}
#endregion
#region 获取modCRMClientVisitList潜在客户拜访记录列表
/// <summary>
/// 潜在客户拜访记录列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetCRMClientVisitListCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
alt = "select GID FROM crm_info_client_visit where CLIENTGID in(select clientid from crm_info_client where ISSHARE=1 and CORPID='" + strCompany + "')";//CORPID='" + strCompany + "' or
return alt;
}
/// <summary>
/// 潜在客户拜访记录列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMClientVisitListCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_info_client_visit where GID='" + strGID.Trim() + "'");// and CORPID='" + strCompany + "'
}
return alt;
}
/// <summary>
/// 潜在客户拜访记录列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMClientVisitListPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select GID FROM crm_info_client_visit where (SALE like '%" + strNAME + "%' or CREATEUSER like '%" + strNAME + "%' or MODIFIEDUSER like '%" + strNAME + "%')";//CORPID='" + strCompany + "' and
return alt;
}
/// <summary>
/// 潜在客户拜访记录列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMClientVisitListPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_info_client_visit where GID='" + strGID.Trim() + "' and (SALE like '%" + strNAME + "%' or CREATEUSER like '%" + strNAME + "%' or MODIFIEDUSER like '%" + strNAME + "%')");// and CORPID='" + strCompany + "'
}
return alt;
}
#endregion
#region 获取modCRMInfoFaqList潜在客户询价记录列表
/// <summary>
/// 潜在客户询价记录列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetCRMInfoFaqListCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select GID FROM crm_info_faq where CLIENTGID in(select clientid from crm_info_client where ISSHARE=1 and CORPID='" + strCompany + "')";// or FAQREPLYMAN='" + strNAME + "' and CORPID='" + strCompany + "' or
return alt;
}
/// <summary>
/// 潜在客户询价记录列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMInfoFaqListCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select top 1 GID FROM crm_info_faq where GID='" + strGID.Trim() + "'");// or FAQREPLYMAN='" + strNAME + "' and CORPID='" + strCompany + "'
}
return alt;
}
/// <summary>
/// 潜在客户询价记录列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMInfoFaqListPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select GID FROM crm_info_faq where CREATEUSER like '%" + strUserID + "%' or FAQREPLYMAN='" + strNAME + "'";//CORPID='" + strCompany + "' and
return alt;
}
/// <summary>
/// 潜在客户询价记录列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMInfoFaqListPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select top 1 GID FROM crm_info_faq where GID='" + strGID.Trim() + "' and (CREATEUSER like '%" + strUserID + "%' or FAQREPLYMAN='" + strNAME + "')");// and CORPID='" + strCompany + "'
}
return alt;
}
#endregion
#region 获取modCRMClientQuotationList潜在客户报价记录列表
/// <summary>
/// 潜在客户报价记录列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetCRMClientQuotationListCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
alt = "select GID FROM crm_quotation where CLIENTGID in(select clientid from crm_info_client where ISSHARE=1 and CORPID='" + strCompany + "')";//CORPID='" + strCompany + "' or
return alt;
}
/// <summary>
/// 潜在客户报价记录列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMClientQuotationListCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_quotation where GID='" + strGID.Trim() + "'");// and CORPID='" + strCompany + "'
}
return alt;
}
/// <summary>
/// 潜在客户报价记录列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMClientQuotationListPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select GID FROM crm_quotation where (SALE like '%" + strNAME + "%' or CREATEUSER like '%" + strNAME + "%' or MODIFIEDUSER like '%" + strNAME + "%')";//CORPID='" + strCompany + "' and
return alt;
}
/// <summary>
/// 潜在客户报价记录列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCRMClientQuotationListPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("GID", "select GID FROM crm_quotation where GID='" + strGID.Trim() + "' and (SALE like '%" + strNAME + "%' or CREATEUSER like '%" + strNAME + "%' or MODIFIEDUSER like '%" + strNAME + "%')");// and CORPID='" + strCompany + "'
}
return alt;
}
#endregion
#region 获取modSeaImportLCLList海运进口散货委托管理列表
/// <summary>
/// 海运进口散货委托管理列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetSeaImportLCLListCompany(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
alt = "select BSNO FROM op_seai where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))";
return alt;
}
/// <summary>
/// 海运进口散货委托管理列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetSeaImportLCLListCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM op_seai where BSNO='" + strGID.Trim() + "' and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))");
}
return alt;
}
/// <summary>
/// 海运进口散货委托管理列表----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetSeaImportLCLListDEPT(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select BSNO FROM op_seai where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (INPUTBY like '%" + strNAME + "%')) ";
return alt;
}
/// <summary>
/// 海运进口散货委托管理列表----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetSeaImportLCLListDEPT(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM op_seai where BSNO='" + strGID.Trim() + "' and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or (INPUTBY like '%" + strNAME + "%')) ");
}
return alt;
}
/// <summary>
/// 海运进口散货委托管理列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetSeaImportLCLListPerson(string strUserID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
alt = "select BSNO FROM op_seai where INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY like '%" + strNAME + "%')";
return alt;
}
/// <summary>
/// 海运进口散货委托管理列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetSeaImportLCLListPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
alt = GetStrSQL("BSNO", "select BSNO FROM op_seai where BSNO='" + strGID.Trim() + "' and INPUTBY in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (INPUTBY like '%" + strNAME + "%')");
}
return alt;
}
#endregion
#region 获取modSaleProfitReport销售业绩查询列表范围
/// <summary>
/// 销售业绩查询列表范围----分公司
/// </summary>
/// <param name="strUserID">分公司GID</param>
/// <returns></returns>
public String GetSaleProfitReportCompany(string strCompanyID,string strShowName)
{
string alt = "select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompanyID + "')"
+ " union all "
+ "select codename from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompanyID + "')";
return alt;
}
/// <summary>
/// 销售业绩查询列表范围----部门
/// </summary>
public String GetSaleProfitReportDEPT(string strCompanyID,string strDeptName,string strShowName)
{
string alt = "select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompanyID + "') and (GID in (select USERID from user_baseinfo where DEPTNAME='" + strDeptName + "') or SHOWNAME='" + strShowName + "')"
+ " union all "
+ "select codename from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompanyID + "') and (GID in (select USERID from user_baseinfo where DEPTNAME='" + strDeptName + "') or codename='" + strShowName + "')";
return alt;
}
/// <summary>
/// 销售业绩查询列表范围----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetSaleProfitReportPerson(string strCompanyID, string strShowName)
{
string alt = "select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompanyID + "') and SHOWNAME='" + strShowName + "'"
+ " union all "
+ "select codename from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompanyID + "') and codename='" + strShowName + "'";
return alt;
}
#endregion
#region 获取modWmsFeeLock仓储费用入账
/// <summary>
/// modWmsFeeLock仓储费用入账和撤销----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsFeeLockCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
string sSQL = "select GID FROM (SELECT GID,WMSOP as CREATEUSER FROM wms UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_out.CREATEUSER) FROM wms_out UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_fee.CREATEUSER) FROM wms_fee) as w where GID in ('" + strGID.Trim() + "') and CREATEUSER in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))";
alt = GetStrSQL("GID", sSQL);
}
return alt;
}
/// <summary>
/// modWmsFeeLock仓储费用入账和撤销----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsFeeLockDEPT(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
string sSQL = "select GID FROM (SELECT GID,WMSOP as CREATEUSER FROM wms UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_out.CREATEUSER) FROM wms_out UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_fee.CREATEUSER) FROM wms_fee) as w where GID in ('" + strGID.Trim() + "') and CREATEUSER in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (CREATEUSER in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or CREATEUSER like '%" + strNAME + "%')";
alt = GetStrSQL("GID", sSQL);
}
return alt;
}
/// <summary>
/// modWmsFeeLock仓储费用入账和撤销----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsFeeLockPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
string sSQL = "select GID FROM (SELECT GID,WMSOP as CREATEUSER FROM wms UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_out.CREATEUSER) FROM wms_out UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_fee.CREATEUSER) FROM wms_fee) as w where GID in ('" + strGID.Trim() + "') and CREATEUSER in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and CREATEUSER like '%" + strNAME + "%'";
alt = GetStrSQL("GID", sSQL);
}
return alt;
}
#endregion
#region 获取modWmsFeeRejected仓储费用取消入账
/// <summary>
/// modWmsFeeRejected仓储费用入账和撤销----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsFeeRejectedCompany(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
string sSQL = "select GID FROM (SELECT GID,WMSOP as CREATEUSER FROM wms UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_out.CREATEUSER) FROM wms_out UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_fee.CREATEUSER) FROM wms_fee) as w where GID in ('" + strGID.Trim() + "') and CREATEUSER in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "'))";
alt = GetStrSQL("GID", sSQL);
}
return alt;
}
/// <summary>
/// modWmsFeeRejected仓储费用入账和撤销----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsFeeRejectedDEPT(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strDEPTNAME = GetDEPTNAME(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
string sSQL = "select GID FROM (SELECT GID,WMSOP as CREATEUSER FROM wms UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_out.CREATEUSER) FROM wms_out UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_fee.CREATEUSER) FROM wms_fee) as w where GID in ('" + strGID.Trim() + "') and CREATEUSER in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and (CREATEUSER in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDEPTNAME + "')) or CREATEUSER like '%" + strNAME + "%')";
alt = GetStrSQL("GID", sSQL);
}
return alt;
}
/// <summary>
/// modWmsFeeRejected仓储费用入账和撤销----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsFeeRejectedPerson(string strUserID, string strGID)
{
string alt = "";
string strCompany = GetCORPID(strUserID.Trim());
string strNAME = GetSHOWNAME(strUserID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
string sSQL = "select GID FROM (SELECT GID,WMSOP as CREATEUSER FROM wms UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_out.CREATEUSER) FROM wms_out UNION SELECT GID,CREATEUSER=(select top 1 SHOWNAME from [user] where GID=wms_fee.CREATEUSER) FROM wms_fee) as w where GID in ('" + strGID.Trim() + "') and CREATEUSER in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompany + "')) and CREATEUSER like '%" + strNAME + "%'";
alt = GetStrSQL("GID", sSQL);
}
return alt;
}
#endregion
#region 获取modWmsList仓储入库列表
/// <summary>
/// 仓储入库列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetWmsListCompany(string strCompanyID)
{
string alt = "";
alt = "select gid FROM wms where WMSOP in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompanyID + "')) or CORPID='" + strCompanyID + "'";
return alt;
}
/// <summary>
/// 仓储入库列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsListCompany(string strCompanyID, string strGID)
{
string alt = "";
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("gid", "select gid FROM wms where gid in('" + strGID.Trim() + "') and (WMSOP in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompanyID + "')) or CORPID='" + strCompanyID + "')");
}
return alt;
}
/// <summary>
/// 仓储入库列表----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetWmsListDEPT(string strDeptName, string strCompanyID, string strShowName)
{
string alt = "";
string strCompany = GetCORPNAME(strCompanyID.Trim());
alt = "select gid FROM wms where WMSOP in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDeptName + "' and COMPANYNAME='" + strCompany + "')) or WMSOP like '%" + strShowName + "%'";
return alt;
}
/// <summary>
/// 仓储入库列表----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsListDEPT(string strDeptName, string strGID, string strCompanyID, string strShowName)
{
string alt = "";
string strCompany = GetCORPNAME(strCompanyID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("gid", "select gid FROM wms where gid in('" + strGID.Trim() + "') and (WMSOP in (select SHOWNAME from [user] where GID in (select USERID from user_baseinfo where DEPTNAME='" + strDeptName + "' and COMPANYNAME='" + strCompany + "')) or WMSOP like '%" + strShowName + "%') ");
}
return alt;
}
/// <summary>
/// 仓储入库列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsListPerson(string strShowName, string strCompanyID)
{
string alt = "";
alt = "select gid FROM wms where WMSOP in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompanyID + "')) and (WMSOP like '%" + strShowName + "%')";
return alt;
}
/// <summary>
/// 仓储入库列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsListPerson(string strShowName, string strGID, string strCompanyID)
{
string alt = "";
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("gid", "select gid FROM wms where gid in('" + strGID.Trim() + "') and WMSOP in (select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + strCompanyID + "')) and (WMSOP like '%" + strShowName + "%')");
}
return alt;
}
#endregion
#region 获取modWmsOutList仓储出库列表
/// <summary>
/// 仓储出库列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetWmsOutListCompany(string strCompanyID)
{
string alt = "";
alt = "select gid FROM wms_out where CREATEUSER in (select USERID from user_company where COMPANYID='" + strCompanyID + "') or CORPID='" + strCompanyID + "'";
return alt;
}
/// <summary>
/// 仓储出库列表----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsOutListCompany(string strCompanyID, string strGID)
{
string alt = "";
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("BSNO", "select gid FROM wms_out where gid in('" + strGID.Trim() + "') and (CREATEUSER in (select USERID from user_company where COMPANYID='" + strCompanyID + "') or CORPID='" + strCompanyID + "')");
}
return alt;
}
/// <summary>
/// 仓储出库列表----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <returns></returns>
public String GetWmsOutListDEPT(string strDeptName, string strCompanyID, string strUserID)
{
string alt = "";
string strCompany = GetCORPNAME(strCompanyID.Trim());
alt = "select gid FROM wms_out where CREATEUSER in (select USERID from user_baseinfo where DEPTNAME='" + strDeptName + "' and COMPANYNAME='" + strCompany + "') or CREATEUSER like '%" + strUserID + "%'";
return alt;
}
/// <summary>
/// 仓储出库列表----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsOutListDEPT(string strDeptName, string strGID, string strCompanyID, string strUserID)
{
string alt = "";
string strCompany = GetCORPNAME(strCompanyID.Trim());
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("gid", "select gid FROM wms_out where gid in('" + strGID.Trim() + "') and (CREATEUSER in (select USERID from user_baseinfo where DEPTNAME='" + strDeptName + "' and COMPANYNAME='" + strCompany + "') or CREATEUSER like '%" + strUserID + "%') ");
}
return alt;
}
/// <summary>
/// 仓储出库列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsOutListPerson(string strUserID, string strCompanyID)
{
string alt = "";
alt = "select gid FROM wms_out where CREATEUSER in (select USERID from user_company where COMPANYID='" + strCompanyID + "') and (CREATEUSER like '%" + strUserID + "%')";
return alt;
}
/// <summary>
/// 仓储出库列表----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetWmsOutListPerson(string strUserID, string strGID, string strCompanyID)
{
string alt = "";
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("gid", "select gid FROM wms_out where gid in('" + strGID.Trim() + "') and CREATEUSER in (select USERID from user_company where COMPANYID='" + strCompanyID + "') and (CREATEUSER like '%" + strUserID + "%')");
}
return alt;
}
#endregion
#region 获取modImportReceiptRange利润报表查询
/// <summary>
/// 应收应付费用总表--分公司
/// </summary>
/// <returns></returns>
public string GetImportReceiptListCompany(string strCompanyID)
{
string addSQL = " and CORPID='" + strCompanyID.Trim() + "' ";
return addSQL;
}
/// <summary>
/// 应收应付费用总表--部门
/// </summary>
/// <param name="companyid"></param>
/// <param name="name"></param>
/// <param name="userid"></param>
/// <returns></returns>
public string GetImportReceiptListDEPT(string strCompanyID, string strShowName, string strDeptName)
{
string addSQL = " and CORPID='" + strCompanyID.Trim() + "' and ( ENTEROPERATOR in (select showname from [user] where gid in (select userid from [user_baseinfo] where deptname='" + strDeptName.Trim() + "')) or ENTEROPERATOR like '%" + strShowName.Trim() + "%')";
return addSQL;
}
/// <summary>
/// 应收应付费用总表--个人
/// </summary>
/// <param name="strCompanyID"></param>
/// <param name="strShowName"></param>
/// <returns></returns>
public string GetImportReceiptListPerson(string strCompanyID, string strShowName)
{
string addSQL = " and CORPID='" + strCompanyID.Trim() + "' and ENTEROPERATOR like '%" + strShowName.Trim() + "%'";
return addSQL;
}
#endregion
#region 获取modCodeFeeTemplateSet费用模板管理表权限范围
/// <summary>
/// 费用模板管理表权限范围--分公司
/// </summary>
/// <returns></returns>
public string GetCodeFeeTemplateSetCompany(string strCompanyID)
{
string addSQL = " and CORPID='" + strCompanyID.Trim() + "' ";
return addSQL;
}
/// <summary>
/// 费用模板管理表权限范围----分公司
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCodeFeeTemplateSetCompany(string strCompanyID, string strGID)
{
string alt = "";
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("gid", "select gid FROM code_fee_template where gid in('" + strGID.Trim() + "') and CORPID='" + strCompanyID.Trim() + "'");
}
return alt;
}
/// <summary>
/// 费用模板管理表权限范围--部门
/// </summary>
/// <param name="companyid"></param>
/// <param name="name"></param>
/// <param name="userid"></param>
/// <returns></returns>
public string GetCodeFeeTemplateSetDEPT(string strCompanyID, string strUserID, string strDeptName)
{
string addSQL = " and CORPID='" + strCompanyID.Trim() + "' and ( CREATEUSER in (select gid from [user] where gid in (select userid from [user_baseinfo] where deptname='" + strDeptName.Trim() + "')) or CREATEUSER='" + strUserID.Trim() + "')";
return addSQL;
}
/// <summary>
/// 费用模板管理表权限范围----部门
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCodeFeeTemplateSetDEPT(string strDeptName, string strGID, string strCompanyID, string strUserID)
{
string alt = "";
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("gid", "select gid FROM code_fee_template where gid in('" + strGID.Trim() + "') and CORPID='" + strCompanyID.Trim() + "' and ( CREATEUSER in (select gid from [user] where gid in (select userid from [user_baseinfo] where deptname='" + strDeptName.Trim() + "')) or CREATEUSER='" + strUserID.Trim() + "')");
}
return alt;
}
/// <summary>
/// 费用模板管理表权限范围--个人
/// </summary>
/// <param name="strCompanyID"></param>
/// <param name="strShowName"></param>
/// <returns></returns>
public string GetCodeFeeTemplateSetPerson(string strCompanyID, string strUserID)
{
string addSQL = " and CORPID='" + strCompanyID.Trim() + "' and CREATEUSER='" + strUserID.Trim() + "'";
return addSQL;
}
/// <summary>
/// 费用模板管理表权限范围----个人
/// </summary>
/// <param name="strUserID">登录用户</param>
/// <param name="strRange">GID</param>
/// <returns></returns>
public String GetCodeFeeTemplateSetPerson(string strUserID, string strGID, string strCompanyID)
{
string alt = "";
if (strGID != "")
{
strGID = strGID.Replace(",", "','");
alt = GetStrSQL("gid", "select gid FROM code_fee_template where gid in('" + strGID.Trim() + "') and CORPID='" + strCompanyID.Trim() + "' and CREATEUSER='" + strUserID.Trim() + "'");
}
return alt;
}
#endregion
#region 获取modRptWmsSettlementListIndex仓储结算清单列表
/// <summary>
/// 仓储结算清单--分公司
/// </summary>
/// <returns></returns>
public string GetRptWmsSettlementListIndexCompany(string strCompanyID)
{
string addSQL = " and CORPID='" + strCompanyID.Trim() + "' ";
return addSQL;
}
/// <summary>
/// 仓储结算清单--部门
/// </summary>
/// <param name="companyid"></param>
/// <param name="name"></param>
/// <param name="userid"></param>
/// <returns></returns>
public string GetRptWmsSettlementListIndexDEPT(string strCompanyID, string strUserID, string strDeptName)
{
string addSQL = " and CORPID='" + strCompanyID.Trim() + "' and (CREATEUSER in (select showname from [user] where gid in (select userid from [user_baseinfo] where deptname='" + strDeptName.Trim() + "')) or CREATEUSER='" + strUserID.Trim() + "')";
return addSQL;
}
/// <summary>
/// 仓储结算清单--个人
/// </summary>
/// <param name="strCompanyID"></param>
/// <param name="strShowName"></param>
/// <returns></returns>
public string GetRptWmsSettlementListIndexPerson(string strCompanyID, string strUserID)
{
string addSQL = " and CORPID='" + strCompanyID.Trim() + "' and CREATEUSER='" + strUserID.Trim() + "'";
return addSQL;
}
#endregion
//
}
}