/// <summary> /// 查询交易员 /// </summary> protected void SelectEditer() { SOSOshop.BLL.MemberInfo mbll = new SOSOshop.BLL.MemberInfo(); string sqlText5 = "SELECT DISTINCT adminid AS id,name FROM yxs_administrators WHERE name<>'admin'"; DataTable dt = mbll.ExecuteTableForCache(sqlText5); if (dt != null && dt.Rows.Count > 0) { sqlText5 = "SELECT ',' + REPLACE(REPLACE(STUFF((SELECT CAST(i AS varchar) + ',' AS a FROM (SELECT DISTINCT b.name AS i FROM memberinfo a INNER JOIN yxs_administrators b ON a.Editer=b.adminid) AS t FOR XML path('')), 1, 0, ''), '<a>', ''), '</a>', '')"; string _101Admin = Convert.ToString(mbll.ExecuteScalarForCache(sqlText5)); dt.Columns.Add("OK", typeof(int)); sqlText5 = "SELECT ',' + REPLACE(REPLACE(STUFF((SELECT CAST(i AS varchar) + ',' AS a FROM (SELECT DISTINCT LTRIM(RTRIM(zhiyname)) AS i FROM zhiyzl WHERE beactive='是' AND issp='是' AND jigid='000') AS t FOR XML path('')), 1, 0, ''), '<a>', ''), '</a>', '')"; //DbBase db2 = new DbBase(); db2.ChangeDB("ConnectionStringERP"); //string ErpAdmin = Convert.ToString(db2.ExecuteScalarForCache(sqlText5)); //foreach (DataRow dr in dt.Rows) //{ // //处理Erp中有没有 // if (!_101Admin.Contains("," + dr[1] + ",") && !ErpAdmin.Contains("," + dr[1] + ",")) dr.Delete(); //} ddlEditer.Items.Clear(); ddlEditer.DataSource = dt; ddlEditer.DataBind(); } ListItem li = new ListItem("全部人员", ""); ddlEditer.Items.Insert(0, li); li = new ListItem("无", "0"); ddlEditer.Items.Add(li); }
/// <summary> /// 查询交易员 /// </summary> protected void SelectEditer() { SOSOshop.BLL.MemberInfo mbll = new SOSOshop.BLL.MemberInfo(); string sqlText5 = "SELECT DISTINCT adminid AS id,name FROM yxs_administrators WHERE name<>'admin'"; DataTable dt = mbll.ExecuteTableForCache(sqlText5); if (dt != null && dt.Rows.Count > 0) { sqlText5 = "SELECT ',' + REPLACE(REPLACE(STUFF((SELECT CAST(i AS varchar) + ',' AS a FROM (SELECT DISTINCT b.name AS i FROM memberinfo a INNER JOIN yxs_administrators b ON a.Editer=b.adminid) AS t FOR XML path('')), 1, 0, ''), '<a>', ''), '</a>', '')"; string _101Admin = Convert.ToString(mbll.ExecuteScalarForCache(sqlText5)); dt.Columns.Add("OK", typeof(int)); ddlEditer.Items.Clear(); ddlEditer.DataSource = dt; ddlEditer.DataBind(); } ListItem li = new ListItem("全部人员", ""); ddlEditer.Items.Insert(0, li); li = new ListItem("无", "0"); ddlEditer.Items.Add(li); }