Exemple #1
0
        /// <summary>
        /// 看是否已经存在该typeid的类别
        /// </summary>
        /// <param name="typeID"></param>
        /// <returns></returns>
        public bool IfExists(string typeID)
        {
            string       strSql = "select TypeName from Tab_Nav where TypeParentID=@typeID";
            SqlParameter param  = new SqlParameter("@typeID", typeID);
            object       obj    = SqlHelps.ExecuteScalar(ConnectionString, CommandType.Text, strSql, param);

            if (obj != null && obj.ToString() != "")
            {
                return(true);
            }
            return(false);
        }
Exemple #2
0
        /// <summary>
        /// 查询个数
        /// </summary>
        /// <returns></returns>
        public int QueryCheckRolesCount(string RolesName)
        {
            StringBuilder strSqlWhere = new StringBuilder();

            strSqlWhere.Append(" 1=1");
            if (string.IsNullOrEmpty(RolesName))
            {
                strSqlWhere.Append(" and RolesName like '%" + RolesName + "%'");
            }

            string strSql = "select count(*) from tab_Roles where" + strSqlWhere.ToString() + "";

            return(Convert.ToInt32(SqlHelps.ExecuteScalar(ConnectionString, CommandType.Text, strSql)));
        }
Exemple #3
0
        /// <summary>
        /// 查询个数
        /// </summary>
        /// <returns></returns>
        public int QueryCheckUsersCount(int id)
        {
            StringBuilder strSqlWhere = new StringBuilder();

            strSqlWhere.Append(" 1=1");
            if (id != null && id != 0)
            {
                strSqlWhere.Append(" and roseId = " + id);
            }

            string strSql = "select count(*) from Tab_User where" + strSqlWhere.ToString();

            return(Convert.ToInt32(SqlHelps.ExecuteScalar(ConnectionString, CommandType.Text, strSql)));
        }
Exemple #4
0
        /// <summary>
        /// 查询个数
        /// </summary>
        /// <returns></returns>
        public int IsExistCheckRoles(string RolesName)
        {
            StringBuilder strSqlWhere = new StringBuilder();

            strSqlWhere.Append(" 1=1");
            if (!string.IsNullOrEmpty(RolesName))
            {
                strSqlWhere.Append(" and RolesName = '" + RolesName + "'");
            }

            string strSql = "select count(*) from tab_Roles where" + strSqlWhere.ToString() + "";

            return(Convert.ToInt32(SqlHelps.ExecuteScalar(SqlHelps.SQLConnString, CommandType.Text, strSql)));
        }
Exemple #5
0
        /// <summary>
        /// 查询个数
        /// </summary>
        /// <returns></returns>
        public int IsExistCheckRoles(string userNumber)
        {
            StringBuilder strSqlWhere = new StringBuilder();

            strSqlWhere.Append(" 1=1");
            if (!string.IsNullOrEmpty(userNumber))
            {
                strSqlWhere.Append(" and userNumber = '" + userNumber + "'");
            }

            string strSql = "select count(*) from Tab_User where" + strSqlWhere.ToString() + "";

            return(Convert.ToInt32(SqlHelps.ExecuteScalar(ConnectionString, CommandType.Text, strSql)));
        }
Exemple #6
0
        /// <summary>
        /// 获得数据列表个数
        /// </summary>
        /// <returns></returns>
        public int QueryCheckDiaryCount(string Begintime, string EndTimeStr)
        {
            StringBuilder strSqlWhere = new StringBuilder();

            strSqlWhere.Append(" 1=1");
            if (Begintime != "" && Begintime != null)
            {
                strSqlWhere.Append(" and convert(varchar, addtime, 23)>='" + Begintime + "'");
            }

            if (EndTimeStr != "" && EndTimeStr != null)
            {
                strSqlWhere.Append(" and convert(varchar, addtime, 23)<='" + EndTimeStr + "'");
            }

            string strSql = "select count(*) from VIEW_Diary where " + strSqlWhere + "";

            return(Convert.ToInt32(SqlHelps.ExecuteScalar(ConnectionString, CommandType.Text, strSql)));
        }