public List <FileItDocument> GetDocumentsByIds(List <string> ids, bool IncludeThumbs, bool includeDeleted)
        {
            var result = new List <FileItDocument>();

            var sql = "SELECT * FROM " + CABINETID + "_IMAGES";

            var whereClause = "";

            if (ids.Any())
            {
                ids.ForEach(i =>
                {
                    whereClause += whereClause.Length == 0 ? " WHERE " : " AND ";
                    whereClause += "FILENAME='" + i + "'";
                });
            }
            if (!includeDeleted)
            {
                whereClause += whereClause.Length == 0 ? " WHERE " : " AND ";
                whereClause += "DELETED='N'";
            }
            sql = sql + whereClause;

            var docs = FireBirdHelper.GenericSelect(sql, CabinetConnectionString);

            foreach (DataRow dr in docs.Rows)
            {
                result.Add(new FileItDocument(dr, OSTOREPATH, IncludeThumbs));
            }

            return(result);
        }
        public List <FileItDocument> GetDocuments(List <FileItDocumentLookup> lookups, bool IncludeThumbs)
        {
            var result = new List <FileItDocument>();

            var sql         = "SELECT * FROM " + CABINETID + "_IMAGES";
            var whereClause = "";

            if (lookups.Any())
            {
                lookups.ForEach(l =>
                {
                    whereClause += whereClause.Length == 0 ? " WHERE " : "";
                    whereClause += l.ToWhereClause();
                });
            }
            sql = sql + whereClause;

            var docs = FireBirdHelper.GenericSelect(sql, CabinetConnectionString);

            foreach (DataRow dr in docs.Rows)
            {
                result.Add(new FileItDocument(dr, OSTOREPATH, IncludeThumbs));
            }

            return(result);
        }