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 获取信息的基本函数 /// /// 执行命令语句 /// /// public bool GetExecuteSqlCommand(string strSQL) { bool bl = SqlHelper.ExecuteSqlCommand(SqlHelper.ConnectionStringLocalTransaction, strSQL); return bl; } /// /// 返回 某字段 /// /// 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; } /// /// 返回 数据集 /// /// 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; } /// /// 返回所有 分公司代码 /// /// 用户GID /// 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; } /// /// 返回所有 分公司名称 /// /// 用户GID /// 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; } /// /// 返回有 分公司部门代码 /// /// 用户GID /// 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; } /// /// 返回有 分公司部门名称 /// /// 用户GID /// public String GetDEPTNAME(string strUserID) { string str = "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]["DEPTNAME"].ToString(); } else { str = ""; } return str; } /// /// 返回所有 用户显示名称 /// /// 用户GID /// public String GetSHOWNAME(string strUserID) { string str = "select SHOWNAME from [user] where GID='" + strUserID + "' and ISDELETED=0"; DataSet DS = SqlHelper.OpenSqlDataSet(SqlHelper.ConnectionStringLocalTransaction, str); if (DS.Tables[0].Rows.Count > 0) { str = DS.Tables[0].Rows[0]["SHOWNAME"].ToString(); } else { str = ""; } return str; } /// /// 返回所有 权限可视范围 /// /// 登录用户 /// 模块列表名 /// public 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; } /// /// 返回所有 权限可操作范围 /// /// 登录用户 /// 模块列表名 /// 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)往来单位列表 /// /// 往来单位列表----分公司 /// /// 登录用户 /// 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; } /// /// 往来单位列表----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 往来单位列表----个人 /// /// 登录用户 /// GID /// 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; } /// /// 往来单位列表----个人 /// /// 登录用户 /// GID /// 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)销售订舱审核 /// /// (modSeaeOrderList)销售订舱列表 / (modSeaeOrderAudit)销售订舱审核----分公司 /// /// 登录用户 /// 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; } /// /// (modSeaeOrderList)销售订舱列表 / (modSeaeOrderAudit)销售订舱审核----分公司 /// /// 登录用户 /// GID /// 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; } /// /// (modSeaeOrderList)销售订舱列表 / (modSeaeOrderAudit)销售订舱审核----部门 /// /// 登录用户 /// 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; } /// /// (modSeaeOrderList)销售订舱列表 / (modSeaeOrderAudit)销售订舱审核----部门 /// /// 登录用户 /// GID /// 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; } /// /// (modSeaeOrderList)销售订舱列表 / (modSeaeOrderAudit)销售订舱审核----个人 /// /// 登录用户 /// GID /// 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; } /// /// (modSeaeOrderList)销售订舱列表 / (modSeaeOrderAudit)销售订舱审核----个人 /// /// 登录用户 /// GID /// 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)委托管理列表 /// /// 委托管理列表----分公司 /// /// 登录用户 /// 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; } /// /// 委托管理列表----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 委托管理列表----部门 /// /// 登录用户 /// 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; } /// /// 委托管理列表----部门 /// /// 登录用户 /// GID /// 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; } /// /// 委托管理列表----个人 /// /// 登录用户 /// GID /// 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; } /// /// 委托管理列表----个人 /// /// 登录用户 /// GID /// 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)利润报表查询 /// /// 利润报表查询之权限--分公司 /// /// public string ProfitReportViewPartCompany(string companyid) { string addSQL = ""; addSQL = " and corpid='"+companyid.ToString().Trim()+"' "; return addSQL; } /// /// 利润报表查询之权限--部门 /// /// /// /// /// 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; } /// /// 利润报表查询之权限--个人 /// /// /// /// 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)出口委托信息解锁之权限验证 /// /// 出口委托信息解锁之权限验证---分公司 /// /// 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; } /// /// 出口委托信息解锁之权限验证---部门 /// /// 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; } /// /// 出口委托信息解锁之权限验证--个人 /// /// 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)进口委托信息解锁之权限验证 /// /// 进口委托信息解锁之权限验证---分公司 /// /// 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; } /// /// 进口委托信息解锁之权限验证---部门 /// /// 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; } /// /// 进口委托信息解锁之权限验证--个人 /// /// 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)进口委托信息锁定之权限验证 /// /// 进口委托信息锁定之权限验证---分公司 /// /// 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; } /// /// 进口委托信息锁定之权限验证---部门 /// /// 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; } /// /// 进口委托信息锁定之权限验证--个人 /// /// 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)提单流转查询 /// /// 提单流转查询----分公司 /// /// 登录用户 /// 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; } /// /// 提单流转查询----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 提单流转查询----部门 /// /// 登录用户 /// 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; } /// /// 提单流转查询----部门 /// /// 登录用户 /// GID /// 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; } /// /// 提单流转查询----个人 /// /// 登录用户 /// GID /// 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; } /// /// 提单流转查询----个人 /// /// 登录用户 /// GID /// 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)提单签发申请 /// /// 提单签发申请----分公司 /// /// 登录用户 /// 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; } /// /// 提单签发申请----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 提单签发申请----部门 /// /// 登录用户 /// 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; } /// /// 提单签发申请----部门 /// /// 登录用户 /// GID /// 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; } /// /// 提单签发申请----个人 /// /// 登录用户 /// GID /// 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; } /// /// 提单签发申请----个人 /// /// 登录用户 /// GID /// 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)海运进口委托管理列表 /// /// 海运进口委托管理列表----分公司 /// /// 登录用户 /// 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; } /// /// 海运进口委托管理列表----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 海运进口委托管理列表----部门 /// /// 登录用户 /// 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; } /// /// 海运进口委托管理列表----部门 /// /// 登录用户 /// GID /// 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; } /// /// 海运进口委托管理列表----个人 /// /// 登录用户 /// GID /// 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; } /// /// 海运进口委托管理列表----个人 /// /// 登录用户 /// GID /// 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)销售运价日志查询列表 /// /// 销售运价日志查询列表----分公司权限 /// /// 登录用户 /// 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; } /// /// 销售运价日志查询列表----分公司权限 /// /// 登录用户 /// GID /// 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; } /// /// 销售运价日志查询列表----部门权限 /// /// 登录用户 /// 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; } /// /// 销售运价日志查询列表----部门权限 /// /// 登录用户 /// GID /// 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; } /// /// 销售运价日志查询列表----个人权限 /// /// 登录用户 /// GID /// 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; } /// /// 销售运价日志查询列表----个人权限 /// /// 登录用户 /// GID /// 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)运价销售报价查询列表 /// /// (modCrmPriceCarrierList)运价查询列表 / (modCrmPriceCarrierSellList)运价查询列表----分公司权限 /// /// 登录用户 /// public String GetCrmPriceCarrierListCompany(string strUserID) { string alt = ""; string strCompany = GetCORPID(strUserID.Trim()); alt = "select GID FROM crm_price_carrier where CORPID='" + strCompany + "'"; return alt; } /// /// (modCrmPriceCarrierList)运价查询列表 / (modCrmPriceCarrierSellList)运价查询列表----分公司权限 /// /// 登录用户 /// GID /// 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; } /// /// (modCrmPriceCarrierList)运价查询列表 / (modCrmPriceCarrierSellList)运价查询列表----部门权限 /// /// 登录用户 /// 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; } /// /// (modCrmPriceCarrierList)运价查询列表 / (modCrmPriceCarrierSellList)运价查询列表----部门权限 /// /// 登录用户 /// GID /// 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; } /// /// (modCrmPriceCarrierList)运价查询列表 / (modCrmPriceCarrierSellList)运价查询列表----个人权限 /// /// 登录用户 /// GID /// 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; } /// /// (modCrmPriceCarrierList)运价查询列表 / (modCrmPriceCarrierSellList)运价查询列表----个人权限 /// /// 登录用户 /// GID /// 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)潜在客户列表 /// /// 潜在客户列表----分公司 /// /// 登录用户 /// 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; } /// /// 潜在客户列表----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 潜在客户列表----个人 /// /// 登录用户 /// GID /// 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; } /// /// 潜在客户列表----个人 /// /// 登录用户 /// GID /// 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)潜在客户拜访记录列表 /// /// 潜在客户拜访记录列表----分公司 /// /// 登录用户 /// 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; } /// /// 潜在客户拜访记录列表----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 潜在客户拜访记录列表----个人 /// /// 登录用户 /// GID /// 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; } /// /// 潜在客户拜访记录列表----个人 /// /// 登录用户 /// GID /// 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)潜在客户询价记录列表 /// /// 潜在客户询价记录列表----分公司 /// /// 登录用户 /// 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; } /// /// 潜在客户询价记录列表----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 潜在客户询价记录列表----个人 /// /// 登录用户 /// GID /// 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; } /// /// 潜在客户询价记录列表----个人 /// /// 登录用户 /// GID /// 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)潜在客户报价记录列表 /// /// 潜在客户报价记录列表----分公司 /// /// 登录用户 /// 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; } /// /// 潜在客户报价记录列表----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 潜在客户报价记录列表----个人 /// /// 登录用户 /// GID /// 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; } /// /// 潜在客户报价记录列表----个人 /// /// 登录用户 /// GID /// 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)海运进口散货委托管理列表 /// /// 海运进口散货委托管理列表----分公司 /// /// 登录用户 /// 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; } /// /// 海运进口散货委托管理列表----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 海运进口散货委托管理列表----部门 /// /// 登录用户 /// 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; } /// /// 海运进口散货委托管理列表----部门 /// /// 登录用户 /// GID /// 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; } /// /// 海运进口散货委托管理列表----个人 /// /// 登录用户 /// GID /// 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; } /// /// 海运进口散货委托管理列表----个人 /// /// 登录用户 /// GID /// 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)销售业绩查询列表范围 /// /// 销售业绩查询列表范围----分公司 /// /// 分公司GID /// 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; } /// /// 销售业绩查询列表范围----部门 /// 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; } /// /// 销售业绩查询列表范围----个人 /// /// 登录用户 /// GID /// 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)仓储费用入账 /// /// (modWmsFeeLock)仓储费用入账和撤销----分公司 /// /// 登录用户 /// GID /// 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; } /// /// (modWmsFeeLock)仓储费用入账和撤销----部门 /// /// 登录用户 /// GID /// 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; } /// /// (modWmsFeeLock)仓储费用入账和撤销----个人 /// /// 登录用户 /// GID /// 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)仓储费用取消入账 /// /// (modWmsFeeRejected)仓储费用入账和撤销----分公司 /// /// 登录用户 /// GID /// 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; } /// /// (modWmsFeeRejected)仓储费用入账和撤销----部门 /// /// 登录用户 /// GID /// 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; } /// /// (modWmsFeeRejected)仓储费用入账和撤销----个人 /// /// 登录用户 /// GID /// 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)仓储入库列表 /// /// 仓储入库列表----分公司 /// /// 登录用户 /// 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; } /// /// 仓储入库列表----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 仓储入库列表----部门 /// /// 登录用户 /// 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; } /// /// 仓储入库列表----部门 /// /// 登录用户 /// GID /// 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; } /// /// 仓储入库列表----个人 /// /// 登录用户 /// GID /// 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; } /// /// 仓储入库列表----个人 /// /// 登录用户 /// GID /// 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)仓储出库列表 /// /// 仓储出库列表----分公司 /// /// 登录用户 /// 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; } /// /// 仓储出库列表----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 仓储出库列表----部门 /// /// 登录用户 /// 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; } /// /// 仓储出库列表----部门 /// /// 登录用户 /// GID /// 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; } /// /// 仓储出库列表----个人 /// /// 登录用户 /// GID /// 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; } /// /// 仓储出库列表----个人 /// /// 登录用户 /// GID /// 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)利润报表查询 /// /// 应收应付费用总表--分公司 /// /// public string GetImportReceiptListCompany(string strCompanyID) { string addSQL = " and CORPID='" + strCompanyID.Trim() + "' "; return addSQL; } /// /// 应收应付费用总表--部门 /// /// /// /// /// 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; } /// /// 应收应付费用总表--个人 /// /// /// /// public string GetImportReceiptListPerson(string strCompanyID, string strShowName) { string addSQL = " and CORPID='" + strCompanyID.Trim() + "' and ENTEROPERATOR like '%" + strShowName.Trim() + "%'"; return addSQL; } #endregion #region 获取(modCodeFeeTemplateSet)费用模板管理表权限范围 /// /// 费用模板管理表权限范围--分公司 /// /// public string GetCodeFeeTemplateSetCompany(string strCompanyID) { string addSQL = " and CORPID='" + strCompanyID.Trim() + "' "; return addSQL; } /// /// 费用模板管理表权限范围----分公司 /// /// 登录用户 /// GID /// 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; } /// /// 费用模板管理表权限范围--部门 /// /// /// /// /// 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; } /// /// 费用模板管理表权限范围----部门 /// /// 登录用户 /// GID /// 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; } /// /// 费用模板管理表权限范围--个人 /// /// /// /// public string GetCodeFeeTemplateSetPerson(string strCompanyID, string strUserID) { string addSQL = " and CORPID='" + strCompanyID.Trim() + "' and CREATEUSER='" + strUserID.Trim() + "'"; return addSQL; } /// /// 费用模板管理表权限范围----个人 /// /// 登录用户 /// GID /// 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)仓储结算清单列表 /// /// 仓储结算清单--分公司 /// /// public string GetRptWmsSettlementListIndexCompany(string strCompanyID) { string addSQL = " and CORPID='" + strCompanyID.Trim() + "' "; return addSQL; } /// /// 仓储结算清单--部门 /// /// /// /// /// 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; } /// /// 仓储结算清单--个人 /// /// /// /// public string GetRptWmsSettlementListIndexPerson(string strCompanyID, string strUserID) { string addSQL = " and CORPID='" + strCompanyID.Trim() + "' and CREATEUSER='" + strUserID.Trim() + "'"; return addSQL; } #endregion // } }