Ejemplo n.º 1
0
        public static IEnumerable <string> SelectExsitWhiteList(BaseDbHelper dbhelper, IEnumerable <string> pids)
        {
            List <string> list = new List <string>();

            using (var cmd = new SqlCommand(@"SELECT  PID
                                              FROM    Tuhu_bi.dbo.TireStockWhiteList AS TWL WITH ( NOLOCK )
                                              WHERE   TWL.PID IN ( SELECT *
                                                                   FROM   Tuhu_bi.dbo.Split(@pids, ';') )"))
            {
                cmd.Parameters.AddWithValue("@pids", string.Join(";", pids));
                return(dbhelper.ExecuteQuery(cmd, dt =>
                {
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        foreach (DataRow row in dt.Rows)
                        {
                            list.Add(row[0].ToString());
                        }
                    }
                    return list;
                }));
            }
        }