コード例 #1
0
        /// <summary>
        /// 是否存在用户(修改密码用)
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        internal bool IsUserExist(EapUser user)
        {
            StringBuilder sql = new StringBuilder(200);
            sql.Append("select 1 from T_EAP_USER");
            sql.Append(" where USER_ID=:USER_ID and PWD=:PWD");

            OracleParameter[] para = {
                new OracleParameter(":USER_ID", OracleType.VarChar),
                new OracleParameter(":PWD", OracleType.VarChar)
            };
            para[0].Value = user.USER_ID;
            para[1].Value = user.PWD;
            List<EapUser> list = new List<EapUser>();
            list = Oracle.GetOracle().QueryToList<EapUser>(sql, para);

            if (list == null)
                return false;

            if (list.Count <= 0)
                return false;

            return true;
        }