/// <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.ExecuteTable(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(); //} ddl_Editer.Items.Clear(); ddl_Editer.DataSource = dt; ddl_Editer.DataBind(); } ListItem li = new ListItem("全部人员", "0"); ddl_Editer.Items.Insert(0, li); }
/// <summary> /// 查询采购员 /// </summary> protected void SelectCgyEditer() { SOSOshop.BLL.MemberInfo mbll = new SOSOshop.BLL.MemberInfo(); cgy.Items.Clear(); cgy.DataSource = mbll.ExecuteTable("SELECT isnull(cgy,'无') cgy FROM [dbo].[Product] GROUP BY cgy"); cgy.DataBind(); ListItem li = new ListItem("全部人员", ""); cgy.Items.Insert(0, li); //li = new ListItem("无", "-1"); //cgy.Items.Add(li); if (!string.IsNullOrEmpty(Request["cgy"])) { try { cgy.SelectedValue = Request["cgy"]; } catch { } } }
/// <summary> /// 绑定外销人员 /// </summary> protected void BindOutSellPerson() { SOSOshop.BLL.MemberInfo mbll = new SOSOshop.BLL.MemberInfo(); string sql = @"SELECT DISTINCT name as ospname, adminid as ospid FROM dbo.yxs_administrators "; DataTable dt = mbll.ExecuteTable(sql); if (dt != null && dt.Rows.Count > 0) { ddlOSP.Items.Clear(); ddlOSP.DataSource = dt; ddlOSP.DataBind(); } ListItem li = new ListItem("全部人员", "0"); ddlOSP.Items.Insert(0, li); }