http://digital-flame.ru/

# Class TDataBaseUnit

Description | Hierarchy | Fields | Methods | Properties

## Unit

uDataBaseUnit

## Declaration

`type TDataBaseUnit = class(TDataModule)`

## Description

## Hierarchy

- TDataModule
- TDataBaseUnit

## Overview

### Fields

| `qSelectWhereIdParent: TFDQuery;`
| `qInsertFileOrFolder: TFDQuery;`
| `qDelete: TFDQuery;`
| `qUpdateIdParent: TFDQuery;`
| `qGetUserRootD: TFDQuery;`
| `qIsFolder: TFDQuery;`
| `qSelectParentOfParent: TFDQuery;`
| `qExactSearch: TFDQuery;`
| `qEntrySearch: TFDQuery;`
| `qCaseSensitiveSearch: TFDQuery;`
| `qSelectFileTypeWhere: TFDQuery;`
| `qSelectFromFoldersAndFilesWhereID: TFDQuery;`
| `qIsFileAttachedTests: TFDQuery;`
| `qIsFileAttachedQuestionaires: TFDQuery;`
| `qIsFileAttachedCourses: TFDQuery;`
| `qSelectFromTestsWhereID: TFDQuery;`
| `qSelectFromQuestionairesWhere: TFDQuery;`
| `qSelectCourses: TFDQuery;`
| `qSelectChildrenFromFoldersAndFiles: TFDQuery;`
| `qSelectFileExtensionsByType: TFDQuery;`

### Methods

| `procedure DataModuleCreate(Sender: TObject);`
| `procedure FDTableCalcFields(DataSet: TDataSet);`
| `constructor Create(AOwner:TComponent); override;`
| `procedure ConnectQueriesAndFDTable;`
| `function IsFolder(Aid: integer):boolean;`
| `procedure OpenFolder(idParent,idUser:Integer);`
| `procedure OpenFilesOfUser(idUser: Integer);`
| `procedure AdjustDBGrid;`
| `function GetIDOfRootFolderOfUser(idUser: integer): Integer;`
| `procedure SortByCreationDate;`
| `function GetIDOfFileType(FileType:string):integer;`
| `function IsThisPictureByID(AID:integer):boolean;`
| `procedure SelectByFileType(AFileTypeValue: String);`
| `function IsFileAttached( AID: Integer; var AFileName:String; var AAttachedToTestsSL:TStringList; var AAttachedToQuestionairesSL:TStringList; var AAttachedToCoursesSL:TStringList ): boolean;`

### Properties

| `property FDConnection: TFDConnection read FFDConnection write FFDConnection;`
| `property IDOfRootFolderOfUser: integer read FIDOfRootFolderOfUser write FIDOfRootFolderOfUser;`
| `property IDCurrentFolder: integer read FIDCurrentFolder write FIDCurrentFolder;`

## Description

### Fields

| `qSelectWhereIdParent: TFDQuery;`

| `qInsertFileOrFolder: TFDQuery;`

| `qDelete: TFDQuery;`

| `qUpdateIdParent: TFDQuery;`

| `qGetUserRootD: TFDQuery;`

| `qIsFolder: TFDQuery;`

| `qSelectParentOfParent: TFDQuery;`

| `qExactSearch: TFDQuery;`

| `qEntrySearch: TFDQuery;`

| `qCaseSensitiveSearch: TFDQuery;`

| `qSelectFileTypeWhere: TFDQuery;`

| `qSelectFromFoldersAndFilesWhereID: TFDQuery;`

| `qIsFileAttachedTests: TFDQuery;`

| `qIsFileAttachedQuestionaires: TFDQuery;`

| `qIsFileAttachedCourses: TFDQuery;`

| `qSelectFromTestsWhereID: TFDQuery;`

| `qSelectFromQuestionairesWhere: TFDQuery;`

| `qSelectCourses: TFDQuery;`

| `qSelectChildrenFromFoldersAndFiles: TFDQuery;`

| `qSelectFileExtensionsByType: TFDQuery;`

### Methods

| `procedure DataModuleCreate(Sender: TObject);`

| `procedure FDTableCalcFields(DataSet: TDataSet);`

| `constructor Create(AOwner:TComponent); override;`
Public declarations

| `procedure ConnectQueriesAndFDTable;`
just connects all queries and FDTable

| `function IsFolder(Aid: integer):boolean;`
checks if IsFolder by id in database

| `procedure OpenFolder(idParent,idUser:Integer);`
opens folder with idParent for idUser

| `procedure OpenFilesOfUser(idUser: Integer);`
opens all files of user in FDTable

| `procedure AdjustDBGrid;`
adjusting coloumn width and etcetra

| `function GetIDOfRootFolderOfUser(idUser: integer): Integer;`
finds IDOfRootFolder of User

| `procedure SortByCreationDate;`
Sorts by Creation Date

| `function GetIDOfFileType(FileType:string):integer;`
will get ID of one of fileTypes -Picture -Video -Audio -Other

| `function IsThisPictureByID(AID:integer):boolean;`
checks if this Picture by ID

| `procedure SelectByFileType(AFileTypeValue: String);`
selects by filetype

| `function IsFileAttached( AID: Integer; var AFileName:String; var AAttachedToTestsSL:TStringList; var AAttachedToQuestionairesSL:TStringList; var AAttachedToCoursesSL:TStringList ): boolean;`
this function checks by id if File Is Attached and if so - records names of tests,questionaires and files to AAttachedToTestsSL,AAttachedToQuestionairesSL,AAttachedToCoursesSL

### Properties

| `property FDConnection: TFDConnection read FFDConnection write FFDConnection;`
——–PUBLIC PROPERTIES

| `property IDOfRootFolderOfUser: integer read FIDOfRootFolderOfUser write FIDOfRootFolderOfUser;`

| `property IDCurrentFolder: integer read FIDCurrentFolder write FIDCurrentFolder;`

Generated by PasDoc 0.14.0.