C# Class Nagru___Manga_Organizer.SQL

Controls access to the database
Afficher le fichier Open project: Nagru/Manga-Organizer Class Usage Examples

Méthodes publiques

Méthode Description
BeginTransaction ( ) : int

Starts a new transaction USE WITH CAUTION: SQLite DOES NOT SUPPORT MULTIPLE TRANSACTIONS

CleanUpArtists ( ) : int

Deletes all unused artists from the DB

CleanUpReferences ( ) : int

Re-creates the MangaTag table to remove PK value gaps

CleanUpTags ( ) : int

Deletes all unused tags from the DB

CommitTransaction ( ) : int

Commits the current transaction

Connect ( ) : bool

Opens a connection to the database and imports any previous Manga DB's if possible

ContainsEntry ( string Artist, string Title ) : bool

Returns whether the entry exists in the DB

DeleteManga ( int mangaID ) : bool

Deletes an entry from the database

DeleteTag ( string TagText ) : int

Deletes a tag based on the text passed in

Disconnect ( bool Recycle = false ) : void

Vacuum's the DB and closes the connection

GetAllManga ( string SearchText = null, int MangaID = -1 ) : DataTable

Returns the details of every manga in the database

GetArtists ( ) : string[]

Returns all the artists in the database

GetDefaultType ( ) : string

Returns the default manga category

GetLogContents ( ) : DataTable

Returns the details of everything logged so far

GetManga ( int mangaID ) : DataTable

Returns the full details of a specified manga

GetMangaDetail ( int mangaID, Manga Column ) : string

Returns a single detail of a specified manga

GetMangaTitle ( int mangaID ) : string

Returns the EH formatted title of a Manga

GetSetting ( Setting DBSetting ) : object

Returns a setting from the DB

GetTags ( ) : string[]

Returns all the tags in the database

GetThumbnail ( int MangaID ) : Image

Returns the manga's thumbnail

GetTypes ( ) : string[]

Returns all the manga types in the database

HasThumbnail ( int MangaID ) : bool

Returns true if the entry has a thumbnail for it

IsConnected ( ) : bool

Returns whether or not the DB connection is currently open

LogMessage ( Exception exception, EventType eventType, object Source = null ) : bool

Logs exception details to the DB to support future debugging

LogMessage ( string LogMessage, EventType eventType, object Source = null ) : bool

Logs exception details to the DB to support future debugging

RollbackTransaction ( ) : int

Rollbacks the current transaction

SaveManga ( string Artist, string Title, System.DateTime PublishedDate, string Tags = null, string Location = null, decimal Pages, int PageReadCount = -1, string Type = null, decimal Rating, string Description = null, string URL = null, bool ReadManga = false, int MangaID = -1 ) : int

Insert or updates a manga

SaveReadProgress ( int MangaID, int PageReadCount = -1 ) : int

Stores the last page read of a manga and updates it's read status

SaveThumbnail ( int MangaID, Image image ) : bool

Saves a thumbnail image to the database

UpdateSetting ( Setting DBSetting, object setting ) : bool

Update the indicated setting

VacuumDatabase ( ) : bool

Runs the vacuum command on the database to reduce filesize if possible

Private Methods

Méthode Description
SQL ( ) : System

Instantiates the non-static sqlBase that holds the DB connection

Method Details

BeginTransaction() public static méthode

Starts a new transaction USE WITH CAUTION: SQLite DOES NOT SUPPORT MULTIPLE TRANSACTIONS
public static BeginTransaction ( ) : int
Résultat int

CleanUpArtists() public static méthode

Deletes all unused artists from the DB
public static CleanUpArtists ( ) : int
Résultat int

CleanUpReferences() public static méthode

Re-creates the MangaTag table to remove PK value gaps
public static CleanUpReferences ( ) : int
Résultat int

CleanUpTags() public static méthode

Deletes all unused tags from the DB
public static CleanUpTags ( ) : int
Résultat int

CommitTransaction() public static méthode

Commits the current transaction
public static CommitTransaction ( ) : int
Résultat int

Connect() public static méthode

Opens a connection to the database and imports any previous Manga DB's if possible
public static Connect ( ) : bool
Résultat bool

ContainsEntry() public static méthode

Returns whether the entry exists in the DB
public static ContainsEntry ( string Artist, string Title ) : bool
Artist string The artist's name
Title string The title of the maga
Résultat bool

DeleteManga() public static méthode

Deletes an entry from the database
public static DeleteManga ( int mangaID ) : bool
mangaID int The ID of the record to be deleted
Résultat bool

DeleteTag() public static méthode

Deletes a tag based on the text passed in
public static DeleteTag ( string TagText ) : int
TagText string The tag(s) to delete
Résultat int

Disconnect() public static méthode

Vacuum's the DB and closes the connection
public static Disconnect ( bool Recycle = false ) : void
Recycle bool
Résultat void

GetAllManga() public static méthode

Returns the details of every manga in the database
public static GetAllManga ( string SearchText = null, int MangaID = -1 ) : DataTable
SearchText string The user search parameters to compare against
MangaID int
Résultat System.Data.DataTable

GetArtists() public static méthode

Returns all the artists in the database
public static GetArtists ( ) : string[]
Résultat string[]

GetDefaultType() public static méthode

Returns the default manga category
public static GetDefaultType ( ) : string
Résultat string

GetLogContents() public static méthode

Returns the details of everything logged so far
public static GetLogContents ( ) : DataTable
Résultat System.Data.DataTable

GetManga() public static méthode

Returns the full details of a specified manga
public static GetManga ( int mangaID ) : DataTable
mangaID int The ID of the record
Résultat System.Data.DataTable

GetMangaDetail() public static méthode

Returns a single detail of a specified manga
public static GetMangaDetail ( int mangaID, Manga Column ) : string
mangaID int The ID of the record
Column Manga
Résultat string

GetMangaTitle() public static méthode

Returns the EH formatted title of a Manga
public static GetMangaTitle ( int mangaID ) : string
mangaID int The ID of the record to access
Résultat string

GetSetting() public static méthode

Returns a setting from the DB
public static GetSetting ( Setting DBSetting ) : object
DBSetting Setting
Résultat object

GetTags() public static méthode

Returns all the tags in the database
public static GetTags ( ) : string[]
Résultat string[]

GetThumbnail() public static méthode

Returns the manga's thumbnail
public static GetThumbnail ( int MangaID ) : Image
MangaID int
Résultat Image

GetTypes() public static méthode

Returns all the manga types in the database
public static GetTypes ( ) : string[]
Résultat string[]

HasThumbnail() public static méthode

Returns true if the entry has a thumbnail for it
public static HasThumbnail ( int MangaID ) : bool
MangaID int The ID of the record
Résultat bool

IsConnected() public static méthode

Returns whether or not the DB connection is currently open
public static IsConnected ( ) : bool
Résultat bool

LogMessage() public static méthode

Logs exception details to the DB to support future debugging
public static LogMessage ( Exception exception, EventType eventType, object Source = null ) : bool
exception System.Exception The exception that occurred
eventType EventType The type of event being logged
Source object
Résultat bool

LogMessage() public static méthode

Logs exception details to the DB to support future debugging
public static LogMessage ( string LogMessage, EventType eventType, object Source = null ) : bool
LogMessage string Coder explanation of the situation
eventType EventType The type of event being logged
Source object The object that caused the error
Résultat bool

RollbackTransaction() public static méthode

Rollbacks the current transaction
public static RollbackTransaction ( ) : int
Résultat int

SaveManga() public static méthode

Insert or updates a manga
public static SaveManga ( string Artist, string Title, System.DateTime PublishedDate, string Tags = null, string Location = null, decimal Pages, int PageReadCount = -1, string Type = null, decimal Rating, string Description = null, string URL = null, bool ReadManga = false, int MangaID = -1 ) : int
Artist string The name of the artist
Title string The title of the manga
PublishedDate System.DateTime The date the manga was published to EH
Tags string The comma-delimited tags
Location string The local filepath
Pages decimal The number of pages
PageReadCount int The last page read
Type string The type of the manga
Rating decimal The decimal rating
Description string User comments
URL string The source URL of the gallery
ReadManga bool Whether the manga has been read
MangaID int If passed through, attempts to update the indicated record
Résultat int

SaveReadProgress() public static méthode

Stores the last page read of a manga and updates it's read status
public static SaveReadProgress ( int MangaID, int PageReadCount = -1 ) : int
MangaID int The ID of the manga to update
PageReadCount int The last page read
Résultat int

SaveThumbnail() public static méthode

Saves a thumbnail image to the database
public static SaveThumbnail ( int MangaID, Image image ) : bool
MangaID int The manga the image is for
image Image The cover thumbnail to save
Résultat bool

UpdateSetting() public static méthode

Update the indicated setting
public static UpdateSetting ( Setting DBSetting, object setting ) : bool
DBSetting Setting The name of the setting to update
setting object The new value
Résultat bool

VacuumDatabase() public static méthode

Runs the vacuum command on the database to reduce filesize if possible
public static VacuumDatabase ( ) : bool
Résultat bool