Exemplo n.º 1
0
        /// <summary>
        /// 获取用户借阅,并且在有效期内的文档
        /// </summary>
        public DataTable SelByUid(int uid)
        {
            string ids = "";

            SqlParameter[] sp  = new SqlParameter[] { new SqlParameter("EDate", DateTime.Now), new SqlParameter("uid", "%," + uid + ",%") };
            string         sql = "SELECT * FROM " + TbName + " WHERE EDate>@EDate AND Uids LIKE @uid";
            DataTable      dt  = SqlHelper.ExecuteTable(CommandType.Text, sql, sp);

            if (dt == null || dt.Rows.Count < 1)
            {
                return(new DataTable());
            }
            foreach (DataRow dr in dt.Rows)
            {
                ids += dr["docids"].ToString() + ",";
            }
            return(oaBll.SelByIDS(ids));
        }