C# Класс Nagru___Manga_Organizer.SQL

Controls access to the database
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
SQL ( ) : System

Instantiates the non-static sqlBase that holds the DB connection

Описание методов

BeginTransaction() публичный статический Метод

Starts a new transaction USE WITH CAUTION: SQLite DOES NOT SUPPORT MULTIPLE TRANSACTIONS
public static BeginTransaction ( ) : int
Результат int

CleanUpArtists() публичный статический Метод

Deletes all unused artists from the DB
public static CleanUpArtists ( ) : int
Результат int

CleanUpReferences() публичный статический Метод

Re-creates the MangaTag table to remove PK value gaps
public static CleanUpReferences ( ) : int
Результат int

CleanUpTags() публичный статический Метод

Deletes all unused tags from the DB
public static CleanUpTags ( ) : int
Результат int

CommitTransaction() публичный статический Метод

Commits the current transaction
public static CommitTransaction ( ) : int
Результат int

Connect() публичный статический Метод

Opens a connection to the database and imports any previous Manga DB's if possible
public static Connect ( ) : bool
Результат bool

ContainsEntry() публичный статический Метод

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
Результат bool

DeleteManga() публичный статический Метод

Deletes an entry from the database
public static DeleteManga ( int mangaID ) : bool
mangaID int The ID of the record to be deleted
Результат bool

DeleteTag() публичный статический Метод

Deletes a tag based on the text passed in
public static DeleteTag ( string TagText ) : int
TagText string The tag(s) to delete
Результат int

Disconnect() публичный статический Метод

Vacuum's the DB and closes the connection
public static Disconnect ( bool Recycle = false ) : void
Recycle bool
Результат void

GetAllManga() публичный статический Метод

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
Результат System.Data.DataTable

GetArtists() публичный статический Метод

Returns all the artists in the database
public static GetArtists ( ) : string[]
Результат string[]

GetDefaultType() публичный статический Метод

Returns the default manga category
public static GetDefaultType ( ) : string
Результат string

GetLogContents() публичный статический Метод

Returns the details of everything logged so far
public static GetLogContents ( ) : DataTable
Результат System.Data.DataTable

GetManga() публичный статический Метод

Returns the full details of a specified manga
public static GetManga ( int mangaID ) : DataTable
mangaID int The ID of the record
Результат System.Data.DataTable

GetMangaDetail() публичный статический Метод

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
Результат string

GetMangaTitle() публичный статический Метод

Returns the EH formatted title of a Manga
public static GetMangaTitle ( int mangaID ) : string
mangaID int The ID of the record to access
Результат string

GetSetting() публичный статический Метод

Returns a setting from the DB
public static GetSetting ( Setting DBSetting ) : object
DBSetting Setting
Результат object

GetTags() публичный статический Метод

Returns all the tags in the database
public static GetTags ( ) : string[]
Результат string[]

GetThumbnail() публичный статический Метод

Returns the manga's thumbnail
public static GetThumbnail ( int MangaID ) : Image
MangaID int
Результат Image

GetTypes() публичный статический Метод

Returns all the manga types in the database
public static GetTypes ( ) : string[]
Результат string[]

HasThumbnail() публичный статический Метод

Returns true if the entry has a thumbnail for it
public static HasThumbnail ( int MangaID ) : bool
MangaID int The ID of the record
Результат bool

IsConnected() публичный статический Метод

Returns whether or not the DB connection is currently open
public static IsConnected ( ) : bool
Результат bool

LogMessage() публичный статический Метод

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
Результат bool

LogMessage() публичный статический Метод

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
Результат bool

RollbackTransaction() публичный статический Метод

Rollbacks the current transaction
public static RollbackTransaction ( ) : int
Результат int

SaveManga() публичный статический Метод

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
Результат int

SaveReadProgress() публичный статический Метод

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
Результат int

SaveThumbnail() публичный статический Метод

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
Результат bool

UpdateSetting() публичный статический Метод

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
Результат bool

VacuumDatabase() публичный статический Метод

Runs the vacuum command on the database to reduce filesize if possible
public static VacuumDatabase ( ) : bool
Результат bool