Ejemplo n.º 1
0
        /// <summary>
        /// 菜单名称是否相同
        /// </summary>
        public bool ExistsMenuName(string menuName)
        {
            StringBuilder strSql = new StringBuilder();
            string        name   = string.Empty;

            strSql.Append("select Sname from SysMenuTab");
            strSql.Append(" where Sname=@Sname ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Sname", SqlDbType.VarChar, 100)
            };
            parameters[0].Value = menuName;

            SqlDataReader reader = crm.ExecuteReaders(strSql.ToString(), parameters);

            if (reader.Read())
            {
                name = reader["Sname"].ToString();
            }
            if (name.Equals(menuName))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }