public bool HasPasswords()
        {
            StringBuilder queryBuilder = new StringBuilder();

            queryBuilder.AppendFormat( "SELECT COUNT(*) FROM ACCOUNT" );

            SqlCore sql = new SqlCore( DataUtils.GetConnectionString() );
            sql.Open();
            int num = Convert.ToInt32( sql.DoScalarQuery( queryBuilder.ToString() ) );
            sql.Close();

            return num > 0;
        }
        public bool CheckPassword( string password )
        {
            StringBuilder queryBuilder = new StringBuilder();

            string pswd = password.Replace( "'", "''" );

            queryBuilder.AppendFormat( "SELECT COUNT(*) FROM ACCOUNT WHERE PASSWORD = '******'", pswd );

            SqlCore sql = new SqlCore( DataUtils.GetConnectionString() );
            sql.Open();
            int num = Convert.ToInt32(sql.DoScalarQuery( queryBuilder.ToString() ));
            sql.Close();

            return num > 0;
        }
Example #3
0
        public bool ExistsPath( string path )
        {
            StringBuilder queryBuilder = new StringBuilder();

            path = path.Replace( "'", "''" );

            queryBuilder.AppendFormat( "SELECT COUNT(*) FROM FILESYSTEM WHERE PATH = '{0}'", path );

            SqlCore sql = new SqlCore( DataUtils.GetConnectionString() );
            sql.Open();
            int num = Convert.ToInt32( sql.DoScalarQuery( queryBuilder.ToString() ) );
            sql.Close();

            return num > 0;
        }