Exemplo n.º 1
0
        /// <summary>
        /// 查询关系数量
        /// </summary>
        /// <param name="rtype"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public int GetUserExpandCount(Enums.UserExpandType rtype, string userId)
        {
            var strWhere = GetSqlWhereByParm(rtype, userId);
            var result   = GetCount <Model.UserExpand>(strWhere);

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 查询关系数量
        /// </summary>
        /// <param name="rtype"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public string GetUserExpandValue(Enums.UserExpandType rtype, string userId)
        {
            var userExpand = GetUserExpand(rtype, userId);

            if (userExpand == null)
            {
                return(null);
            }
            return(userExpand.DataValue);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 根据参数构造查询语句
        /// </summary>
        /// <param name="rtype"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public string GetSqlWhereByParm(Enums.UserExpandType rtype, string userId, string websiteOwner = "")
        {
            string        type     = CommonPlatform.Helper.EnumStringHelper.ToString(rtype);
            StringBuilder strWhere = new StringBuilder();

            strWhere.AppendFormat(" DataType = '{0}' ", type);

            if (!string.IsNullOrWhiteSpace(userId))
            {
                strWhere.AppendFormat(" AND  UserId = '{0}' ", userId);
            }
            if (!string.IsNullOrEmpty(websiteOwner))
            {
                strWhere.AppendFormat(" AND  WebsiteOwner = '{0}' ", websiteOwner);
            }

            return(strWhere.ToString());
        }
Exemplo n.º 4
0
        /// <summary>
        /// 查询关系数量
        /// </summary>
        /// <param name="rtype"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public Model.UserExpand GetUserExpand(Enums.UserExpandType rtype, string userId, string websiteOwner = "")
        {
            var strWhere = GetSqlWhereByParm(rtype, userId, websiteOwner);

            return(Get <Model.UserExpand>(strWhere));
        }